gnu.mapping
Class LazyPropertyKey<T>
java.lang.Object
gnu.mapping.PropertyKey<T>
gnu.mapping.LazyPropertyKey<T>
public class LazyPropertyKey<T>
- extends PropertyKey<T>
A property whose value can be found lazily.
The property is initialized with a specifier string, which must have the
form of either:
-
"ClassName:fieldName"
: In this case "fieldName"
must
be the name of a static field in "ClassName"
, of type T
.
-
"*ClassName:methodName"
: In this case "methodName"
must be the name of a static method that takes one parameter
(the PropertySet
), and returns an object of type T
.
Method Summary |
T |
get(PropertySet container,
T defaultValue)
Get the value associated with this key in a given PropertySet . |
void |
set(PropertySet container,
java.lang.String specifier)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LazyPropertyKey
public LazyPropertyKey(java.lang.String name)
get
public T get(PropertySet container,
T defaultValue)
- Description copied from class:
PropertyKey
- Get the value associated with this key in a given
PropertySet
.
Return defaultValue
if there is no association for this key.
- Overrides:
get
in class PropertyKey<T>
set
public void set(PropertySet container,
java.lang.String specifier)