Class ConfigBase

java.lang.Object
writer2latex.base.ConfigBase
All Implemented Interfaces:
Config
Direct Known Subclasses:
LaTeXConfig, XhtmlConfig

public abstract class ConfigBase extends Object implements Config
  • Field Details

  • Constructor Details

    • ConfigBase

      public ConfigBase()
  • Method Details

    • getOptionCount

      protected abstract int getOptionCount()
    • getDefaultConfigPath

      protected abstract String getDefaultConfigPath()
    • setOption

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

      public String getOption(String sName)
      Description copied from interface: Config
      Get a named option
      Specified by:
      getOption in interface Config
      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

      public ComplexOption getComplexOption(String sGroup)
      Description copied from interface: Config
      Get a complex option
      Specified by:
      getComplexOption in interface Config
      Parameters:
      sGroup - the name of the complex option
      Returns:
      the option
    • addComplexOption

      protected ComplexOption addComplexOption(String sGroup)
    • readDefaultConfig

      public void readDefaultConfig(String sName) throws IllegalArgumentException
      Description copied from interface: Config
      Read a default configuration: The available configurations depend on the Converter implementation
      Specified by:
      readDefaultConfig in interface Config
      Parameters:
      sName - the name of the configuration
      Throws:
      IllegalArgumentException - if the configuration does not exist
    • read

      public void read(InputStream is) throws IOException

      Read configuration from a specified input stream

      Specified by:
      read in interface Config
      Parameters:
      is - the input stream to read the configuration from
      Throws:
      IOException - if an error occurs reading the stream, or the data is not in the right format
    • read

      public void read(File file) throws IOException
      Description copied from interface: Config
      Read a configuration (file based version)
      Specified by:
      read in interface Config
      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
    • readInner

      protected abstract void readInner(Element elm)
      Read configuration information from an xml element. The subclass must define this to read richer configuration data
    • write

      public void write(OutputStream os) throws IOException
      Description copied from interface: Config
      Write the configuration (stream based version)
      Specified by:
      write in interface Config
      Parameters:
      os - the OutputStream to write to
      Throws:
      IOException - if an error occurs writing to the stream
    • write

      public void write(File file) throws IOException
      Description copied from interface: Config
      Write the configuration (file based version)
      Specified by:
      write in interface Config
      Parameters:
      file - the File to write to
      Throws:
      IOException - if an error occurs writing to the file
    • writeInner

      protected abstract void writeInner(Document dom)
      Write configuration information to an xml document. The subclass must define this to write richer configuration data