public class ContentProviderUtils extends Object
Constructor and Description |
---|
ContentProviderUtils() |
Modifier and Type | Method and Description |
---|---|
static Object |
evaluateBinding(Object provider,
String providerVariable,
ValueBinding binding)
Deprecated.
use
evaluateBinding(Object, String, ValueExpression) instead |
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.
|
static Object |
evaluateRowBinding(ITableContentProvider table,
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 by
ITableContentProvider.getRowVariable() . |
static PropertyDescriptor |
getPropertyDescriptor(Class<?> c,
Object propertyKey)
Get descriptor for property specified by name.
|
static Object[] |
getPropertyKeys(Object o)
Returns property keys for object.
|
static Class<?> |
getType(Class<?> c,
Object propertyKey)
Returns property type for a class.
|
static Class<?> |
getType(Object o,
Object propertyKey)
Returns property type for object.
|
static Object |
getValue(Object o,
Object propertyKey)
Returns property value for object.
|
static boolean |
hasProperty(Class<?> c,
Object propertyKey)
Checks if a property exists for a
Class . |
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 a
Class . |
static boolean |
isReadOnly(Object o,
Object propertyKey)
Checks if a property is editable for a object.
|
static void |
setValue(Object o,
Object propertyKey,
Object value)
Set value for property in an object.
|
public static Object[] getPropertyKeys(Object o)
o
- Object
containing the propertiesObject[]
of all the property keyspublic static Class<?> getType(Object o, Object propertyKey) throws PropertyNotFoundException
o
- Object
containing the propertypropertyKey
- the property key of type String
or
Integer
Class
of the propertyPropertyNotFoundException
- if the object does not have the propertyKeypublic static Class<?> getType(Class<?> c, Object propertyKey) throws PropertyNotFoundException
c
- Class
containing the propertypropertyKey
- the property key of type String
or
Integer
Class
of the propertyPropertyNotFoundException
- if the class does not have the propertyKeypublic static Object getValue(Object o, Object propertyKey) throws ELException, PropertyNotFoundException
o
- Object
containing the propertypropertyKey
- the property key of type String
or
Integer
Object
value against the propertyEvaluationException
- if error during property evaluationPropertyNotFoundException
- if the object does not have the propertyKeyELException
public static boolean hasProperty(Object o, Object propertyKey)
o
- Object
containing the propertypropertyKey
- the property key of type String
or
Integer
true
if the property exists, false
otherwisepublic static boolean hasProperty(Class<?> c, Object propertyKey)
Class
.o
- Class
containing the propertypropertyKey
- the property key of type String
or
Integer
true
if the property exists, false
otherwisepublic static boolean isReadOnly(Object o, Object propertyKey) throws ELException, PropertyNotFoundException
o
- Object
containing the propertypropertyKey
- the property key of type String
or
Integer
true
if the property is editable, false
otherwisePropertyNotFoundException
- if the object does not have the propertyKeyELException
public static boolean isReadOnly(Class<?> c, Object propertyKey) throws PropertyNotFoundException
Class
.o
- Class
containing the propertypropertyKey
- the property key of type String
or
Integer
true
if the property is editable, false
otherwisePropertyNotFoundException
- if the object does not have the propertyKeypublic static void setValue(Object o, Object propertyKey, Object value) throws ELException, PropertyNotFoundException
o
- Object
containing the propertypropertyKey
- the property key of type String
or
Integer
value
- Object
value against the propertyEvaluationException
- if error during property evaluationPropertyNotFoundException
- if the object does not have the propertyKeyELException
@Deprecated public static Object evaluateBinding(Object provider, String providerVariable, ValueBinding binding)
evaluateBinding(Object, String, ValueExpression)
insteadprovider
- content providerproviderVariable
- provider variablebinding
- ValueBinding
public static Object evaluateBinding(Object provider, String providerVariable, ValueExpression binding)
provider
- content providerproviderVariable
- provider variablebinding
- ValueBinding
@Deprecated public static Object evaluateRowBinding(ITableContentProvider table, ValueBinding binding)
evaluateRowBinding(ITableContentProvider, ValueExpression)
insteadITableContentProvider.getRowVariable()
.table
- ITableContentProvider
binding
- ValueBinding
public static Object evaluateRowBinding(ITableContentProvider table, ValueExpression binding)
ITableContentProvider.getRowVariable()
.table
- ITableContentProvider
binding
- ValueBinding
public static PropertyDescriptor getPropertyDescriptor(Class<?> c, Object propertyKey)
c
- Class
containing the propertypropertyKey
- the property key of type String
or
Integer
PropertyDescriptor
, or null if not found.