|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webmethods.caf.faces.bean.PageFlowScopeAdapter
com.webmethods.caf.faces.data.object.ELPropertyContentProvider
public class ELPropertyContentProvider
IUpdateableContentProvider
implementation that wraps any object and accesses its properties
using faces' expression language.
class Item { public int getId(); public String getName(); }; Item item = new Item("1", "First Item"); IUpdateableContentProvider provider = new ELPropertyContentProvider(item); Integer itemId = (Integer)provider.getValue("id"); // returns 1 String itemName = (String)provider.getValue("name"); // return "First Item" provider.setValue("name", "The new name"); // update the items name property
Field Summary | |
---|---|
protected Object |
m_o
Wrapped object |
Fields inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter |
---|
fExpireWithPageFlow |
Constructor Summary | |
---|---|
ELPropertyContentProvider()
Default constructor. |
|
ELPropertyContentProvider(Object o)
Initializes with the given object |
Method Summary | |
---|---|
Object |
getObject()
Returns currently wrapped object |
Object[] |
getPropertyKeys()
Returns list of properties supported by this content provider. |
Class |
getType(Object propertyKey)
Returns java type of the given property |
Object |
getValue(Object propertyKey)
Returns value of the given property |
boolean |
hasProperty(Object propertyKey)
Checks if the given property is supported by this content provider |
boolean |
isReadOnly(Object propertyKey)
Returns true if the given property is readonly. |
void |
setObject(Object o)
Sets an object to wrap. |
void |
setValue(Object propertyKey,
Object value)
Sets new value of the given property |
String |
toString()
Returns string representation of content. |
Methods inherited from class com.webmethods.caf.faces.bean.PageFlowScopeAdapter |
---|
getExpireWithPageFlow, setExpireWithPageFlow |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Object m_o
Constructor Detail |
---|
public ELPropertyContentProvider()
ELPropertyContentProvider.setObject(Object)
must be called before use.
public ELPropertyContentProvider(Object o)
o
- any object to adaptMethod Detail |
---|
public String toString()
IContentProvider
toString
in interface IContentProvider
toString
in class Object
String
representation of the wrapped contentpublic Object[] getPropertyKeys()
IContentProvider
Object[0]
,
never null.
getPropertyKeys
in interface IContentProvider
String
or Integer
public Class getType(Object propertyKey) throws PropertyNotFoundException
IContentProvider
getType
in interface IContentProvider
propertyKey
- the property key of type String
or Integer
Class
PropertyNotFoundException
- if property is not supportedpublic Object getValue(Object propertyKey) throws EvaluationException, PropertyNotFoundException
IContentProvider
getValue
in interface IContentProvider
propertyKey
- the property key of type String
or Integer
null
EvaluationException
- if error during property evaluation
PropertyNotFoundException
- if property is not supportedpublic boolean hasProperty(Object propertyKey)
IContentProvider
hasProperty
in interface IContentProvider
propertyKey
- property key of type String
or Integer
true
if property is supportedpublic boolean isReadOnly(Object propertyKey) throws EvaluationException, PropertyNotFoundException
IUpdateableContentProvider
Returns true if the given property is readonly. If it is readonly, IUpdateableContentProvider.setValue(Object, Object)
will
definitely fail.
isReadOnly
in interface IUpdateableContentProvider
propertyKey
- property key of type String
or Integer
EvaluationException
PropertyNotFoundException
public void setValue(Object propertyKey, Object value) throws EvaluationException, PropertyNotFoundException
IUpdateableContentProvider
Sets new value of the given property
setValue
in interface IUpdateableContentProvider
propertyKey
- property key of type String
or Integer
value
- new property value
EvaluationException
- if error happens during property assigment
PropertyNotFoundException
- if property is not foundpublic void setObject(Object o)
public Object getObject()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |