public class ConfigurationParser
extends java.lang.Object
ConfigurationHandler
Modifier and Type | Field and Description |
---|---|
private ConfigurationHandler |
handler |
static java.lang.String |
IMPORT_PREFIX |
static java.lang.String |
LOAD_PREFIX |
static java.lang.String |
MAIN_PREFIX |
static java.lang.String |
OPTIONALLY_PREFIX
Optionally spec prefix.
|
static java.lang.String |
SET_PREFIX |
private java.util.Properties |
systemProperties |
Constructor and Description |
---|
ConfigurationParser(ConfigurationHandler handler,
java.util.Properties systemProperties) |
Modifier and Type | Method and Description |
---|---|
private boolean |
canIgnore(java.lang.String line)
Determine if a line can be ignored because it is
a comment or simply blank.
|
protected java.lang.String |
filter(java.lang.String text)
Filter a string for system properties.
|
protected void |
loadGlob(java.lang.String line,
boolean optionally)
Load a glob into the specified classloader.
|
void |
parse(java.io.InputStream is)
Parse launcher configuration file and send events to the handler.
|
public static final java.lang.String MAIN_PREFIX
public static final java.lang.String SET_PREFIX
public static final java.lang.String IMPORT_PREFIX
public static final java.lang.String LOAD_PREFIX
public static final java.lang.String OPTIONALLY_PREFIX
private ConfigurationHandler handler
private java.util.Properties systemProperties
public ConfigurationParser(ConfigurationHandler handler, java.util.Properties systemProperties)
public void parse(java.io.InputStream is) throws java.io.IOException, ConfigurationException, DuplicateRealmException, NoSuchRealmException
is
- the inputstreamjava.io.IOException
- when IOException occursConfigurationException
- when ConfigurationException occursDuplicateRealmException
- when realm already existsNoSuchRealmException
- when realm doesn't existprotected void loadGlob(java.lang.String line, boolean optionally) throws java.net.MalformedURLException, java.io.FileNotFoundException, ConfigurationException
line
- The path configuration line.optionally
- Whether the path is optional or requiredjava.net.MalformedURLException
- If the line does not represent
a valid path element.java.io.FileNotFoundException
- If the line does not represent
a valid path element in the filesystem.ConfigurationException
- will never occur (thrown for backwards compatibility)protected java.lang.String filter(java.lang.String text) throws ConfigurationException
text
- The text to filter.ConfigurationException
- If the property does not
exist or if there is a syntax error.private boolean canIgnore(java.lang.String line)
line
- The line to test.true
if the line is ignorable,
otherwise false
.