Package writer2latex.base

# 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 Summary

Fields
Modifier and Type
Field
Description
`protected Map<String,ComplexOption>`
`optionGroups`
`protected Option[]`
`options`

## Constructor Summary

Constructors
Constructor
Description
`ConfigBase()`

## Method Summary

Modifier and Type
Method
Description
`protected ComplexOption`
`addComplexOption(String sGroup)`
`ComplexOption`
`getComplexOption(String sGroup)`
Get a complex option
`protected abstract String`
`getDefaultConfigPath()`
`String`
`getOption(String sName)`
Get a named option
`protected abstract int`
`getOptionCount()`
`void`
`read(File file)`
Read a configuration (file based version)
`void`
`read(InputStream is)`
Read configuration from a specified input stream
`void`
`readDefaultConfig(String sName)`
Read a default configuration: The available configurations depend on the `Converter` implementation
`protected abstract void`
`readInner(Element elm)`
Read configuration information from an xml element.
`void`
`setOption(String sName, String sValue)`
Set a name/value option.
`void`
`write(File file)`
Write the configuration (file based version)
`void`
`write(OutputStream os)`
Write the configuration (stream based version)
`protected abstract void`
`writeInner(Document dom)`
Write configuration information to an xml document.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### options

protected Option[] options

### optionGroups

protected Map<String,ComplexOption> optionGroups

## 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