Class RegisteredConstraint
- java.lang.Object
-
- org.alfresco.repo.dictionary.constraint.RegisteredConstraint
-
- All Implemented Interfaces:
Constraint
public final class RegisteredConstraint extends Object implements Constraint
Constraint implementation that defers to constraints registered with the static instance of theConstraintRegistry.- Author:
- Derek Hulley
-
-
Constructor Summary
Constructors Constructor Description RegisteredConstraint()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidevaluate(Object value)Defers to the registered constraintMap<String,Object>getParameters()Defers to the registered constraintConstraintgetRegisteredConstraint()StringgetShortName()Gets the constraint name.StringgetTitle()Defers to the registered constraintStringgetType()Defers to the registered constraintvoidinitialize()Initializes the constraint with appropriate values, which will depend on the implementation itself.voidsetRegisteredName(String registeredName)Set the name of the constraint that will be used to look up the constraint that will be delegated to.voidsetShortName(String shortName)StringtoString()
-
-
-
Method Detail
-
getShortName
public String getShortName()
Description copied from interface:ConstraintGets the constraint name.- Specified by:
getShortNamein interfaceConstraint- Returns:
- the constraint name.
-
setShortName
public void setShortName(String shortName)
-
setRegisteredName
public void setRegisteredName(String registeredName)
Set the name of the constraint that will be used to look up the constraint that will be delegated to.
-
initialize
public void initialize()
Description copied from interface:ConstraintInitializes the constraint with appropriate values, which will depend on the implementation itself. This method can be implemented as a once-off, i.e. reinitialization does not have to be supported.- Specified by:
initializein interfaceConstraint
-
getRegisteredConstraint
public Constraint getRegisteredConstraint()
- Returns:
- the constraint that matches the registered name
-
getType
public String getType()
Defers to the registered constraint- Specified by:
getTypein interfaceConstraint- Returns:
- The type
-
getTitle
public String getTitle()
Defers to the registered constraint- Specified by:
getTitlein interfaceConstraint- Returns:
- the human-readable constraint title (optional)
-
getParameters
public Map<String,Object> getParameters()
Defers to the registered constraint- Specified by:
getParametersin interfaceConstraint- Returns:
- Map of parameters or an empty Map if none exist
-
evaluate
public void evaluate(Object value)
Defers to the registered constraint- Specified by:
evaluatein interfaceConstraint- Parameters:
value- the property value to check
-
-