public class ListOfValuesConstraint extends AbstractConstraint
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALLOWED_VALUES_PARAM |
static java.lang.String |
CASE_SENSITIVE_PARAM |
protected boolean |
caseSensitive |
static java.lang.String |
CONSTRAINT_TYPE |
protected boolean |
sorted |
static java.lang.String |
SORTED_PARAM |
ERR_EVALUATE_EXCEPTION, ERR_PROP_NOT_SET
Constructor and Description |
---|
ListOfValuesConstraint() |
Modifier and Type | Method and Description |
---|---|
protected void |
evaluateSingleValue(java.lang.Object value)
Support for evaluation of properties.
|
java.util.List |
getAllowedValues()
Get the allowed values.
|
java.lang.String |
getDisplayLabel(java.lang.String constraintAllowableValue,
MessageLookup messageLookup)
Get the display label for the specified allowable value in this constraint.
|
java.util.Map |
getParameters()
Returns the parameters passed to the instance of the constraint.
|
protected java.util.List |
getRawAllowedValues()
Get the allowed values.
|
java.lang.String |
getType()
Returns the 'type' of the constraint, this is the identifier given to
constraint in the configuration.
|
void |
initialize()
Initializes the constraint with appropriate values, which will depend
on the implementation itself.
|
boolean |
isCaseSensitive() |
boolean |
isSorted()
Indicates whether the list of values are sorted or not.
|
void |
setAllowedValues(java.util.List allowedValues)
Set the values that are allowed by the constraint.
|
void |
setCaseSensitive(boolean caseSensitive)
Set the handling of case checking.
|
void |
setSorted(boolean sorted)
Set whether the values are ordered or not.
|
java.lang.String |
toString() |
checkPropertyNotNull, evaluate, evaluateCollection, getShortName, getTitle, set_shortName, setRegistry, setShortName, setTitle
public static final java.lang.String CONSTRAINT_TYPE
public static final java.lang.String CASE_SENSITIVE_PARAM
public static final java.lang.String ALLOWED_VALUES_PARAM
public static final java.lang.String SORTED_PARAM
protected boolean caseSensitive
protected boolean sorted
public java.lang.String getType()
getType
in interface Constraint
getType
in class AbstractConstraint
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.List getAllowedValues()
protected java.util.List getRawAllowedValues()
public java.lang.String getDisplayLabel(java.lang.String constraintAllowableValue, MessageLookup messageLookup)
"listconstraint." + constraintName + "." + constraintAllowableValue. e.g. listconstraint.test_listConstraintOne.VALUE_ONE.This key is then used to look up a properties bundle for the localised display label. Spaces are allowed in the keys, but they should be escaped in the properties file as follows:
listconstraint.test_listConstraintOne.VALUE\ WITH\ SPACES=Display label
constraintAllowableValue
- null
.I18NUtil.getLocale()
public void setAllowedValues(java.util.List allowedValues)
values
- a list of allowed valuespublic boolean isCaseSensitive()
public void setCaseSensitive(boolean caseSensitive)
caseSensitive
- true if the constraint is case-sensitive (default),
or false for case-insensitive.public boolean isSorted()
public void setSorted(boolean sorted)
sorted
- true if sorted, false otherwisepublic void initialize()
AbstractConstraint
Registers the constraint with the registry, if present. Call this method if you want the constraint to be auto-registered.
initialize
in interface Constraint
initialize
in class AbstractConstraint
AbstractConstraint.initialize()
public java.util.Map getParameters()
Constraint
getParameters
in interface Constraint
getParameters
in class AbstractConstraint
AbstractConstraint.getParameters()
protected void evaluateSingleValue(java.lang.Object value)
AbstractConstraint
evaluateSingleValue
in class AbstractConstraint
AbstractConstraint.evaluateSingleValue(java.lang.Object)
Copyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.