Class ResourcePropertyImpl
java.lang.Object
org.apache.sling.validation.impl.model.ResourcePropertyImpl
- All Implemented Interfaces:
ResourceProperty
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedResourcePropertyImpl(String name, String nameRegex, boolean isMultiple, boolean isRequired, List<ValidatorInvocation> validators) Is only supposed to be used fromResourcePropertyBuilder. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetName()Returns the name of this property.Returns the name pattern for this property.Returns a list ofValidatorInvocations which should be applied on this property.inthashCode()booleanbooleanReturnstrueif at least one property matching the name/namePattern is required.toString()
-
Constructor Details
-
ResourcePropertyImpl
protected ResourcePropertyImpl(@Nonnull String name, String nameRegex, boolean isMultiple, boolean isRequired, @Nonnull List<ValidatorInvocation> validators) throws IllegalArgumentException Is only supposed to be used fromResourcePropertyBuilder.- Parameters:
name-nameRegex-isMultiple-isRequired-validators-- Throws:
IllegalArgumentException
-
-
Method Details
-
getName
Description copied from interface:ResourcePropertyReturns the name of this property. This must match the name of the property which is validated through this section of the validation model. In caseResourceProperty.getNamePattern()is notnullthis name is not relevant for matching the property.- Specified by:
getNamein interfaceResourceProperty- Returns:
- the name
-
getNamePattern
Description copied from interface:ResourcePropertyReturns the name pattern for this property. In case this is not returningnull, this pattern is used for finding the properties which should be validated.- Specified by:
getNamePatternin interfaceResourceProperty- Returns:
- the name pattern (if one is set) or
null
-
isMultiple
public boolean isMultiple()- Specified by:
isMultiplein interfaceResourceProperty- Returns:
trueif the property is expected to contain multiple values,falseotherwise
-
isRequired
public boolean isRequired()Description copied from interface:ResourcePropertyReturnstrueif at least one property matching the name/namePattern is required.- Specified by:
isRequiredin interfaceResourceProperty- Returns:
trueif the property is required,falseotherwise
-
getValidatorInvocations
Description copied from interface:ResourcePropertyReturns a list ofValidatorInvocations which should be applied on this property.- Specified by:
getValidatorInvocationsin interfaceResourceProperty- Returns:
- the
ListofValidatorInvocations
-
toString
-
hashCode
public int hashCode() -
equals
-