org.exolab.castor.xml.handlers
Class EnumFieldHandler
java.lang.Object
org.exolab.castor.xml.handlers.EnumFieldHandler
- FieldHandler
public class EnumFieldHandler
extends java.lang.Object
A specialized FieldHandler for the XML Schema enumeration types.
$Revision: 7168 $ $Date: 2006-04-13 06:47:36 -0600 (Thu, 13 Apr 2006) $
void | checkValidity(Object object) - Checks the field validity.
|
boolean | equals(Object obj) - Returns true if the given object is an XMLFieldHandler that is equivalent
to the delegated handler.
|
Object | getValue(Object target) - Returns the value of the field associated with this descriptor from the
given target object.
|
Object | newInstance(Object parent) - Creates a new instance of the object described by this field.
|
void | resetValue(Object target) - Sets the value of the field to a default value -- for enum, no action
needed.
|
void | setValue(Object target, Object value) - Sets the value of the field associated with this descriptor.
|
EnumFieldHandler
public EnumFieldHandler(Class enumType,
FieldHandler handler)
Creates a new EnumFieldHandler with the given type and FieldHandler.
enumType
- the Class type of the described fieldhandler
- the FieldHandler to delegate to
checkValidity
public void checkValidity(Object object)
throws ValidityException,
IllegalStateException
Checks the field validity. Returns successfully if the field can be
stored, is valid, etc, throws an exception otherwise.
- checkValidity in interface FieldHandler
ValidityException
- The field is invalid, is required and null, or
any other validity violation
equals
public boolean equals(Object obj)
Returns true if the given object is an XMLFieldHandler that is equivalent
to the delegated handler. An equivalent XMLFieldHandler is an
XMLFieldHandler that is an instances of the same class.
- true if the given object is an XMLFieldHandler that is equivalent
to this one.
getValue
public Object getValue(Object target)
throws java.lang.IllegalStateException
Returns the value of the field associated with this descriptor from the
given target object.
- getValue in interface FieldHandler
target
- the object to get the value from
- the value of the field associated with this descriptor from the
given target object.
newInstance
public Object newInstance(Object parent)
throws IllegalStateException
Creates a new instance of the object described by this field.
- newInstance in interface FieldHandler
parent
- The object for which the field is created
- A new instance of the field's value
resetValue
public void resetValue(Object target)
Sets the value of the field to a default value -- for enum, no action
needed.
- resetValue in interface FieldHandler
setValue
public void setValue(Object target,
Object value)
throws java.lang.IllegalStateException
Sets the value of the field associated with this descriptor.
- setValue in interface FieldHandler
target
- the object in which to set the valuevalue
- the value of the field
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com