public class AccessorSyntheticField extends Object implements SyntheticField
Field which uses the getter and setter if they exist.| Constructor and Description |
|---|
AccessorSyntheticField(ReflectionHelper reflectionHelper,
Class<?> clazz,
Field field)
Constructor, access field using getter and setter if exist.
|
AccessorSyntheticField(ReflectionHelper reflectionHelper,
Class<?> clazz,
String name,
boolean readOnlyField)
Constructor, there is no field, just use getter (and setter is not readOnly).
|
| Modifier and Type | Method and Description |
|---|---|
Object |
get(Object object)
Get field value.
|
Type |
getGenericType()
Get field generic type.
|
String |
getName()
Get field name.
|
Class<?> |
getType()
Get field type.
|
void |
set(Object object,
Object value)
Set field value.
|
public AccessorSyntheticField(ReflectionHelper reflectionHelper, Class<?> clazz, Field field)
reflectionHelper - reflection helper to useclazz - clazz of which the field is partfield - field (may be in a parent class of clazz)public AccessorSyntheticField(ReflectionHelper reflectionHelper, Class<?> clazz, String name, boolean readOnlyField) throws JTransfoException
reflectionHelper - reflection helper to useclazz - clazz of which the field is partname - field namereadOnlyField - is a getter sufficientJTransfoException - can not find getter for given name orpublic Object get(Object object) throws IllegalAccessException, IllegalArgumentException
get in interface SyntheticFieldobject - object which contains the field.IllegalAccessException - illegal accessIllegalArgumentException - illegal argumentpublic void set(Object object, Object value) throws IllegalAccessException, IllegalArgumentException
set in interface SyntheticFieldobject - object which contains the field.value - field valueIllegalAccessException - illegal accessIllegalArgumentException - illegal argumentpublic String getName()
getName in interface SyntheticFieldpublic Class<?> getType()
getType in interface SyntheticFieldpublic Type getGenericType()
getGenericType in interface SyntheticFieldCopyright © 2017. All rights reserved.