Package 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:
  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 Details

    • LazyPropertyKey

      public LazyPropertyKey(String name)
  • Method Details

    • 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, String specifier)