public class XMLFieldHandler extends AbstractFieldHandler
A field handler knows how to perform various operations on the field that require access to the field value.
FieldDescriptor
_properties
Constructor and Description |
---|
XMLFieldHandler()
Creates a new default XMLFieldHandler
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Returns true if the given object is an XMLFieldHandler that
is equivalent to this one.
|
Object |
getValue(Object object)
Returns the value of the field from the object.
|
Object |
newInstance(Object parent)
Creates a new instance of the object described by this field.
|
Object |
newInstance(Object parent,
Object[] args)
Creates a new instance of the object described by this field.
|
void |
resetValue(Object object)
Sets the value of the field to a default value.
|
void |
setValue(Object object,
Object value)
Sets the value of the field on the object.
|
getFieldDescriptor, hasValue, setConfiguration, setFieldDescriptor
checkValidity
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkValidity
public boolean equals(Object obj)
public Object getValue(Object object) throws IllegalStateException
getValue
in interface FieldHandler
getValue
in class FieldHandlerFriend
object
- The objectIllegalStateException
- The Java object has changed and
is no longer supported by this handler, or the handler is not
compatiable with the Java objectpublic Object newInstance(Object parent) throws IllegalStateException
newInstance
in interface FieldHandler
newInstance
in class FieldHandlerFriend
parent
- The object for which the field is createdIllegalStateException
- This field is a simple type and
cannot be instantiatedpublic Object newInstance(Object parent, Object[] args) throws IllegalStateException
newInstance
in class ExtendedFieldHandler
parent
- The object for which the field is createdargs
- the set of constructor argumentsIllegalStateException
- This field is a simple type and
cannot be instantiatedpublic void setValue(Object object, Object value) throws IllegalStateException, IllegalArgumentException
setValue
in interface FieldHandler
setValue
in class FieldHandlerFriend
object
- The object.value
- The new value.IllegalStateException
- The Java object has changed and is no longer
supported by this handler, or the handler is not compatiable with the
Java object.IllegalArgumentException
- The value passed is not of a supported type.public void resetValue(Object object) throws IllegalStateException, IllegalArgumentException
FieldHandlerFriend
Reference fields are set to null, primitive fields are set to their default value, collection fields are emptied of all elements.
resetValue
in interface FieldHandler
resetValue
in class FieldHandlerFriend
object
- The objectIllegalStateException
- The Java object has changed and
is no longer supported by this handler, or the handler is not
compatiable with the Java objectIllegalArgumentException
Copyright © 2016. All rights reserved.