public class ConfigurationParser
extends java.lang.Object
implements java.lang.AutoCloseable
| Constructor and Description |
|---|
ConfigurationParser(java.io.File file)
Deprecated.
Temporary code for backward compatibility in Obclipse.
|
ConfigurationParser(java.io.File file,
java.util.Properties properties)
Creates a new ConfigurationParser for the given file and the given
Properties.
|
ConfigurationParser(java.lang.String[] args,
java.io.File baseDir,
java.util.Properties properties)
Creates a new ConfigurationParser for the given String arguments,
with the given base directory and the given Properties.
|
ConfigurationParser(java.lang.String[] args,
java.util.Properties properties)
Creates a new ConfigurationParser for the given String arguments and
the given Properties.
|
ConfigurationParser(java.lang.String lines,
java.lang.String description,
java.io.File baseDir,
java.util.Properties properties)
Creates a new ConfigurationParser for the given lines,
with the given base directory and the given Properties.
|
ConfigurationParser(java.net.URL url,
java.util.Properties properties)
Creates a new ConfigurationParser for the given URL and the given
Properties.
|
ConfigurationParser(WordReader reader,
java.util.Properties properties)
Creates a new ConfigurationParser for the given word reader and the
given Properties.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the configuration.
|
static void |
main(java.lang.String[] args)
A main method for testing configuration parsing.
|
void |
parse(Configuration configuration)
Parses and returns the configuration.
|
void |
parse(Configuration configuration,
java.util.function.BiConsumer<java.lang.String,java.lang.String> unknownOptionHandler)
Parses and returns the configuration.
|
ClassSpecification |
parseClassSpecificationArguments() |
ClassSpecification |
parseClassSpecificationArguments(boolean readFirstWord,
boolean allowClassMembers,
boolean allowValues)
Parses and returns a class specification.
|
public ConfigurationParser(java.lang.String[] args,
java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionpublic ConfigurationParser(java.lang.String[] args,
java.io.File baseDir,
java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionpublic ConfigurationParser(java.lang.String lines,
java.lang.String description,
java.io.File baseDir,
java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionpublic ConfigurationParser(java.io.File file)
throws java.io.IOException
java.io.IOExceptionpublic ConfigurationParser(java.io.File file,
java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionpublic ConfigurationParser(java.net.URL url,
java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionpublic ConfigurationParser(WordReader reader, java.util.Properties properties) throws java.io.IOException
java.io.IOExceptionpublic void parse(Configuration configuration) throws ParseException, java.io.IOException
configuration - the configuration that is updated as a side-effect.ParseException - if the any of the configuration settings contains
a syntax error.java.io.IOException - if an IO error occurs while reading a configuration.public void parse(Configuration configuration, java.util.function.BiConsumer<java.lang.String,java.lang.String> unknownOptionHandler) throws ParseException, java.io.IOException
configuration - the configuration that is updated as a side-effect.unknownOptionHandler - optional handler for unknown options; if null then a ParseException
is thrown when encountering an unknown option.ParseException - if the any of the configuration settings contains
a syntax error.java.io.IOException - if an IO error occurs while reading a configuration.public void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOException - if an IO error occurs while closing the configuration.public ClassSpecification parseClassSpecificationArguments() throws ParseException, java.io.IOException
ParseExceptionjava.io.IOExceptionpublic ClassSpecification parseClassSpecificationArguments(boolean readFirstWord, boolean allowClassMembers, boolean allowValues) throws ParseException, java.io.IOException
ParseException - if the class specification contains a syntax error.java.io.IOException - if an IO error occurs while reading the class
specification.public static void main(java.lang.String[] args)