public class MapContentProvider extends Object implements IContentProvider, IUpdateableContentProvider
Map
to an IContentProvider
.Constructor and Description |
---|
MapContentProvider(Map m) |
Modifier and Type | Method and Description |
---|---|
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 |
setValue(Object propertyKey,
Object value)
Sets new value of the given property
|
String |
toString()
Returns string representation of content.
|
protected Map m_map
public MapContentProvider(Map m)
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 evaluationPropertyNotFoundException
- 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 valueEvaluationException
- if error happens during property assigmentPropertyNotFoundException
- if property is not found