|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.util.PropertyHelper
public class PropertyHelper
Helper class to provide access to the properties of JavaBeans. This implementation is stateless and maintains no cached information, so instances may be freely created and destroyed, with no side effects (unless there are side effects from caching inside the JDK itself).
$Id: PropertyHelper.java 464373 2006-10-16 04:21:54Z rahul $
Constructor Summary | |
---|---|
PropertyHelper()
|
Method Summary | |
---|---|
Class |
getType(Object bean,
String name)
Return the type of the specified property on the underlying bean class. |
Object |
getValue(Object bean,
String name)
Return the value of the specified property from the specified bean. |
boolean |
isReadOnly(Object bean,
String name)
Return true if the specified property is read only on
the underlying bean class. |
void |
setValue(Object bean,
String name,
Object value)
Set the specified value on the specified property of the specified bean. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyHelper()
Method Detail |
---|
public Object getValue(Object bean, String name)
Return the value of the specified property from the specified bean.
bean
- Bean whose property is to be retrievedname
- Name of the property to get
javax.faces.el.PropertyNotFoundException
- if the bean class does not have
a property with the specified name, or if the property is write only
javax.faces.el.EvaluationException
- if an exception occurs while
retrieving the property valuepublic boolean isReadOnly(Object bean, String name)
Return true
if the specified property is read only on
the underlying bean class.
bean
- Bean whose property is to be checkedname
- Name of the property to check
javax.faces.el.PropertyNotFoundException
- if the bean class does not have
a property with the specified name, or if the property is write only
javax.faces.el.EvaluationException
- if an exception occurs while
checking the read only statuspublic Class getType(Object bean, String name)
Return the type of the specified property on the underlying bean class.
bean
- Bean whose property is to be analyzedname
- Name of the property to return the type of
javax.faces.el.PropertyNotFoundException
- if the bean class does not have
a property with the specified name
javax.faces.el.EvaluationException
- if an exception occurs while
retrieving the property typepublic void setValue(Object bean, String name, Object value)
Set the specified value on the specified property of the specified bean.
bean
- Bean whose property is to be setname
- Name of the property to be setvalue
- New value for this property
javax.faces.el.PropertyNotFoundException
- if the bean class does not have
a property with the specified name, or if the property is read only
javax.faces.el.EvaluationException
- if an exception occurs while
setting the property value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |