|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.alfresco.repo.dictionary.constraint.AbstractConstraint
org.alfresco.repo.dictionary.constraint.ListOfValuesConstraint
public class ListOfValuesConstraint
Constraint implementation that ensures the value is one of a constrained list of values. By default, this constraint is case-sensitive.
ListOfValuesConstraint.setAllowedValues(List),
ListOfValuesConstraint.setCaseSensitive(boolean)| Field Summary | |
|---|---|
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
|
| Fields inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint |
|---|
ERR_EVALUATE_EXCEPTION, ERR_PROP_NOT_SET |
| Constructor Summary | |
|---|---|
ListOfValuesConstraint()
|
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint |
|---|
checkPropertyNotNull, evaluate, evaluateCollection, getShortName, getTitle, set_shortName, setRegistry, setShortName, setTitle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
public ListOfValuesConstraint()
| Method Detail |
|---|
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()
Constraint
getParameters in interface ConstraintgetParameters in class AbstractConstraintAbstractConstraint.getParameters()protected void evaluateSingleValue(java.lang.Object value)
AbstractConstraint
evaluateSingleValue in class AbstractConstraintAbstractConstraint.evaluateSingleValue(java.lang.Object)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||