Class ConfigurationParser
- java.lang.Object
-
- org.codehaus.plexus.classworlds.launcher.ConfigurationParser
-
public class ConfigurationParser extends java.lang.Object
Event based launcher configuration parser, delegating effective configuration handling to ConfigurationHandler.- See Also:
ConfigurationHandler
-
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description ConfigurationParser(ConfigurationHandler handler, java.util.Properties systemProperties)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Field Detail
-
MAIN_PREFIX
public static final java.lang.String MAIN_PREFIX
- See Also:
- Constant Field Values
-
SET_PREFIX
public static final java.lang.String SET_PREFIX
- See Also:
- Constant Field Values
-
IMPORT_PREFIX
public static final java.lang.String IMPORT_PREFIX
- See Also:
- Constant Field Values
-
LOAD_PREFIX
public static final java.lang.String LOAD_PREFIX
- See Also:
- Constant Field Values
-
OPTIONALLY_PREFIX
public static final java.lang.String OPTIONALLY_PREFIX
Optionally spec prefix.- See Also:
- Constant Field Values
-
handler
private ConfigurationHandler handler
-
systemProperties
private java.util.Properties systemProperties
-
-
Constructor Detail
-
ConfigurationParser
public ConfigurationParser(ConfigurationHandler handler, java.util.Properties systemProperties)
-
-
Method Detail
-
parse
public void parse(java.io.InputStream is) throws java.io.IOException, ConfigurationException, DuplicateRealmException, NoSuchRealmException
Parse launcher configuration file and send events to the handler.- Parameters:
is
- the inputstream- Throws:
java.io.IOException
- when IOException occursConfigurationException
- when ConfigurationException occursDuplicateRealmException
- when realm already existsNoSuchRealmException
- when realm doesn't exist
-
loadGlob
protected void loadGlob(java.lang.String line, boolean optionally) throws java.net.MalformedURLException, java.io.FileNotFoundException, ConfigurationException
Load a glob into the specified classloader.- Parameters:
line
- The path configuration line.optionally
- Whether the path is optional or required- Throws:
java.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)
-
filter
protected java.lang.String filter(java.lang.String text) throws ConfigurationException
Filter a string for system properties.- Parameters:
text
- The text to filter.- Returns:
- The filtered text.
- Throws:
ConfigurationException
- If the property does not exist or if there is a syntax error.
-
canIgnore
private boolean canIgnore(java.lang.String line)
Determine if a line can be ignored because it is a comment or simply blank.- Parameters:
line
- The line to test.- Returns:
true
if the line is ignorable, otherwisefalse
.
-
-