Class DefaultAttributeContentValidator<T>
- java.lang.Object
-
- de.hybris.platform.cmsfacades.cmsitems.impl.DefaultAttributeContentValidator<T>
-
- Type Parameters:
T- the Object type being validated.
- All Implemented Interfaces:
AttributeContentValidator<T>
public class DefaultAttributeContentValidator<T> extends java.lang.Object implements AttributeContentValidator<T>
Default and generic implementation of theAttributeContentValidator. Works as a dispatcher to other AttributeValidators, by processing all validations stored in injected in this Bean if aPredicate<AttributeDesciptorModel>holds true.
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.StringCOLLECTION_TYPE
-
Constructor Summary
Constructors Constructor Description DefaultAttributeContentValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.Map<java.util.function.Predicate<AttributeDescriptorModel>,AttributeContentValidator>getValidatorMap()protected booleanisCollection(AttributeDescriptorModel attribute)will return true if this property is a collection (localized or not) as per our platform type systemvoidsetValidatorMap(java.util.Map<java.util.function.Predicate<AttributeDescriptorModel>,AttributeContentValidator> validatorMap)java.util.List<ValidationError>validate(T value, AttributeDescriptorModel attributeDescriptor)Performs validation on the given arguments.
-
-
-
Field Detail
-
COLLECTION_TYPE
protected static final java.lang.String COLLECTION_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
validate
public java.util.List<ValidationError> validate(T value, AttributeDescriptorModel attributeDescriptor)
Description copied from interface:AttributeContentValidatorPerforms validation on the given arguments.- Specified by:
validatein interfaceAttributeContentValidator<T>- Parameters:
value- the value objectattributeDescriptor- the attribute descriptor of the givenvalue.
-
isCollection
protected boolean isCollection(AttributeDescriptorModel attribute)
will return true if this property is a collection (localized or not) as per our platform type system- Parameters:
attribute- theAttributeDescriptorModeldescribing the metadata of the property of a class- Returns:
- a boolean
-
getValidatorMap
protected java.util.Map<java.util.function.Predicate<AttributeDescriptorModel>,AttributeContentValidator> getValidatorMap()
-
setValidatorMap
public void setValidatorMap(java.util.Map<java.util.function.Predicate<AttributeDescriptorModel>,AttributeContentValidator> validatorMap)
-
-