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)
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, setTitlepublic 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 ConstraintgetType in class AbstractConstraintpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.util.List getAllowedValues()
protected java.util.List getRawAllowedValues()
public java.lang.String getDisplayLabel(java.lang.String constraintAllowableValue)
"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()
AbstractConstraintRegisters the constraint with the registry, if present. Call this method if you want the constraint to be auto-registered.
initialize in interface Constraintinitialize in class AbstractConstraintAbstractConstraint.initialize()public java.util.Map getParameters()
ConstraintgetParameters in interface ConstraintgetParameters in class AbstractConstraintAbstractConstraint.getParameters()protected void evaluateSingleValue(java.lang.Object value)
AbstractConstraintevaluateSingleValue in class AbstractConstraintAbstractConstraint.evaluateSingleValue(java.lang.Object)Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.