Class ResourceBundleStringLookup
java.lang.Object
org.apache.commons.text.lookup.AbstractStringLookup
org.apache.commons.text.lookup.ResourceBundleStringLookup
- All Implemented Interfaces:
Function<String,String>, UnaryOperator<String>, StringLookup
Looks up keys from resource bundles.
Looks up the value for a given key in the format "BundleName:BundleKey".
For example: "com.domain.messages:MyKey".
Public access is through StringLookupFactory.
- Since:
- 1.3
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe name of the resource bundle from which to look something up.(package private) static final ResourceBundleStringLookupDefines the singleton for this class.Fields inherited from class AbstractStringLookup
SPLIT_CH, SPLIT_STR -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateConstructs a blank instance.(package private)ResourceBundleStringLookup(String bundleName) Constructs an instance that only works for the given bundle. -
Method Summary
Methods inherited from class AbstractStringLookup
substringAfter, substringAfter, substringAfterLast, toLookupKey, toLookupKeyMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface StringLookup
apply
-
Field Details
-
INSTANCE
Defines the singleton for this class. -
bundleName
The name of the resource bundle from which to look something up.
-
-
Constructor Details
-
ResourceBundleStringLookup
private ResourceBundleStringLookup()Constructs a blank instance. -
ResourceBundleStringLookup
ResourceBundleStringLookup(String bundleName) Constructs an instance that only works for the given bundle.- Parameters:
bundleName- the name of the resource bundle from which we will look keys up.- Since:
- 1.5
-
-
Method Details
-
getBundle
-
getString
-
lookup
-
toString
-