|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BeanReflector
Exposes information available in 'bean-like' structures. Examples of 'bean-like' structures include a java.lang.Object, a java.util.Map, or any other class that logically has a set of properties that can be manipulated by name.
Field Summary | |
---|---|
static java.lang.String |
IMPLICIT_PROPERTY_CLASS
implicit "class" property |
static java.lang.String |
IMPLICIT_PROPERTY_PROPERTY_NAMES
implicit "propertyNames" property |
static java.lang.String |
IMPLICIT_PROPERTY_THIS
implicit "this" property |
Fields inherited from interface net.sf.morph.reflect.SizableReflector |
---|
IMPLICIT_PROPERTY_SIZE |
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.Object bean,
java.lang.String propertyName)
Retrieves the value of the given property. |
java.lang.String[] |
getPropertyNames(java.lang.Object bean)
Gets the names of the properties which are currently defined for the given bean. |
java.lang.Class |
getType(java.lang.Object bean,
java.lang.String propertyName)
Specifies the least restrictive type that may be assigned to the given property. |
boolean |
isReadable(java.lang.Object bean,
java.lang.String propertyName)
Specifies whether the given property is readable. |
boolean |
isWriteable(java.lang.Object bean,
java.lang.String propertyName)
Specifies whether the given property is writeable. |
void |
set(java.lang.Object bean,
java.lang.String propertyName,
java.lang.Object propertyValue)
Sets the value of the given property. |
Methods inherited from interface net.sf.morph.reflect.SizableReflector |
---|
getSize |
Field Detail |
---|
static final java.lang.String IMPLICIT_PROPERTY_CLASS
static final java.lang.String IMPLICIT_PROPERTY_PROPERTY_NAMES
static final java.lang.String IMPLICIT_PROPERTY_THIS
Method Detail |
---|
java.lang.String[] getPropertyNames(java.lang.Object bean) throws ReflectionException
bean
- the bean for which we would like a list of properties
ReflectionException
- if bean is null
java.lang.Class getType(java.lang.Object bean, java.lang.String propertyName) throws ReflectionException
Object.class
, which indicates that any type can
be assigned to the given property.
bean
- the beanpropertyName
- the name of the property
Object.class
, which indicates
that any type can be assigned to the given property
ReflectionException
- if bean
or propertyName
are
null
or boolean isReadable(java.lang.Object bean, java.lang.String propertyName) throws ReflectionException
bean
- the beanpropertyName
- the name of the property
true
if the property is readable, or false
, otherwise
ReflectionException
- if bean
or propertyName
are
null
or boolean isWriteable(java.lang.Object bean, java.lang.String propertyName) throws ReflectionException
true
. This method only guarantees that if
isWriteable
returns false, the method is not writeable.
The method may or may not be writeable if this method returns
true
.
bean
- the beanpropertyName
- the name of the property
false
if the property is not writeable or true
if the property is writeable or if this
reflector cannot determine for sure whether or not the property
is writeable
ReflectionException
- if bean
or propertyName
are
null
or java.lang.Object get(java.lang.Object bean, java.lang.String propertyName) throws ReflectionException
bean
- the beanpropertyName
- the name of the property
ReflectionException
- if bean
or propertyName
is
null
or void set(java.lang.Object bean, java.lang.String propertyName, java.lang.Object propertyValue) throws ReflectionException
bean
- the beanpropertyName
- the name of the propertypropertyValue
- the value to assign to the given property
ReflectionException
- if bean
or propertyName
are
null
or propertyValue
is of the wrong type)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |