|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsk.baka.tools.JavaUtils.BeanProperty
@Immutable public static final class JavaUtils.BeanProperty
Contains accessors to a bean property.
| Field Summary | |
|---|---|
Field |
field
The field itself. |
Method |
getter
A field's getter, null if not public or non-existant. |
Method |
setter
A field's setter, null if not public or non-existant. |
| Method Summary | |
|---|---|
static JavaUtils.BeanProperty |
from(Class<?> clazz,
String name)
Creates a bean property accessor for given property. |
static JavaUtils.BeanProperty |
from(Field field)
Creates a bean property accessor for given field. |
String |
getName()
Returns the property name. |
Class<?> |
getType()
Returns the type of the property. |
Object |
getValue(Object bean)
Retrieves a property value. |
void |
setValue(Object bean,
Object value)
Sets a property value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final Field field
public final Method getter
public final Method setter
| Method Detail |
|---|
public Class<?> getType()
public static JavaUtils.BeanProperty from(Field field)
field - the field to access.
public static JavaUtils.BeanProperty from(Class<?> clazz,
String name)
name - the property nameclazz - the bean class
public String getName()
public Object getValue(Object bean)
bean - the bean instance.
RuntimeException - if the retrieval fails
public void setValue(Object bean,
Object value)
bean - the bean instance.value - the value to set
RuntimeException - if the setting fails
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||