Class StringLookupFactory.DefaultStringLookupsHolder
java.lang.Object
org.apache.commons.text.lookup.StringLookupFactory.DefaultStringLookupsHolder
- Enclosing class:
StringLookupFactory
Internal class used to construct the default
StringLookup map used by StringLookupFactory.addDefaultStringLookups(Map).- Since:
- 1.3
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<String, StringLookup> Default string lookup map.(package private) static final StringLookupFactory.DefaultStringLookupsHolderSingleton instance, initialized with the system properties. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance initialized with the given properties. -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddLookup(DefaultStringLookup lookup, Map<String, StringLookup> map) Adds the key and string lookup fromlookuptomap, also adding any additional key aliases if needed.private static Map<String, StringLookup> Creates the lookup map used when the user has requested no customization.(package private) Map<String, StringLookup> Gets the default string lookups map.private static Map<String, StringLookup> parseStringLookups(String str) Constructs a lookup map by parsing the given string.
-
Field Details
-
INSTANCE
Singleton instance, initialized with the system properties. -
defaultStringLookups
Default string lookup map.
-
-
Constructor Details
-
DefaultStringLookupsHolder
DefaultStringLookupsHolder(Properties props) Constructs a new instance initialized with the given properties.- Parameters:
props- initialization properties.
-
-
Method Details
-
addLookup
Adds the key and string lookup fromlookuptomap, also adding any additional key aliases if needed. Keys are normalized using theStringLookupFactory.toKey(String)method.- Parameters:
lookup- lookup to add.map- map to add to.
-
createDefaultStringLookups
Creates the lookup map used when the user has requested no customization.- Returns:
- default lookup map.
-
parseStringLookups
Constructs a lookup map by parsing the given string. The string is expected to contain comma or space-separated names of values from theDefaultStringLookupenum. If the given string is null or empty, an empty map is returned.- Parameters:
str- string to parse; may be null or empty.- Returns:
- lookup map parsed from the given string.
-
getDefaultStringLookups
Map<String, StringLookup> getDefaultStringLookups()Gets the default string lookups map.- Returns:
- default string lookups map.
-