Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

org.alfresco.service.cmr.dictionary
Interface Constraint

@org.alfresco.api.AlfrescoPublicApi
public interface Constraint
The interface for classes that implement constraints on property values.

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.

Author:
Derek Hulley

Method Summary
void
evaluate(Object value)
          Evaluates a property value according to the implementation and initialization parameters provided.
getParameters()
          Returns the parameters passed to the instance of the constraint.
getShortName()
          Gets the constraint name.
getTitle()
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.
Method Detail
getType
String getType()
Returns the 'type' of the constraint, this is the identifier given to constraint in the configuration.
Returns:
The type

getTitle
String getTitle()
Returns:
the human-readable constraint title (optional)

getShortName
String getShortName()
Gets the constraint name.
Returns:
the constraint name.

getParameters
Map<String,ObjectgetParameters()
Returns the parameters passed to the instance of the constraint.
Returns:
Map of parameters or an empty Map if none exist

initialize
void initialize()
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.

evaluate
void evaluate(Object value)
Evaluates a property value according to the implementation and initialization parameters provided.
Parameters:
value - the property value to check
Throws:
ConstraintException - if the value doesn't pass all constraints

Overview  Package   Class  Use  Tree  Deprecated  Index  Help 
PREV CLASS   NEXT CLASS FRAMES    NO FRAMES    All Classes
SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005–2018 Alfresco Software. All rights reserved.

Java API documentation generated with DocFlex/Javadoc 1.6.1 using JavadocPro template set.