public interface Config
Modifier and Type | Method and Description |
---|---|
ComplexOption |
getComplexOption(java.lang.String sName)
Get a complex option
|
java.lang.String |
getOption(java.lang.String sName)
Get a named option
|
void |
read(java.io.File file)
Read a configuration (file based version)
|
void |
read(java.io.InputStream is)
Read a configuration (stream based version)
|
void |
readDefaultConfig(java.lang.String sName)
Read a default configuration: The available configurations depend on the
Converter implementation |
void |
setOption(java.lang.String sName,
java.lang.String sValue)
Set a name/value option.
|
void |
write(java.io.File file)
Write the configuration (file based version)
|
void |
write(java.io.OutputStream os)
Write the configuration (stream based version)
|
void readDefaultConfig(java.lang.String sName) throws java.lang.IllegalArgumentException
Converter
implementationsName
- the name of the configurationjava.lang.IllegalArgumentException
- if the configuration does not existvoid read(java.io.InputStream is) throws java.io.IOException
is
- the InputStream
to read fromjava.io.IOException
- if an error occurs reading the stream, or the data
is not in the right formatvoid read(java.io.File file) throws java.io.IOException
file
- the File
to read fromjava.io.IOException
- if the file does not exist, an error occurs reading
the file, or the data is not in the right formatvoid write(java.io.OutputStream os) throws java.io.IOException
os
- the OutputStream
to write tojava.io.IOException
- if an error occurs writing to the streamvoid write(java.io.File file) throws java.io.IOException
file
- the File
to write tojava.io.IOException
- if an error occurs writing to the filevoid setOption(java.lang.String sName, java.lang.String sValue)
Converter
implementation as well as null values are
silently ignoredsName
- the name of the optionsValue
- the value of the optionjava.lang.String getOption(java.lang.String sName)
sName
- the name of the optionnull
if the option does
not exist or the given name is nullComplexOption getComplexOption(java.lang.String sName)
sName
- the name of the complex option