Class ConfigurationParser
- java.lang.Object
-
- org.codehaus.plexus.classworlds.launcher.ConfigurationParser
-
public class ConfigurationParser extends java.lang.ObjectEvent based launcher configuration parser, delegating effective configuration handling to ConfigurationHandler.- See Also:
ConfigurationHandler
-
-
Field Summary
Fields Modifier and Type Field Description private ConfigurationHandlerhandlerstatic java.lang.StringIMPORT_PREFIXstatic java.lang.StringLOAD_PREFIXstatic java.lang.StringMAIN_PREFIXstatic java.lang.StringOPTIONALLY_PREFIXOptionally spec prefix.static java.lang.StringSET_PREFIXprivate java.util.PropertiessystemProperties
-
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 booleancanIgnore(java.lang.String line)Determine if a line can be ignored because it is a comment or simply blank.protected java.lang.Stringfilter(java.lang.String text)Filter a string for system properties.protected voidloadGlob(java.lang.String line, boolean optionally)Load a glob into the specified classloader.voidparse(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, NoSuchRealmExceptionParse 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, ConfigurationExceptionLoad 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 ConfigurationExceptionFilter 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:
trueif the line is ignorable, otherwisefalse.
-
-