Class DefaultValidatorCompoundValueFactory
java.lang.Object
org.tentackle.validate.DefaultValidatorCompoundValueFactory
- All Implemented Interfaces:
ValidatorCompoundValueFactory
@Service(ValidatorCompoundValueFactory.class)
public class DefaultValidatorCompoundValueFactory
extends Object
implements ValidatorCompoundValueFactory
Default compound value factory for validators.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected CompoundValuecreateCompoundValue(String value, Class<?> clazz, Function<String, ScriptConverter> scriptConverterProvider) Creates a compound value.
The created compound value is always created as cached and threadsafe execution required.createConditionParameter(String condition) Creates the compound value for the condition parameter.createMessageParameter(String message) Creates the compound value for the message parameter.createValueParameter(String value, Class<?> clazz) Creates the compound value for the value parameter.
-
Constructor Details
-
DefaultValidatorCompoundValueFactory
public DefaultValidatorCompoundValueFactory()
-
-
Method Details
-
createValueParameter
Description copied from interface:ValidatorCompoundValueFactoryCreates the compound value for the value parameter.- Specified by:
createValueParameterin interfaceValidatorCompoundValueFactory- Parameters:
value- the value from the annotationclazz- the type of the value- Returns:
- the created compound value
-
createConditionParameter
Description copied from interface:ValidatorCompoundValueFactoryCreates the compound value for the condition parameter.- Specified by:
createConditionParameterin interfaceValidatorCompoundValueFactory- Parameters:
condition- the condition text from the annotation- Returns:
- the created compound value
-
createMessageParameter
Description copied from interface:ValidatorCompoundValueFactoryCreates the compound value for the message parameter.Throws
ScriptRuntimeExceptionif message contains a script-based I18N translation and there is no messageScriptConverterfor the corresponding scripting language.- Specified by:
createMessageParameterin interfaceValidatorCompoundValueFactory- Parameters:
message- the message text from the annotation- Returns:
- the created compound value
-
createCompoundValue
protected CompoundValue createCompoundValue(String value, Class<?> clazz, Function<String, ScriptConverter> scriptConverterProvider) Creates a compound value.
The created compound value is always created as cached and threadsafe execution required.- Parameters:
value- the string valueclazz- the class of the valuescriptConverterProvider- the optional script converter provider- Returns:
- the compound value
-