Class Settings_impl

java.lang.Object
org.apache.uima.util.impl.Settings_impl
All Implemented Interfaces:
Settings

public class Settings_impl extends Object implements 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 Details

  • Constructor Details

    • Settings_impl

      public Settings_impl()
  • Method Details

    • getKeys

      public Set<String> getKeys()
      Return a set of keys of all properties in the map
      Specified by:
      getKeys in interface Settings
      Returns:
      - set of strings
    • load

      public void load(InputStream in) throws IOException
      Load properties from an input stream. Existing properties are not replaced (unlike java.util.Properties). May be called multiple times.
      Specified by:
      load in interface Settings
      Parameters:
      in - - Stream holding properties
      Throws:
      IOException - if name characters illegal
    • loadSystemDefaults

      public void loadSystemDefaults() throws ResourceConfigurationException
      Load the files specified in the system property UimaExternalOverrides
      Specified by:
      loadSystemDefaults in interface Settings
      Throws:
      ResourceConfigurationException - wraps IOException
    • lookUp

      public String lookUp(String name) throws ResourceConfigurationException
      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 interface Settings
      Parameters:
      name - - name to look up
      Returns:
      - value of property
      Throws:
      ResourceConfigurationException - if override variable references undefined variable
    • getArray

      private String getArray(String line) throws IOException
      Throws:
      IOException
    • getLine

      private String getLine() throws IOException
      Throws:
      IOException
    • extendLine

      private String extendLine(String line) throws IOException
      Throws:
      IOException
    • isEscaped

      private boolean isEscaped(String line, int ichar)