Class PropertiesStringLookup
java.lang.Object
org.apache.commons.text.lookup.AbstractStringLookup
org.apache.commons.text.lookup.AbstractPathFencedLookup
org.apache.commons.text.lookup.PropertiesStringLookup
- All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>, StringLookup
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 Summary
FieldsModifier and TypeFieldDescription(package private) static final PropertiesStringLookupDefines the singleton for this class.(package private) static final StringSeparates file and key.Fields inherited from class AbstractPathFencedLookup
fenceFields inherited from class AbstractStringLookup
SPLIT_CH, SPLIT_STR -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class AbstractPathFencedLookup
getPathMethods inherited from class AbstractStringLookup
substringAfter, substringAfter, substringAfterLast, toLookupKey, toLookupKeyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StringLookup
apply
-
Field Details
-
INSTANCE
Defines the singleton for this class. -
SEPARATOR
-
-
Constructor Details
-
PropertiesStringLookup
PropertiesStringLookup(Path... fences) Constructs a new instance.- Parameters:
fences- The fences guarding Path resolution.
-
-
Method Details
-
toPropertyKey
-
lookup
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.
-