|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.parameters.validation.StorableValidator
public class StorableValidator
Class for a validator that validates instances and XML representations for
the correct class types (e.g. AbstractModel).
| Constructor Summary | |
|---|---|
StorableValidator(Class<? extends Storable> clazz)
Creates a new StorableValidator for a subclass of
Storable. |
|
StorableValidator(Class<? extends Storable> clazz,
boolean trained)
Creates a new StorableValidator for a subclass of
AbstractModel or AbstractClassifier. |
|
StorableValidator(StringBuffer buf)
The standard constructor for the interface Storable. |
|
| Method Summary | |
|---|---|
boolean |
checkValue(Object value)
Checks the value of value. |
StorableValidator |
clone()
This method returns a deep copy of the current instance. |
void |
fromXML(StringBuffer representation)
Parses a StorableValidator from the XML representation as
returned by toXML(). |
String |
getErrorMessage()
Returns the error message if ParameterValidator.checkValue(Object) returned false. |
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 |
| Constructor Detail |
|---|
public StorableValidator(Class<? extends Storable> clazz,
boolean trained)
throws Exception
StorableValidator for a subclass of
AbstractModel or AbstractClassifier. This constructor may
not be used on other subclasses of Storable.
clazz - the classtrained - true if the model or classifier must be trained
Exception - if clazz is not of the expected type
public StorableValidator(Class<? extends Storable> clazz)
throws Exception
StorableValidator for a subclass of
Storable.
clazz - the class
Exception - if clazz is not of the expected type
public StorableValidator(StringBuffer buf)
throws NonParsableException
Storable.
Constructs an StorableValidator from its XML representation.
buf - the XML representation as StringBuffer
NonParsableException - if buf could not be parsed| Method Detail |
|---|
public StorableValidator clone()
throws CloneNotSupportedException
ParameterValidator
clone in interface ParameterValidatorclone in class ObjectCloneNotSupportedException - if the ParameterValidator could not be clonedCloneablepublic boolean checkValue(Object value)
value. Allowed types of
value are AbstractModel, AbstractClassifier,
FileParameter.FileRepresentation, String, and StringBuffer. In
all cases where an XML representation is given as value, it
must be surrounded by <object>-tags and these tags must contain a
<className>-element that contains the name of the class of the
represented instance.
checkValue in interface ParameterValidatorvalue - the Object to be checked
true if value is valid and
false otherwisepublic String getErrorMessage()
ParameterValidatorParameterValidator.checkValue(Object) returned false.
getErrorMessage in interface ParameterValidatorpublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.
toXML in interface Storable
public void fromXML(StringBuffer representation)
throws NonParsableException
StorableValidator 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 | |||||||||