|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.util.lang.PropertyResolver
public final class PropertyResolver
This class parses expressions to lookup or set a value on the object that is
given.
The supported expressions are:
"property": This can can then be a bean property with get and set method. Or if a map is given as an object it will be lookup with the property as a key when there is not get method for that property.
"property1.property2": Both properties are lookup as written above. If property1 evaluates to null then if there is a setMethod (or if it is a map) and the Class of the property has a default constructor then the object will be constructed and set on the object.
"property.index": If the property is a List or Array then the second property can be a index on that list like: 'mylist.0' this expression will also map on a getProperty(index) or setProperty(index,value) methods. If the object is a List then the list will grow automaticaly if the index is greater then the size
Index or map properties can also be written as: "property[index]" or "property[key]"
| Method Summary | |
|---|---|
static java.lang.Object |
getValue(java.lang.String expression,
java.lang.Object object)
Looksup the value from the object with the given expression. |
static void |
setValue(java.lang.String expression,
java.lang.Object object,
java.lang.Object value,
IConverter converter)
Set the value on the object with the given expression. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static final java.lang.Object getValue(java.lang.String expression,
java.lang.Object object)
expression - The expression string with the property to be lookup.object - The object which is evaluated.
public static final void setValue(java.lang.String expression,
java.lang.Object object,
java.lang.Object value,
IConverter converter)
expression - The expression string with the property to be set.object - The object which is evaluated to set the value on.value - The value to set.converter - The convertor to convert the value if needed to the right
type.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||