Package com.webmethods.caf.faces.data
Class ContentProviderUtils
java.lang.Object
com.webmethods.caf.faces.data.ContentProviderUtils
Utility functions for content providers. Should not be used by clients directly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Object
evaluateBinding
(Object provider, String providerVariable, ValueExpression binding) Evaluates the specified binding in the context of the specified content provider, using the specified provider variable.static Object
evaluateBinding
(Object provider, String providerVariable, ValueBinding binding) Deprecated.static Object
evaluateRowBinding
(ITableContentProvider table, ValueExpression binding) Evaluates the specified binding in the context of the specified table's current row, using the the row variable specified byITableContentProvider.getRowVariable()
.static Object
evaluateRowBinding
(ITableContentProvider table, ValueBinding binding) Deprecated.static PropertyDescriptor
getPropertyDescriptor
(Class<?> c, Object propertyKey) Get descriptor for property specified by name.static Object[]
Returns property keys for object.static Class<?>
Returns property type for a class.static Class<?>
Returns property type for object.static Object
Returns property value for object.static boolean
hasProperty
(Class<?> c, Object propertyKey) Checks if a property exists for aClass
.static boolean
hasProperty
(Object o, Object propertyKey) Checks if a property exists for object.static boolean
isReadOnly
(Class<?> c, Object propertyKey) Checks if a property is editable for aClass
.static boolean
isReadOnly
(Object o, Object propertyKey) Checks if a property is editable for a object.static void
Set value for property in an object.
-
Constructor Details
-
ContentProviderUtils
public ContentProviderUtils()
-
-
Method Details
-
getPropertyKeys
Returns property keys for object.- Parameters:
o
-Object
containing the properties- Returns:
Object[]
of all the property keys
-
getType
Returns property type for object.- Parameters:
o
-Object
containing the propertypropertyKey
- the property key of typeString
orInteger
- Returns:
Class
of the property- Throws:
PropertyNotFoundException
- if the object does not have the propertyKey
-
getType
Returns property type for a class.- Parameters:
c
-Class
containing the propertypropertyKey
- the property key of typeString
orInteger
- Returns:
Class
of the property- Throws:
PropertyNotFoundException
- if the class does not have the propertyKey
-
getValue
public static Object getValue(Object o, Object propertyKey) throws ELException, PropertyNotFoundException Returns property value for object.- Parameters:
o
-Object
containing the propertypropertyKey
- the property key of typeString
orInteger
- Returns:
Object
value against the property- Throws:
EvaluationException
- if error during property evaluationPropertyNotFoundException
- if the object does not have the propertyKeyELException
-
hasProperty
Checks if a property exists for object.- Parameters:
o
-Object
containing the propertypropertyKey
- the property key of typeString
orInteger
- Returns:
true
if the property exists,false
otherwise
-
hasProperty
Checks if a property exists for aClass
.- Parameters:
o
-Class
containing the propertypropertyKey
- the property key of typeString
orInteger
- Returns:
true
if the property exists,false
otherwise
-
isReadOnly
public static boolean isReadOnly(Object o, Object propertyKey) throws ELException, PropertyNotFoundException Checks if a property is editable for a object.- Parameters:
o
-Object
containing the propertypropertyKey
- the property key of typeString
orInteger
- Returns:
true
if the property is editable,false
otherwise- Throws:
PropertyNotFoundException
- if the object does not have the propertyKeyELException
-
isReadOnly
Checks if a property is editable for aClass
.- Parameters:
o
-Class
containing the propertypropertyKey
- the property key of typeString
orInteger
- Returns:
true
if the property is editable,false
otherwise- Throws:
PropertyNotFoundException
- if the object does not have the propertyKey
-
setValue
public static void setValue(Object o, Object propertyKey, Object value) throws ELException, PropertyNotFoundException Set value for property in an object.- Parameters:
o
-Object
containing the propertypropertyKey
- the property key of typeString
orInteger
value
-Object
value against the property- Throws:
EvaluationException
- if error during property evaluationPropertyNotFoundException
- if the object does not have the propertyKeyELException
-
evaluateBinding
@Deprecated public static Object evaluateBinding(Object provider, String providerVariable, ValueBinding binding) Deprecated.useevaluateBinding(Object, String, ValueExpression)
insteadEvaluates the specified binding in the context of the specified content provider, using the specified provider variable.- Parameters:
provider
- content providerproviderVariable
- provider variablebinding
-ValueBinding
- Returns:
- the evaluated value
-
evaluateBinding
public static Object evaluateBinding(Object provider, String providerVariable, ValueExpression binding) Evaluates the specified binding in the context of the specified content provider, using the specified provider variable.- Parameters:
provider
- content providerproviderVariable
- provider variablebinding
-ValueBinding
- Returns:
- the evaluated value
-
evaluateRowBinding
@Deprecated public static Object evaluateRowBinding(ITableContentProvider table, ValueBinding binding) Deprecated.Evaluates the specified binding in the context of the specified table's current row, using the the row variable specified byITableContentProvider.getRowVariable()
.- Parameters:
table
-ITableContentProvider
binding
-ValueBinding
- Returns:
- the evaluated value
-
evaluateRowBinding
Evaluates the specified binding in the context of the specified table's current row, using the the row variable specified byITableContentProvider.getRowVariable()
.- Parameters:
table
-ITableContentProvider
binding
-ValueBinding
- Returns:
- the evaluated value
-
getPropertyDescriptor
Get descriptor for property specified by name.- Parameters:
c
-Class
containing the propertypropertyKey
- the property key of typeString
orInteger
- Returns:
PropertyDescriptor
, or null if not found.
-
evaluateBinding(Object, String, ValueExpression)
instead