Public Member Functions

org.exolab.castor.xml.handlers.EnumFieldHandler Class Reference

Inheritance diagram for org.exolab.castor.xml.handlers.EnumFieldHandler:
org.exolab.castor.mapping.FieldHandler

List of all members.

Public Member Functions

 EnumFieldHandler (Class enumType, FieldHandler handler)
Object getValue (Object target) throws java.lang.IllegalStateException
void setValue (Object target, Object value) throws java.lang.IllegalStateException
void resetValue (Object targer)
void checkValidity (Object object) throws ValidityException, IllegalStateException
Object newInstance (Object parent) throws IllegalStateException
boolean equals (Object obj)

Detailed Description

A specialized MarshalDescriptor for the XML Schema enumeration types

Author:
Keith Visco
Version:
Revision:
1.2
Date:
2003/11/10 07:38:31

Constructor & Destructor Documentation

org.exolab.castor.xml.handlers.EnumFieldHandler.EnumFieldHandler ( Class  enumType,
FieldHandler  handler 
)

Creates a new EnumFieldHandler with the given type and FieldHandler

Parameters:
type the Class type of the described field
handler the FieldHandler to delegate to

Member Function Documentation

void org.exolab.castor.xml.handlers.EnumFieldHandler.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.

Parameters:
object The object
Exceptions:
ValidityException The field is invalid, is required and null, or any other validity violation
IllegalStateException The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object

Implements org.exolab.castor.mapping.FieldHandler.

boolean org.exolab.castor.xml.handlers.EnumFieldHandler.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.

Returns:
true if the given object is an XMLFieldHandler that is equivalent to this one.
Object org.exolab.castor.xml.handlers.EnumFieldHandler.getValue ( Object  target  )  throws java.lang.IllegalStateException

Returns the value of the field associated with this descriptor from the given target object.

Parameters:
target the object to get the value from
Returns:
the value of the field associated with this descriptor from the given target object.

Implements org.exolab.castor.mapping.FieldHandler.

References org.exolab.castor.mapping.FieldHandler.getValue().

Object org.exolab.castor.xml.handlers.EnumFieldHandler.newInstance ( Object  parent  )  throws IllegalStateException

Creates a new instance of the object described by this field.

Parameters:
parent The object for which the field is created
Returns:
A new instance of the field's value
Exceptions:
IllegalStateException This field is a simple type and cannot be instantiated

Implements org.exolab.castor.mapping.FieldHandler.

void org.exolab.castor.xml.handlers.EnumFieldHandler.resetValue ( Object  object  ) 

Sets the value of the field to a default value.

Reference fields are set to null, primitive fields are set to their default value, collection fields are emptied of all elements.

Parameters:
object The object
Exceptions:
IllegalStateException The Java object has changed and is no longer supported by this handler, or the handler is not compatiable with the Java object

Implements org.exolab.castor.mapping.FieldHandler.

void org.exolab.castor.xml.handlers.EnumFieldHandler.setValue ( Object  target,
Object  value 
) throws java.lang.IllegalStateException

Sets the value of the field associated with this descriptor.

Parameters:
target the object in which to set the value
value the value of the field

Implements org.exolab.castor.mapping.FieldHandler.

References org.exolab.castor.mapping.FieldHandler.setValue().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties