Class PropertiesStringLookup

All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>, StringLookup

final class PropertiesStringLookup extends AbstractPathFencedLookup
Looks up keys from a properties file.

Looks up the value for a given key in the format "Document::Key".

Note the use of "::" instead of ":" to allow for "C:" drive letters in paths.

For example: "com/domain/document.properties:key".

Public access is through StringLookupFactory.

Since:
1.5
See Also:
  • Field Details

  • Constructor Details

    • PropertiesStringLookup

      PropertiesStringLookup(Path... fences)
      Constructs a new instance.
      Parameters:
      fences - The fences guarding Path resolution.
  • Method Details

    • toPropertyKey

      static String toPropertyKey(String file, String key)
      Creates a lookup key for a given file and key.
    • lookup

      public String lookup(String key)
      Looks up the value for the key in the format "DocumentPath:XPath".

      For example: "com/domain/document.xml::/path/to/node".

      Note the use of "::" instead of ":" to allow for "C:" drive letters in paths.

      Parameters:
      key - the key to be looked up, may be null.
      Returns:
      The value associated with the key.