|
||||||||||
| 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 ReferenceCoinstraint with respect to the Parameter constraintParameter. |
|
ReferenceConstraint(StringBuffer representation)
Creates a new ReferenceConstraint from its XML-representation. |
|
| 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 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)
ReferenceCoinstraint with respect to the Parameter constraintParameter.
constraintParameter - the parameter
public ReferenceConstraint(StringBuffer representation)
throws NonParsableException
ReferenceConstraint from its XML-representation.
representation - the XML-representation
NonParsableException - is thrown 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 - is thrown if the contained Parameter could not be cloned.public abstract boolean check(Object value)
Constraintvalue for the constraint defined in the Constraint.
Is the constraint is fulfilled, true is returned.
check in interface Constraintvalue - the value to be checked
public String getErrorMessage()
Constraintnull
if the constraint was fulfilled by the last checked value
getErrorMessage in interface Constraintpublic StringBuffer toXML()
Storable
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 - thrown if the XML-code could not be parsed
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||