Class DataDictionaryValidatorImpl
java.lang.Object
org.flowable.common.engine.impl.service.CommonServiceImpl<C>
org.flowable.common.engine.impl.service.CommonEngineServiceImpl<PlatformEngineConfiguration>
com.flowable.platform.engine.impl.datadictionary.validation.DataDictionaryValidatorImpl
- All Implemented Interfaces:
DataDictionaryValidator
public class DataDictionaryValidatorImpl
extends CommonEngineServiceImpl<PlatformEngineConfiguration>
implements DataDictionaryValidator
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static class
protected static class
protected static enum
protected static class
protected static enum
-
Field Summary
Fields inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
commandExecutor
Fields inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
configuration
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates and returns a new instance of DataDictionaryValidationBuilder.createValidationContext
(String variableName, String customTypeName, String type, Object value) protected static Object
extractValue
(Object object) internalValidate
(String variableName, DictionaryType type, Object value, DataDictionaryValidatorImpl.ValidationMode validationMode) protected ValidationResult
internalValidate
(String variableName, TypeProperty typeProperty, Object value, DataDictionaryValidatorImpl.ValidationMode validationMode) protected boolean
isCollectionWithMap
(Object object) protected Object
unwrapValueToValidate
(Object value, String type) protected ValidationResult
protected void
validate
(DataDictionaryValidatorImpl.ValidationContext context, DictionaryType dictionaryType, Object value, DataDictionaryValidatorImpl.ValidationMode validationMode) protected void
validate
(DataDictionaryValidatorImpl.ValidationContext context, TypeProperty typeProperty, Object value, DataDictionaryValidatorImpl.ValidationMode validationMode) validate
(DataDictionaryValidatorImpl.ValidationContext context, Collection<Constraint> constraints, DataDictionaryValidatorImpl.ValidationMode validationMode) validate
(String variableName, DictionaryType type, Object value) Validates if the specified value is compatible with the defined DictionaryType.validate
(String variableName, TypeProperty typeProperty, Object value) Validates if the specified value adheres to the constraints and specifications of the given TypeProperty.protected void
validateProperties
(DataDictionaryValidatorImpl.ValidationContext context, Map<String, TypeProperty> properties, com.fasterxml.jackson.databind.JsonNode currentObject, DataDictionaryValidatorImpl.ValidationMode validationMode) protected boolean
Methods inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
getCommandExecutor, setCommandExecutor
Methods inherited from class org.flowable.common.engine.impl.service.CommonServiceImpl
getConfiguration
-
Constructor Details
-
DataDictionaryValidatorImpl
-
-
Method Details
-
validate
Description copied from interface:DataDictionaryValidator
Validates if the specified value is compatible with the defined DictionaryType. This method checks whether the value adheres to the type specifications, including any constraints and flags associated with the type, such as the 'required' flag. The validation process includes type compatibility and constraint checking.- Specified by:
validate
in interfaceDataDictionaryValidator
- Parameters:
variableName
- The name of the variable being validated. This is used for identification purposes in the validation process.type
- The DictionaryType against which the value is to be validated.value
- The value to be validated.- Returns:
- ValidationResult An object encapsulating the result of the validation.
-
validate
Description copied from interface:DataDictionaryValidator
Validates if the specified value adheres to the constraints and specifications of the given TypeProperty. This method is responsible for ensuring that the provided value aligns with the expected characteristics defined by the TypeProperty, such as data type, format, range, or any other custom constraints. It is particularly useful for validating individual properties of a complex type or structure.- Specified by:
validate
in interfaceDataDictionaryValidator
- Parameters:
variableName
- The name of the variable being validated. This name is used primarily for identification and reporting purposes.typeProperty
- The TypeProperty to validate against.value
- The value to be validated against the TypeProperty.- Returns:
- ValidationResult An object encapsulating the result of the validation.
-
createBuilder
Description copied from interface:DataDictionaryValidator
Creates and returns a new instance of DataDictionaryValidationBuilder. This builder is used to configure a validation for data against a defined data dictionary type. It is used to set up various aspects of validation such as the type or type property to validate against, the value to validate, and the level of validation (type check only or full validation).- Specified by:
createBuilder
in interfaceDataDictionaryValidator
- Returns:
- A new instance of DataDictionaryValidationBuilder.
-
internalValidate
protected DataDictionaryValidatorImpl.ValidationContext internalValidate(String variableName, DictionaryType type, Object value, DataDictionaryValidatorImpl.ValidationMode validationMode) -
internalValidate
protected ValidationResult internalValidate(String variableName, TypeProperty typeProperty, Object value, DataDictionaryValidatorImpl.ValidationMode validationMode) -
isCollectionWithMap
-
createValidationContext
protected DataDictionaryValidatorImpl.ValidationContext createValidationContext(String variableName, String customTypeName, String type, Object value) -
validate
protected DataDictionaryValidatorImpl.TypeCompatibility validate(DataDictionaryValidatorImpl.ValidationContext context, Collection<Constraint> constraints, DataDictionaryValidatorImpl.ValidationMode validationMode) -
unwrapValueToValidate
-
validate
protected void validate(DataDictionaryValidatorImpl.ValidationContext context, DictionaryType dictionaryType, Object value, DataDictionaryValidatorImpl.ValidationMode validationMode) -
validate
protected void validate(DataDictionaryValidatorImpl.ValidationContext context, TypeProperty typeProperty, Object value, DataDictionaryValidatorImpl.ValidationMode validationMode) -
validateProperties
protected void validateProperties(DataDictionaryValidatorImpl.ValidationContext context, Map<String, TypeProperty> properties, com.fasterxml.jackson.databind.JsonNode currentObject, DataDictionaryValidatorImpl.ValidationMode validationMode) -
validateTypeCompatibility
- Returns:
- true in case type is compatible, otherwise returns false and adds validation error to the context
-
extractValue
-
validate
protected ValidationResult validate(DataDictionaryValidatorImpl.DataDictionaryValidationBuilderImpl builder)
-