|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nuiton.util.decorator.MapPropertyHandler
public class MapPropertyHandler
A extended handler to deal with map in JXPath contexts.
The basic one in JXPath api only deals with map keys as string. We offers a hook in methodgetKey(Object) to obtain a string
representation of a real object in map (key or value).
More over, you can also access directly to a key or a value, using this
syntax :
context.getValue(".[@name='key:programme2']")
context.getValue(".[@name='value:programme2']")
If the values are iterable, then will scan inot it when looking for a direct
value.
DynamicPropertyHandler| Constructor Summary | |
|---|---|
MapPropertyHandler()
|
|
| Method Summary | |
|---|---|
protected String |
getKey(Object o)
Obtain a string representation of an object. |
Object |
getProperty(Object object,
String propertyName)
|
Object |
getPropertyKey(Map<?,?> map,
String key)
Obtain the key from the map keys which matches the given key. |
String[] |
getPropertyNames(Object object)
|
Object |
getPropertyValue(Map<?,?> map,
String value)
Obtain the value from the map values which matches the given value. |
void |
setProperty(Object object,
String propertyName,
Object value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public MapPropertyHandler()
| Method Detail |
|---|
public String[] getPropertyNames(Object object)
getPropertyNames in interface org.apache.commons.jxpath.DynamicPropertyHandler
public Object getProperty(Object object,
String propertyName)
getProperty in interface org.apache.commons.jxpath.DynamicPropertyHandler
public void setProperty(Object object,
String propertyName,
Object value)
setProperty in interface org.apache.commons.jxpath.DynamicPropertyHandler
public Object getPropertyKey(Map<?,?> map,
String key)
key.
To compare object ot string, please refers to the method getKey(Object).
map - the map to scankey - the string representation of the required key as object
null if not found.
public Object getPropertyValue(Map<?,?> map,
String value)
value.
To compare object to string, please refer to the method getKey(Object).
map - the map to scanvalue - the string representation of the value
null if not found.}protected String getKey(Object o)
o - the object to decorate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||