|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.parameters.validation.ReferenceConstraint
public abstract class ReferenceConstraint
Class for a Constraint that defines a condition on one
Parameter (the one containing the ConstraintValidator) with
respect to another Parameter.
| Field Summary | |
|---|---|
protected Parameter |
constraintParameter
The reference to the Parameter that is part of the condition. |
protected String |
errorMessage
The message of the last error or null. |
| Fields inherited from interface de.jstacs.parameters.validation.Constraint |
|---|
EQUALS, GEQ, GT, LEQ, LT |
| Constructor Summary | |
|---|---|
ReferenceConstraint(Parameter constraintParameter)
Creates a new ReferenceConstraint with respect to the
Parameter constraintParameter. |
|
ReferenceConstraint(StringBuffer representation)
The standard constructor for the interface Storable. |
|
| Method Summary | |
|---|---|
abstract boolean |
check(Object value)
Checks value for the constraint defined in the
Constraint. |
abstract ReferenceConstraint |
clone()
This method returns a deep copy of the current instance. |
protected void |
fillWithStandardFieldForClone(ReferenceConstraint clone)
Sets the standard fields of clone to the values (or clones
of them) of this instance. |
void |
fromXML(StringBuffer representation)
Parses a ReferenceConstraint from the XML representation as
returned by toXML(). |
String |
getErrorMessage()
Returns the message of the last error (missed constraint) or null if the constraint was fulfilled by the last checked
value. |
StringBuffer |
toXML()
This method returns an XML representation as StringBuffer of an
instance of the implementing class. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Parameter constraintParameter
Parameter that is part of the condition.
protected String errorMessage
null.
| Constructor Detail |
|---|
public ReferenceConstraint(Parameter constraintParameter)
ReferenceConstraint with respect to the
Parameter constraintParameter.
constraintParameter - the parameter
public ReferenceConstraint(StringBuffer representation)
throws NonParsableException
Storable.
Creates a new ReferenceConstraint from its XML representation.
representation - the XML representation
NonParsableException - if representation could not be parsed| Method Detail |
|---|
public abstract ReferenceConstraint clone()
throws CloneNotSupportedException
Constraint
clone in interface Constraintclone in class ObjectCloneNotSupportedException - if the Constraint could not be clonedCloneable
protected void fillWithStandardFieldForClone(ReferenceConstraint clone)
throws CloneNotSupportedException
clone to the values (or clones
of them) of this instance.
clone - the clone
CloneNotSupportedException - if the contained Parameter could not be clonedpublic abstract boolean check(Object value)
Constraintvalue for the constraint defined in the
Constraint. If the constraint is fulfilled, true is
returned.
check in interface Constraintvalue - the Object to be checked
true if the constraint is fulfilled,
false otherwisepublic String getErrorMessage()
Constraintnull if the constraint was fulfilled by the last checked
value.
getErrorMessage in interface Constraintnullpublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.
toXML in interface Storable
public void fromXML(StringBuffer representation)
throws NonParsableException
ReferenceConstraint from the XML representation as
returned by toXML().
representation - the XML representation
NonParsableException - if the XML code could not be parsed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||