Class ResourcePropertyImpl
java.lang.Object
org.apache.sling.validation.impl.model.ResourcePropertyImpl
- All Implemented Interfaces:
ResourceProperty
-
Constructor Summary
ModifierConstructorDescriptionprotected
ResourcePropertyImpl
(String name, String nameRegex, boolean isMultiple, boolean isRequired, List<ValidatorInvocation> validators) Is only supposed to be used fromResourcePropertyBuilder
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getName()
Returns the name of this property.Returns the name pattern for this property.Returns a list ofValidatorInvocation
s which should be applied on this property.int
hashCode()
boolean
boolean
Returnstrue
if 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:ResourceProperty
Returns 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 notnull
this name is not relevant for matching the property.- Specified by:
getName
in interfaceResourceProperty
- Returns:
- the name
-
getNamePattern
Description copied from interface:ResourceProperty
Returns 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:
getNamePattern
in interfaceResourceProperty
- Returns:
- the name pattern (if one is set) or
null
-
isMultiple
public boolean isMultiple()- Specified by:
isMultiple
in interfaceResourceProperty
- Returns:
true
if the property is expected to contain multiple values,false
otherwise
-
isRequired
public boolean isRequired()Description copied from interface:ResourceProperty
Returnstrue
if at least one property matching the name/namePattern is required.- Specified by:
isRequired
in interfaceResourceProperty
- Returns:
true
if the property is required,false
otherwise
-
getValidatorInvocations
Description copied from interface:ResourceProperty
Returns a list ofValidatorInvocation
s which should be applied on this property.- Specified by:
getValidatorInvocations
in interfaceResourceProperty
- Returns:
- the
List
ofValidatorInvocation
s
-
toString
-
hashCode
public int hashCode() -
equals
-