|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.constraint.AbstractConstraint
com.tensegrity.generic.constraint.EnumConstraint
Used to check whether the value that is subject to validation is equal to one
of the entries of the list of values on the right-hand-side of the operator.
The entries of the list of values can be quoted strings or numbers.
Interleaving both elements is allowed. The EnumConstraint
validates its value by means of the potentially overridden
equals() method of the value object.
Constraint,
ConstraintParser| Field Summary | |
protected java.lang.String |
lastError
string used to trace for the last error |
| Method Summary | |
java.lang.Object[] |
getAlternatives()
Returns the legal alternatives of this enum constraint. |
Constraint |
intern()
Pools this constraint analogous to the java.lang.String.intern() method. |
java.lang.String |
toString()
Returns a string representation of this constraint. |
void |
trace(java.lang.StringBuffer sb)
Default implementation appending the last error occured to the given StringBuffer. |
boolean |
validate(java.lang.Object value)
Validates this contraint against a given value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.lang.String lastError
| Method Detail |
public boolean validate(java.lang.Object value)
Constraintnull.
value - the object to validate. It is not allowed to pass in
null as an argument.
true if this value confirms to this constraints and
false if it doesn't.public java.lang.Object[] getAlternatives()
public java.lang.String toString()
public Constraint intern()
java.lang.String.intern() method. This method is not
threadsafe.
intern in interface Constraintthis-reference if this
object has not been pooled before.public void trace(java.lang.StringBuffer sb)
StringBuffer.
trace in interface Constraintsb - the stringbuffer to append the last error to.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||