Package org.apache.commons.text.lookup
Class FileStringLookup
- java.lang.Object
-
- org.apache.commons.text.lookup.AbstractStringLookup
-
- org.apache.commons.text.lookup.FileStringLookup
-
- All Implemented Interfaces:
StringLookup
final class FileStringLookup extends AbstractStringLookup
Looks up keys from an XML document.Using a
StringLookup
from theStringLookupFactory
:StringLookupFactory.INSTANCE.fileStringLookup().lookup(UTF-8:com/domain/document.properties");
Using a
StringSubstitutor
:StringSubstitutor.createInterpolator().replace("... ${file:UTF-8:com/domain/document.properties} ..."));
The above examples convert
"UTF-8:SomePath"
to the contents of the file.- Since:
- 1.5
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static AbstractStringLookup
INSTANCE
Defines the singleton for this class.-
Fields inherited from class org.apache.commons.text.lookup.AbstractStringLookup
SPLIT_CH, SPLIT_STR
-
-
Constructor Summary
Constructors Modifier Constructor Description private
FileStringLookup()
No need to build instances for now.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
lookup(java.lang.String key)
Looks up the value for the key in the format "DocumentPath:XPath".-
Methods inherited from class org.apache.commons.text.lookup.AbstractStringLookup
substringAfter, substringAfter, substringAfterLast, toLookupKey, toLookupKey
-
-
-
-
Field Detail
-
INSTANCE
static final AbstractStringLookup INSTANCE
Defines the singleton for this class.
-
-