|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cojen.util.BeanPropertyAccessor<B>
public abstract class BeanPropertyAccessor<B>
Provides a simple and efficient means of reading and writing bean properties. BeanPropertyAccessor auto-generates code, eliminating the need to invoke methods via reflection. Bean access methods are bound-to directly, using a special hash/switch design pattern.
BeanPropertyMapFactory| Nested Class Summary | |
|---|---|
static class |
BeanPropertyAccessor.PropertySet
|
| Constructor Summary | |
|---|---|
protected |
BeanPropertyAccessor()
|
| Method Summary | ||
|---|---|---|
static
|
forClass(Class<B> clazz)
Returns a new or cached BeanPropertyAccessor for the given class. |
|
static
|
forClass(Class<B> clazz,
BeanPropertyAccessor.PropertySet set)
|
|
abstract Object |
getPropertyValue(B bean,
String property)
|
|
abstract boolean |
hasPropertyValue(B bean,
Object value)
Returns true if at least one property is set to the given value. |
|
abstract boolean |
hasReadableProperty(String property)
Returns true if readable bean property exists. |
|
abstract boolean |
hasWritableProperty(String property)
Returns true if writable bean property exists. |
|
abstract void |
setPropertyValue(B bean,
String property,
Object value)
|
|
abstract Object |
tryGetPropertyValue(B bean,
String property)
Returns property value or null if it does not exist. |
|
abstract boolean |
trySetPropertyValue(B bean,
String property,
Object value)
Tries to set property value, if it exists. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected BeanPropertyAccessor()
| Method Detail |
|---|
public static <B> BeanPropertyAccessor<B> forClass(Class<B> clazz)
public static <B> BeanPropertyAccessor<B> forClass(Class<B> clazz,
BeanPropertyAccessor.PropertySet set)
public abstract Object getPropertyValue(B bean,
String property)
throws NoSuchPropertyException
NoSuchPropertyException
public abstract void setPropertyValue(B bean,
String property,
Object value)
throws NoSuchPropertyException
NoSuchPropertyExceptionpublic abstract boolean hasReadableProperty(String property)
public abstract boolean hasWritableProperty(String property)
public abstract boolean hasPropertyValue(B bean,
Object value)
public abstract Object tryGetPropertyValue(B bean,
String property)
public abstract boolean trySetPropertyValue(B bean,
String property,
Object value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||