org.alfresco.repo.dictionary.constraint
Class AbstractConstraint
java.lang.Object
org.alfresco.repo.dictionary.constraint.AbstractConstraint
- All Implemented Interfaces:
- Constraint
- Direct Known Subclasses:
- AuthorityNameConstraint, ListOfValuesConstraint, NumericRangeConstraint, RegexConstraint, StringLengthConstraint, UserNameConstraint
public abstract class AbstractConstraint
- extends java.lang.Object
- implements Constraint
Base services for constraints.
|
Method Summary |
protected void |
checkPropertyNotNull(java.lang.String name,
java.lang.Object value)
Check that the given value is not null. |
void |
evaluate(java.lang.Object value)
Evaluates a property value according to the implementation and initialization
parameters provided. |
protected void |
evaluateCollection(java.util.Collection collection)
Only override if there is some specific evaluation that needs to be performed on the
collection as a whole. |
protected abstract void |
evaluateSingleValue(java.lang.Object value)
Support for evaluation of properties. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ERR_PROP_NOT_SET
public static final java.lang.String ERR_PROP_NOT_SET
- See Also:
- Constant Field Values
ERR_EVALUATE_EXCEPTION
public static final java.lang.String ERR_EVALUATE_EXCEPTION
- See Also:
- Constant Field Values
AbstractConstraint
public AbstractConstraint()
checkPropertyNotNull
protected void checkPropertyNotNull(java.lang.String name,
java.lang.Object value)
- Check that the given value is not null.
- Parameters:
name - the name of the propertyvalue - the value to check for null
- Throws:
DictionaryException - if the the property is null
evaluate
public final void evaluate(java.lang.Object value)
- Description copied from interface:
Constraint
- Evaluates a property value according to the implementation and initialization
parameters provided.
- Specified by:
evaluate in interface Constraint
- Parameters:
value - the property value to check- See Also:
AbstractConstraint.evaluateSingleValue(Object),
AbstractConstraint.evaluateCollection(Collection)
evaluateCollection
protected void evaluateCollection(java.util.Collection collection)
- Only override if there is some specific evaluation that needs to be performed on the
collection as a whole.
- Parameters:
collection - the collection of values to evaluate- See Also:
AbstractConstraint.evaluateSingleValue(Object)
evaluateSingleValue
protected abstract void evaluateSingleValue(java.lang.Object value)
- Support for evaluation of properties. The value passed in will never be a
Collection and will never be null.
- Throws:
ConstraintException - throw this when the evaluation fails
Copyright © 2005 - 2008 Alfresco Software, Inc. All Rights Reserved.