public abstract class FieldAccessor extends java.lang.Object implements PropertyAccessor
Implements PropertyAccessor interface using direct field access through reflection, providing efficient property access for serialization and deserialization operations.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.reflect.Field |
field
The underlying Field object being accessed
|
protected java.lang.String |
fieldName
The name of the field
|
protected java.lang.Class<?> |
propertyClass
The runtime class of the field
|
protected java.lang.reflect.Type |
propertyType
The generic type of the field
|
protected boolean |
supportSet
Flag indicating whether the field supports setting values
|
| Modifier | Constructor and Description |
|---|---|
protected |
FieldAccessor(java.lang.reflect.Field field)
Constructs a FieldAccessor for the given field.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) JSONException |
errorForGet(java.lang.Throwable e)
Creates a JSON exception for getter errors.
|
(package private) JSONException |
errorForSet(java.lang.Throwable e)
Creates a JSON exception for setter errors.
|
java.lang.reflect.Field |
field()
Returns the underlying Field object.
|
java.lang.String |
name()
Returns the name of the property being accessed.
|
java.lang.Class<?> |
propertyClass()
Returns the runtime class of the property.
|
java.lang.reflect.Type |
propertyType()
Returns the generic type of the property.
|
boolean |
supportGet()
Checks if the property supports getting values.
|
boolean |
supportSet()
Checks if the property supports setting values.
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBooleanValue, getByteValue, getCharValue, getDoubleValue, getFloatValue, getIntValue, getLongValue, getObject, getShortValue, setBooleanValue, setByteValue, setCharValue, setDoubleValue, setFloatValue, setIntValue, setLongValue, setObject, setShortValueprotected final java.lang.reflect.Field field
protected final java.lang.String fieldName
protected final java.lang.Class<?> propertyClass
protected final java.lang.reflect.Type propertyType
protected final boolean supportSet
protected FieldAccessor(java.lang.reflect.Field field)
field - the field to be accessedpublic final java.lang.reflect.Field field()
public final java.lang.Class<?> propertyClass()
PropertyAccessorpropertyClass in interface PropertyAccessorpublic final java.lang.reflect.Type propertyType()
PropertyAccessorpropertyType in interface PropertyAccessorpublic final java.lang.String name()
PropertyAccessorname in interface PropertyAccessorpublic final boolean supportGet()
PropertyAccessorsupportGet in interface PropertyAccessorpublic final boolean supportSet()
PropertyAccessorsupportSet in interface PropertyAccessorpublic java.lang.String toString()
toString in class java.lang.Objectfinal JSONException errorForGet(java.lang.Throwable e)
e - the exception that occurred during gettingfinal JSONException errorForSet(java.lang.Throwable e)
e - the exception that occurred during setting