Class BoundPropertiesContentProvider
java.lang.Object
com.webmethods.caf.faces.data.object.BoundPropertiesContentProvider
- All Implemented Interfaces:
IContentProvider
,IUpdateableContentProvider
- Direct Known Subclasses:
AtomFeedExportProvider
,BoundPropertiesTableContentProvider
public class BoundPropertiesContentProvider
extends Object
implements IContentProvider, IUpdateableContentProvider
Provider which limits a wrapped provider to exposing a specified set of properties;
the properties are specified via binding expressions.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<String,
ValueExpression> protected IContentProvider
protected String
-
Constructor Summary
ConstructorsConstructorDescriptionBlank provider.BoundPropertiesContentProvider
(IContentProvider provider, Map<String, ?> keys, String var) Provider limiting specified provider to specified keys. -
Method Summary
Modifier and TypeMethodDescriptionstatic Map<String,
ValueExpression> createDefaultKeyExpressions
(IContentProvider provider, String var) Creates the default key mapping for the specified provider and provider variable.static Map<String,
ValueBinding> createDefaultKeys
(IContentProvider provider, String var) Deprecated.Maps property names to value-binding expressions.getKeys()
Deprecated.usegetKeyExpressions()
insteadObject[]
Returns list of properties supported by this content provider.Source provider that this provider limits.Class<?>
Returns java type of the given propertyReturns value of the given propertygetVar()
Variable representing the source provider to use in key value bindings.boolean
hasProperty
(Object propertyKey) Checks if the given property is supported by this content providerboolean
isReadOnly
(Object propertyKey) Returns true if the given property is readonly.void
Maps property names to value-binding expressions.void
setKeys
(Map<String, ValueBinding> keys) Deprecated.usesetKeyExpressions(Map)
insteadvoid
setProvider
(IContentProvider provider) Source provider that this provider limits.void
Sets new value of the given propertyvoid
Variable representing the source provider to use in key value bindings.toString()
Returns string representation of content.
-
Field Details
-
m_provider
-
m_keys
-
m_var
-
-
Constructor Details
-
BoundPropertiesContentProvider
public BoundPropertiesContentProvider()Blank provider. Must be initialized withsetProvider(com.webmethods.caf.faces.data.IContentProvider)
,setKeys(java.util.Map<java.lang.String, javax.faces.el.ValueBinding>)
, andsetVar(java.lang.String)
. -
BoundPropertiesContentProvider
Provider limiting specified provider to specified keys.
-
-
Method Details
-
createDefaultKeys
@Deprecated public static Map<String,ValueBinding> createDefaultKeys(IContentProvider provider, String var) Deprecated.Creates the default key mapping for the specified provider and provider variable. For example, if the provider has three keys ["foo", "bar", "baz"], the default key mapping would be (with var "p") {"foo":"#{p.foo}", "bar":"#{p.bar}", "baz":"#{p.baz}"}. -
createDefaultKeyExpressions
public static Map<String,ValueExpression> createDefaultKeyExpressions(IContentProvider provider, String var) Creates the default key mapping for the specified provider and provider variable. For example, if the provider has three keys ["foo", "bar", "baz"], the default key mapping would be (with var "p") {"foo":"#{p.foo}", "bar":"#{p.bar}", "baz":"#{p.baz}"}. -
toString
Description copied from interface:IContentProvider
Returns string representation of content.- Specified by:
toString
in interfaceIContentProvider
- Overrides:
toString
in classObject
- Returns:
String
representation of the wrapped content
-
getPropertyKeys
Description copied from interface:IContentProvider
Returns list of properties supported by this content provider. Can returnObject[0]
, never null.- Specified by:
getPropertyKeys
in interfaceIContentProvider
- Returns:
- array of property keys which is typically of type
String
orInteger
-
getType
Description copied from interface:IContentProvider
Returns java type of the given property- Specified by:
getType
in interfaceIContentProvider
- Parameters:
propertyKey
- the property key of typeString
orInteger
- Returns:
- property java
Class
- Throws:
PropertyNotFoundException
- if property is not supported
-
getValue
Description copied from interface:IContentProvider
Returns value of the given property- Specified by:
getValue
in interfaceIContentProvider
- Parameters:
propertyKey
- the property key of typeString
orInteger
- Returns:
- value of the property, can be
null
- Throws:
PropertyNotFoundException
- if property is not supportedELException
-
hasProperty
Description copied from interface:IContentProvider
Checks if the given property is supported by this content provider- Specified by:
hasProperty
in interfaceIContentProvider
- Parameters:
propertyKey
- property key of typeString
orInteger
- Returns:
true
if property is supported
-
isReadOnly
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 interfaceIUpdateableContentProvider
- Parameters:
propertyKey
- property key of typeString
orInteger
- Returns:
- true if the property is readonly
- Throws:
PropertyNotFoundException
ELException
-
setValue
public void setValue(Object propertyKey, Object value) throws ELException, PropertyNotFoundException Description copied from interface:IUpdateableContentProvider
Sets new value of the given property
- Specified by:
setValue
in interfaceIUpdateableContentProvider
- Parameters:
propertyKey
- property key of typeString
orInteger
value
- new property value- Throws:
PropertyNotFoundException
- if property is not foundELException
-
getProvider
Source provider that this provider limits. -
setProvider
Source provider that this provider limits. -
getKeys
Deprecated.usegetKeyExpressions()
insteadMaps property names to value-binding expressions. -
setKeys
Deprecated.usesetKeyExpressions(Map)
insteadMaps property names to value-binding expressions. -
getKeyExpressions
Maps property names to value-binding expressions. -
setKeyExpressions
Maps property names to value-binding expressions. -
getVar
Variable representing the source provider to use in key value bindings. -
setVar
Variable representing the source provider to use in key value bindings.
-
createDefaultKeyExpressions(IContentProvider, String)
instead