org.alfresco.repo.dictionary.constraint
Class StringLengthConstraint

java.lang.Object
  extended by org.alfresco.repo.dictionary.constraint.AbstractConstraint
      extended by org.alfresco.repo.dictionary.constraint.StringLengthConstraint
All Implemented Interfaces:
Constraint

public class StringLengthConstraint
extends AbstractConstraint

Constraint implementation that ensures that the length of the String value.

See Also:
StringLengthConstraint.setMinLength(int), StringLengthConstraint.setMaxLength(int)

Field Summary
 
Fields inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
ERR_EVALUATE_EXCEPTION, ERR_PROP_NOT_SET
 
Constructor Summary
StringLengthConstraint()
           
 
Method Summary
protected  void evaluateSingleValue(java.lang.Object value)
          Support for evaluation of properties.
 int getMaxLength()
           
 int getMinLength()
           
 void initialize()
          Initializes the constraint with appropriate values, which will depend on the implementation itself.
 void setMaxLength(int maxLength)
          Set the maximum number of characters allowed.
 void setMinLength(int minLength)
          Set the minimum number of characters allowed.
 java.lang.String toString()
           
 
Methods inherited from class org.alfresco.repo.dictionary.constraint.AbstractConstraint
checkPropertyNotNull, evaluate, evaluateCollection
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringLengthConstraint

public StringLengthConstraint()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getMinLength

public int getMinLength()
Returns:
Returns the minimum number of characters allowed

setMinLength

public void setMinLength(int minLength)
Set the minimum number of characters allowed. Valid values are in the range [0, Integer.MAX_VALUE].

Parameters:
minLength - the minimum numbers of characters allowed

getMaxLength

public int getMaxLength()
Returns:
Returns the maximum number of characters allowed

setMaxLength

public void setMaxLength(int maxLength)
Set the maximum number of characters allowed. Valid values are in the range [0, Integer.MAX_VALUE].

Parameters:
maxLength - the minimum numbers of characters allowed

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.


evaluateSingleValue

protected void evaluateSingleValue(java.lang.Object value)
Description copied from class: AbstractConstraint
Support for evaluation of properties. The value passed in will never be a Collection and will never be null.

Specified by:
evaluateSingleValue in class AbstractConstraint


Copyright © 2005 - 2008 Alfresco Software, Inc. All Rights Reserved.