|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.navel.beans.ProxyManipulator
public class ProxyManipulator
Public interface for doing reflection-like dynamic programming of the underlying values of a Navel backed JavaBean.
Method Summary | |
---|---|
static void |
clear(java.lang.Object bean)
Allows clear of a Navel bean's internal storage. |
static boolean |
clear(java.lang.Object bean,
java.lang.String propertyName)
Useful for removing values from the underlying Map, such as when trying to ignore certain property values like for persistence applications. |
static java.util.Map<java.lang.String,java.lang.Object> |
copyAll(java.lang.Object bean)
Overload that assumes false for flattening of the internal values. |
static java.util.Map<java.lang.String,java.lang.Object> |
copyAll(java.lang.Object bean,
boolean flatten)
Allows a copy of the bean's internal state to be retrieve by an arbitrary caller. |
static java.lang.Object |
get(java.lang.Object bean,
java.lang.String propertyName)
Allows dynamic programming of the internal storage of a JavaBeanHandler, useful for translation between Navel beans and other kinds of objects or declarative interrogation of the state of the bean. |
static boolean |
isImmutable(java.lang.Object bean)
Simple interrogates the underlying PropertyValues object to see
if it is immutable. |
static boolean |
isSet(java.lang.Object bean,
java.lang.String propertyName)
Check to see if the specified property has an entry, even one with a null value, in the storage map. |
static void |
put(java.lang.Object bean,
java.lang.String propertyName,
java.lang.Object propertyValue)
Allows for dynamic programming of a JavaBean's properties. |
static void |
putAll(java.lang.Object bean,
java.util.Map<java.lang.String,java.lang.Object> values)
This allows direct access to the underlying Map storage to put multiple values all at once. |
static java.lang.Object |
resolve(java.lang.Object bean,
java.lang.String propertyExpression)
|
static java.util.Map<java.lang.String,java.lang.Object> |
resolveAll(java.lang.Object bean)
Overload that assumes false for flattening out nested proxies. |
static java.util.Map<java.lang.String,java.lang.Object> |
resolveAll(java.lang.Object bean,
boolean resolveNested)
Utility to resolve the values for delegates properties since copyAll(Object) ignores any attached PropertyDelegate
instances. |
static java.lang.Class<?> |
typeOf(java.lang.Class<?> beanType,
java.lang.String dotExpression)
Utility method for digging out a target type based on an expression. |
static boolean |
valuesEqual(java.lang.Object oneBean,
java.lang.Object anotherBean)
Compares just the internal storage of two Navel beans for equivalence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.Object get(java.lang.Object bean, java.lang.String propertyName)
PropertyDelegate
instances!
bean
- Object to query, must be a Navel bean.propertyName
- Property to get, may be a nested property using the dot
notation. Also may be an indexed property.
public static java.util.Map<java.lang.String,java.lang.Object> copyAll(java.lang.Object bean)
PropertyDelegate
instances!
public static java.util.Map<java.lang.String,java.lang.Object> copyAll(java.lang.Object bean, boolean flatten)
PropertyDelegate
instances!
bean
- Must be navel bean.flatten
- If true, then the nested proxies will be flattened into the
output.
public static void put(java.lang.Object bean, java.lang.String propertyName, java.lang.Object propertyValue)
PropertyDelegate
instances!
bean
- Target whose property, simply or nested, to set.propertyName
- Property to set, may be a nested property using the dot
notation. Also may be an indexed property.propertyValue
- Value to set at the specified name.public static void putAll(java.lang.Object bean, java.util.Map<java.lang.String,java.lang.Object> values)
BeanManipulator.populate()
, this
method does not call the actually mutators but it does strictly validate
the supplied Map to ensure it is consistent with the JavaBean's
interfaces.
WARNING: This will bypass any attached
PropertyDelegate
instances!
bean
- Target bean to apply the Map argument, must be a Navel bean.
To apply a Map to a plain, old JavaBean, use BeanManipulator.values
- Values to insert into the Navel bean's internal storage, will
be validated with the same rules used by the ProxyFactory
during construction.public static boolean isSet(java.lang.Object bean, java.lang.String propertyName)
PropertyDelegate
instances!
bean
- Object to check, must be a Navel bean.propertyName
- Property to check, must be valid for the Navel bean.
public static boolean clear(java.lang.Object bean, java.lang.String propertyName)
bean
- Bean to clear.propertyName
- Name of the property to clear.
public static void clear(java.lang.Object bean)
bean
- Must be a Navel bean.public static java.lang.Object resolve(java.lang.Object bean, java.lang.String propertyExpression)
public static java.util.Map<java.lang.String,java.lang.Object> resolveAll(java.lang.Object bean)
bean
- Proxy to resolve.
Map
containing the results of calling
PropertyDelegate.get(PropertyValues, String)
for all the
registered instances, empty if no delegates are registered.public static java.util.Map<java.lang.String,java.lang.Object> resolveAll(java.lang.Object bean, boolean resolveNested)
copyAll(Object)
ignores any attached PropertyDelegate
instances. This methid does not currently resolve nested beans.
bean
- Proxy to resolve.resolveNeste
- If true, the nested proxies will also be resolved and
flattened into the output.
Map
containing the results of calling
PropertyDelegate.get(PropertyValues, String)
for all the
registered instances, empty if no delegates are registered.public static java.lang.Class<?> typeOf(java.lang.Class<?> beanType, java.lang.String dotExpression)
beanType
- Ancestor type from which the property expression descends.dotExpression
- A dot-notation property expression that indicates some target
property of interest.
public static boolean valuesEqual(java.lang.Object oneBean, java.lang.Object anotherBean)
oneBean
- One bean to compare.anotherBean
- The other bean to compare.
public static boolean isImmutable(java.lang.Object bean)
PropertyValues
object to see
if it is immutable.
bean
- Must be a Navel bean.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |