Package org.apache.uima.util.impl
Class Settings_impl
java.lang.Object
org.apache.uima.util.impl.Settings_impl
- All Implemented Interfaces:
Settings
Class that reads properties files containing external parameter overrides used by the ExternalOverrideSettings_impl
class.
Similar to java.util.Properties but:
supports UTF-8 files
reverses priority in that duplicate key values are ignored, i.e. values cannot be changed
arrays are represented as strings, e.g. '[elem1,elem2]', and can span multiple lines
'\' can be used to escape $ [ , ] and the line-end
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Pattern
protected static final String
private BufferedReader
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate String
extendLine
(String line) private String
getKeys()
Return a set of keys of all properties in the mapprivate String
getLine()
private boolean
void
load
(InputStream in) Load properties from an input stream.void
Load the files specified in the system property UimaExternalOverridesLook up the value for a property.
-
Field Details
-
LOG_RESOURCE_BUNDLE
- See Also:
-
rdr
-
map
-
evalPattern
-
-
Constructor Details
-
Settings_impl
public Settings_impl()
-
-
Method Details
-
getKeys
Return a set of keys of all properties in the map -
load
Load properties from an input stream. Existing properties are not replaced (unlike java.util.Properties). May be called multiple times.- Specified by:
load
in interfaceSettings
- Parameters:
in
- - Stream holding properties- Throws:
IOException
- if name characters illegal
-
loadSystemDefaults
Load the files specified in the system property UimaExternalOverrides- Specified by:
loadSystemDefaults
in interfaceSettings
- Throws:
ResourceConfigurationException
- wraps IOException
-
lookUp
Look up the value for a property. Perform one substitution pass on ${key} substrings. If key is undefined throw an exception. Recursively evaluate the value to be substituted. NOTE: infinite loops not detected! To avoid evaluation and get ${key} in the output use a property to generate the $, e.g. $ = $ key = ${$}{key} or escape the $ key = \${key}- Specified by:
lookUp
in interfaceSettings
- Parameters:
name
- - name to look up- Returns:
- - value of property
- Throws:
ResourceConfigurationException
- if override variable references undefined variable
-
getArray
- Throws:
IOException
-
getLine
- Throws:
IOException
-
extendLine
- Throws:
IOException
-
isEscaped
-