Class StringLengthConstraint
java.lang.Object
org.alfresco.repo.dictionary.constraint.AbstractConstraint
org.alfresco.repo.dictionary.constraint.StringLengthConstraint
- All Implemented Interfaces:
Constraint
Constraint implementation that ensures that the length of the String value.
- Author:
- Derek Hulley
- See Also:
-
Field Summary
Fields inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
ERR_EVALUATE_EXCEPTION, ERR_PROP_NOT_SET -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidevaluateSingleValue(Object value) Support for evaluation of properties.intintReturns the parameters passed to the instance of the constraint.getType()Returns the 'type' of the constraint, this is the identifier given to constraint in the configuration.voidsetMaxLength(int maxLength) Set the maximum number of characters allowed.voidsetMinLength(int minLength) Set the minimum number of characters allowed.toString()Methods inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
checkPropertyNotNull, evaluate, evaluateCollection, getShortName, getTitle, initialize, set_shortName, setRegistry, setShortName, setTitle
-
Constructor Details
-
StringLengthConstraint
public StringLengthConstraint()
-
-
Method Details
-
getType
Returns the 'type' of the constraint, this is the identifier given to constraint in the configuration.- Specified by:
getTypein interfaceConstraint- Overrides:
getTypein classAbstractConstraint- Returns:
- The type
-
toString
-
getMinLength
public int getMinLength()- Returns:
- Returns the minimum number of characters allowed
-
setMinLength
public void setMinLength(int minLength) Set the minimum number of characters allowed. Valid values are in the range [0,Integer.MAX_VALUE].- Parameters:
minLength- the minimum numbers of characters allowed
-
getMaxLength
public int getMaxLength()- Returns:
- Returns the maximum number of characters allowed
-
setMaxLength
public void setMaxLength(int maxLength) Set the maximum number of characters allowed. Valid values are in the range [0,Integer.MAX_VALUE].- Parameters:
maxLength- the minimum numbers of characters allowed
-
getParameters
Description copied from interface:ConstraintReturns the parameters passed to the instance of the constraint.- Specified by:
getParametersin interfaceConstraint- Overrides:
getParametersin classAbstractConstraint- Returns:
- Map of parameters or an empty Map if none exist
-
evaluateSingleValue
Description copied from class:AbstractConstraintSupport for evaluation of properties. The value passed in will never be a Collection and will never be null.- Specified by:
evaluateSingleValuein classAbstractConstraint
-