Interface Config


public interface Config
This is an interface for configuration of a Converter. A configuration always supports simple name/value options. In addition, you can read and write configurations using streams or abstract file names. The format depends on the Converter implementation, cf. the user's manual.
  • Method Details

    • readDefaultConfig

      void readDefaultConfig(String sName) throws IllegalArgumentException
      Read a default configuration: The available configurations depend on the Converter implementation
      Parameters:
      sName - the name of the configuration
      Throws:
      IllegalArgumentException - if the configuration does not exist
    • read

      void read(InputStream is) throws IOException
      Read a configuration (stream based version)
      Parameters:
      is - the InputStream to read from
      Throws:
      IOException - if an error occurs reading the stream, or the data is not in the right format
    • read

      void read(File file) throws IOException
      Read a configuration (file based version)
      Parameters:
      file - the File to read from
      Throws:
      IOException - if the file does not exist, an error occurs reading the file, or the data is not in the right format
    • write

      void write(OutputStream os) throws IOException
      Write the configuration (stream based version)
      Parameters:
      os - the OutputStream to write to
      Throws:
      IOException - if an error occurs writing to the stream
    • write

      void write(File file) throws IOException
      Write the configuration (file based version)
      Parameters:
      file - the File to write to
      Throws:
      IOException - if an error occurs writing to the file
    • getParameters

      Map<String,List<String>> getParameters()
      Get the definitions of all defined parameters. Parameters are defined in configuration files. A parameter has a name and a list of associated values, the first value being the default value. The actual values are accessed as ordinary options. The current value of parameters are automatically applied to option values by the the get method.
      Returns:
      map from parameter names to list of possible parameter values
    • setOption

      void setOption(String sName, String sValue)
      Set a name/value option. Options that are not defined by the Converter implementation as well as null values are silently ignored
      Parameters:
      sName - the name of the option
      sValue - the value of the option
    • getOption

      String getOption(String sName)
      Get a named option
      Parameters:
      sName - the name of the option
      Returns:
      the value of the option, or null if the option does not exist or the given name is null
    • getComplexOption

      ComplexOption getComplexOption(String sName)
      Get a complex option
      Parameters:
      sName - the name of the complex option
      Returns:
      the option