org.apache.uima.util
Interface Settings


public interface Settings

A Settings object holds the properties used for external parameter overrides. Similar to java.util.Properties but: - supports UTF-8 (so \\uXXXX escapes are not needed or supported) - keys must be valid Java identifiers (actually must not contain '=' ':' '}' or white-space) - reverses priority in that duplicate entries are ignored, i.e. once set values cannot be changed - multiple files can be loaded - values can contain references to other values, e.g. name = .... ${key} .... - arrays are represented as strings, e.g. '[elem1,elem2]', and can span multiple lines - '\' can be used in values to escape '$' '{' '[' ',' ']'

Author:
burn

Method Summary
 java.util.Set<java.lang.String> getKeys()
          Return a set of keys of all properties loaded
 void load(java.io.InputStream in)
          Load properties from an input stream.
 void loadSystemDefaults()
          Load properties from the comma-separated list of files specified in the system property UimaExternalOverrides Files are loaded in order --- so in descending priority.
 java.lang.String lookUp(java.lang.String name)
          Look up the value for a property.
 

Method Detail

load

void load(java.io.InputStream in)
          throws java.io.IOException
Load properties from an input stream. Existing properties are not changed and a warning is logged if the new value is different. May be called multiple times, so effective search is in load order. Arrays are enclosed in [] and the elements may be separated by , or new-line, so can span multiple lines without using a final \

Parameters:
in - - Stream holding properties
Throws:
java.io.IOException - if name characters illegal

loadSystemDefaults

void loadSystemDefaults()
                        throws ResourceConfigurationException
Load properties from the comma-separated list of files specified in the system property UimaExternalOverrides Files are loaded in order --- so in descending priority.

Throws:
ResourceConfigurationException - wraps IOException

lookUp

java.lang.String lookUp(java.lang.String name)
                        throws ResourceConfigurationException
Look up the value for a property. Perform one substitution pass on ${key} substrings replacing them with the value for key. Recursively evaluate the value to be substituted. NOTE: infinite loops not detected! If the key variable has not been defined, an exception is thrown. To avoid evaluation and get ${key} in the output escape the $ or { Arrays are returned as a comma-separated string, e.g. "[elem1,elem2]" Note: escape characters are not removed as they may affect array separators.

Parameters:
name - - name to look up
Returns:
- value of property
Throws:
ResourceConfigurationException - if the value references an undefined property

getKeys

java.util.Set<java.lang.String> getKeys()
Return a set of keys of all properties loaded

Returns:
- set of strings


Copyright © 2006–2014 The Apache Software Foundation. All rights reserved.