gnu.mapping
Class LazyPropertyKey<T>

java.lang.Object
  extended by gnu.mapping.PropertyKey<T>
      extended by 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:

  1. "ClassName:fieldName": In this case "fieldName" must be the name of a static field in "ClassName", of type T.
  2. "*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.


Constructor Summary
LazyPropertyKey(java.lang.String name)
           
 
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 gnu.mapping.PropertyKey
get, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LazyPropertyKey

public LazyPropertyKey(java.lang.String name)
Method Detail

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)