public class ConfigParser extends Object
Constructor and Description |
---|
ConfigParser(File file)
Creates a parser on a Nyx-style XML config file.
|
ConfigParser(InputStream is)
Creates a parser that reads a Nyx-style XML config from an
InputStream |
ConfigParser(Reader reader)
Creates a parser that reads a Nyx-style XML config from a
Reader |
Modifier and Type | Method and Description |
---|---|
static Class<? extends ConfigElement> |
computeClassName(String name,
String packageContext) |
String |
getPackageContext() |
ConfigElement |
parse()
Parses the config and returns the config root.
|
ConfigParser |
setPackageContext(String packageContext) |
public ConfigParser(File file) throws IOException
file
- The file to read contents fromIOException
- if the file cannot be opened for readingpublic ConfigParser(InputStream is)
InputStream
is
- The stream to read config frompublic ConfigElement parse() throws NumberFormatException, IOException
NumberFormatException
- if any config formatting errors are encountered, or if a config entry has a
mismatched type (e.g. a supposedly integer field is not a number)IOException
- if an I/O error occursorg.projectnyx.config
public static Class<? extends ConfigElement> computeClassName(String name, String packageContext)
public String getPackageContext()
public ConfigParser setPackageContext(String packageContext)
Copyright © 2016. All rights reserved.