com.webmethods.caf.faces.data.object
Class LimitedPropertiesContentProvider

java.lang.Object
  extended by com.webmethods.caf.faces.data.object.LimitedPropertiesContentProvider
All Implemented Interfaces:
IContentProvider, IUpdateableContentProvider
Direct Known Subclasses:
LimitedPropertiesTableContentProvider

public class LimitedPropertiesContentProvider
extends Object
implements IContentProvider, IUpdateableContentProvider

Provider which limits a wrapped provider to exposing a specified set of properties.


Field Summary
protected  Object[] m_keys
           
protected  Set m_keySet
           
protected  IContentProvider m_provider
           
 
Constructor Summary
LimitedPropertiesContentProvider()
          Blank provider.
LimitedPropertiesContentProvider(IContentProvider provider, Object[] keys)
          Provider limiting specified provider to specified keys.
 
Method Summary
 Object[] getKeys()
          List of property keys to which this provider limits.
 Object[] getPropertyKeys()
          Returns list of properties supported by this content provider.
 IContentProvider getProvider()
          Source provider that this provider limits.
 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 setKeys(Object[] keys)
          List of property keys to which this provider limits.
 void setProvider(IContentProvider provider)
          Source provider that this provider limits.
 void setValue(Object propertyKey, Object value)
          Sets new value of the given property
 String toString()
          Returns string representation of content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_provider

protected IContentProvider m_provider

m_keys

protected Object[] m_keys

m_keySet

protected Set m_keySet
Constructor Detail

LimitedPropertiesContentProvider

public LimitedPropertiesContentProvider()
Blank provider. Must be initialized with LimitedPropertiesContentProvider.setProvider(com.webmethods.caf.faces.data.IContentProvider) and LimitedPropertiesContentProvider.setKeys(java.lang.Object[]).


LimitedPropertiesContentProvider

public LimitedPropertiesContentProvider(IContentProvider provider,
                                        Object[] keys)
Provider limiting specified provider to specified keys.

Method Detail

toString

public String toString()
Description copied from interface: IContentProvider
Returns string representation of content.

Specified by:
toString in interface IContentProvider
Overrides:
toString in class Object
Returns:
String representation of the wrapped content

getPropertyKeys

public Object[] getPropertyKeys()
Description copied from interface: IContentProvider
Returns list of properties supported by this content provider. Can return Object[0], never null.

Specified by:
getPropertyKeys in interface IContentProvider
Returns:
array of property keys which is typically of type String or Integer

getType

public Class getType(Object propertyKey)
              throws PropertyNotFoundException
Description copied from interface: IContentProvider
Returns java type of the given property

Specified by:
getType in interface IContentProvider
Parameters:
propertyKey - the property key of type String or Integer
Returns:
property java Class
Throws:
PropertyNotFoundException - if property is not supported

getValue

public Object getValue(Object propertyKey)
                throws EvaluationException,
                       PropertyNotFoundException
Description copied from interface: IContentProvider
Returns value of the given property

Specified by:
getValue in interface IContentProvider
Parameters:
propertyKey - the property key of type String or Integer
Returns:
value of the property, can be null
Throws:
EvaluationException - if error during property evaluation
PropertyNotFoundException - if property is not supported

hasProperty

public boolean hasProperty(Object propertyKey)
Description copied from interface: IContentProvider
Checks if the given property is supported by this content provider

Specified by:
hasProperty in interface IContentProvider
Parameters:
propertyKey - property key of type String or Integer
Returns:
true if property is supported

isReadOnly

public boolean isReadOnly(Object propertyKey)
                   throws EvaluationException,
                          PropertyNotFoundException
Description copied from interface: IUpdateableContentProvider

Returns true if the given property is readonly. If it is readonly, IUpdateableContentProvider.setValue(Object, Object) will definitely fail.

Specified by:
isReadOnly in interface IUpdateableContentProvider
Parameters:
propertyKey - property key of type String or Integer
Returns:
true if the property is readonly
Throws:
EvaluationException
PropertyNotFoundException

setValue

public void setValue(Object propertyKey,
                     Object value)
              throws EvaluationException,
                     PropertyNotFoundException
Description copied from interface: IUpdateableContentProvider

Sets new value of the given property

Specified by:
setValue in interface IUpdateableContentProvider
Parameters:
propertyKey - property key of type String or Integer
value - new property value
Throws:
EvaluationException - if error happens during property assigment
PropertyNotFoundException - if property is not found

getProvider

public IContentProvider getProvider()
Source provider that this provider limits.


setProvider

public void setProvider(IContentProvider provider)
Source provider that this provider limits.


getKeys

public Object[] getKeys()
List of property keys to which this provider limits.


setKeys

public void setKeys(Object[] keys)
List of property keys to which this provider limits.