Class RegisteredConstraint
- java.lang.Object
-
- org.alfresco.repo.dictionary.constraint.RegisteredConstraint
-
- All Implemented Interfaces:
Constraint
public final class RegisteredConstraint extends java.lang.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 void
evaluate(java.lang.Object value)
Defers to the registered constraintjava.util.Map<java.lang.String,java.lang.Object>
getParameters()
Defers to the registered constraintConstraint
getRegisteredConstraint()
java.lang.String
getShortName()
Gets the constraint name.java.lang.String
getTitle()
Defers to the registered constraintjava.lang.String
getType()
Defers to the registered constraintvoid
initialize()
Initializes the constraint with appropriate values, which will depend on the implementation itself.void
setRegisteredName(java.lang.String registeredName)
Set the name of the constraint that will be used to look up the constraint that will be delegated to.void
setShortName(java.lang.String shortName)
java.lang.String
toString()
-
-
-
Method Detail
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getShortName
public java.lang.String getShortName()
Description copied from interface:Constraint
Gets the constraint name.- Specified by:
getShortName
in interfaceConstraint
- Returns:
- the constraint name.
-
setShortName
public void setShortName(java.lang.String shortName)
-
setRegisteredName
public void setRegisteredName(java.lang.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:Constraint
Initializes 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:
initialize
in interfaceConstraint
-
getRegisteredConstraint
public Constraint getRegisteredConstraint()
- Returns:
- the constraint that matches the registered name
-
getType
public java.lang.String getType()
Defers to the registered constraint- Specified by:
getType
in interfaceConstraint
- Returns:
- The type
-
getTitle
public java.lang.String getTitle()
Defers to the registered constraint- Specified by:
getTitle
in interfaceConstraint
- Returns:
- the human-readable constraint title (optional)
-
getParameters
public java.util.Map<java.lang.String,java.lang.Object> getParameters()
Defers to the registered constraint- Specified by:
getParameters
in interfaceConstraint
- Returns:
- Map of parameters or an empty Map if none exist
-
evaluate
public void evaluate(java.lang.Object value)
Defers to the registered constraint- Specified by:
evaluate
in interfaceConstraint
- Parameters:
value
- the property value to check
-
-