public class BeanProperty extends Object
| Constructor and Description |
|---|
BeanProperty(String name,
Class type,
Field field) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Object obj,
Object value)
Adds the property value on the object.
|
void |
addOrSet(Object obj,
Object value)
Adds or Sets the property value on the object.
|
boolean |
canAdd()
Returns whether the "add" method would succeed or throw an exception.
|
boolean |
canAddOrSet()
Returns whether the "addOrSet" method would succeed or throw an exception.
|
boolean |
canGet()
Returns whether the "get" method would succeed or throw an exception.
|
boolean |
canSet()
Returns whether the "set" method would succeed or throw an exception.
|
Object |
get(Object obj)
Gets the property value on the object.
|
Method |
getAddMethod()
Gets the underlying declared adder method for this property.
|
Field |
getField()
Gets the underlying declared field within the class for this property.
|
Method |
getGetMethod()
Gets the underlying declared getter method for this property.
|
String |
getName()
Gets the name of the property such as "firstName".
|
Method |
getSetMethod()
Gets the underlying declared setter method for this property.
|
Class |
getType()
Gets the Class type of the property such as "java.lang.String".
|
void |
set(Object obj,
Object value)
Sets the property value on the object.
|
public String getName()
public Class getType()
public boolean canAdd()
public boolean canAddOrSet()
public boolean canGet()
public boolean canSet()
public Field getField()
public Method getGetMethod()
public Method getSetMethod()
public Method getAddMethod()
public void set(Object obj, Object value) throws IllegalAccessException, InvocationTargetException
obj - The object to set the property onvalue - The value of the propertyIllegalAccessException - Thrown if an access exception
occurs while attempting to set the property value.InvocationTargetException - Thrown if there
is an exception thrown while calling the underlying method.public Object get(Object obj) throws IllegalAccessException, InvocationTargetException
obj - The object to get the property fromIllegalAccessException - Thrown if an access exception
occurs while attempting to get the property value.IllegalArgumentException - Thrown if an illegal argument
is used while attempting to get the property value.InvocationTargetException - Thrown if there
is an exception thrown while calling the underlying method.public void add(Object obj, Object value) throws IllegalAccessException, InvocationTargetException
obj - The object to add the property onvalue - The value to addIllegalAccessException - Thrown if an access exception
occurs while attempting to set the property value.IllegalArgumentException - Thrown if an illegal argument
is used while attempting to set the property value.InvocationTargetException - Thrown if there
is an exception thrown while calling the underlying method.public void addOrSet(Object obj, Object value) throws IllegalAccessException, InvocationTargetException
obj - The object to add or set the property onvalue - The value of the propertyIllegalAccessException - Thrown if an access exception
occurs while attempting to set the property value.InvocationTargetException - Thrown if there
is an exception thrown while calling the underlying method.Copyright © 2012-2015 Cloudhopper by Twitter. All Rights Reserved.