@AlfrescoPublicApi
public interface Constraint
Implementations of the actual constraint code should must not synchronize or in any other way block threads. Concurrent access of the evaluation method is expected, but will always occur after initialization has completed.
Attention to performance is crucial for all implementations as instances of this class are heavily used.
The constraint implementations can provide standard setter methods that will be populated by bean setter injection. Once all the available properties have been set, the contraint will be initialized.
Modifier and Type | Method and Description |
---|---|
void |
evaluate(java.lang.Object value)
Evaluates a property value according to the implementation and initialization
parameters provided.
|
java.util.Map |
getParameters()
Returns the parameters passed to the instance of the constraint.
|
java.lang.String |
getShortName()
Gets the constraint name.
|
java.lang.String |
getTitle() |
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.
|
java.lang.String getType()
java.lang.String getTitle()
java.lang.String getShortName()
java.util.Map getParameters()
void initialize()
parameters
- constraint parametersvoid evaluate(java.lang.Object value)
value
- the property value to checkConstraintException
- if the value doesn't pass all constraintsCopyright © 2005 - 2013 Alfresco Software, Inc. All Rights Reserved.