public final class Parser
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
MALFORMED_PARSER_CLASS |
static java.lang.String |
NORMAL_PARSER_CLASS |
Constructor and Description |
---|
Parser(JNLPFile file,
java.net.URL base,
Node root,
ParserSettings settings)
Create a parser for the JNLP file.
|
Parser(JNLPFile file,
java.net.URL base,
Node root,
ParserSettings settings,
java.net.URL codebase)
Create a parser for the JNLP file.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addInfo(InformationDesc info,
Node node,
java.lang.String mod,
java.lang.Object value)
Adds a key,value pair to the information object.
|
java.net.URL |
getCodeBase() |
java.net.URL |
getFileLocation()
Returns the file location.
|
Version |
getFileVersion()
Returns the file version.
|
java.util.List<InformationDesc> |
getInfo(Node parent) |
LaunchDesc |
getLauncher(Node parent) |
java.util.Locale |
getLocale(java.lang.String localeStr)
Returns a
Locale from a single locale. |
static java.lang.Object |
getParserInstance(ParserSettings settings) |
java.util.List<ResourcesDesc> |
getResources(Node parent,
boolean j2se) |
static Node |
getRootNode(java.io.InputStream input,
ParserSettings settings) |
SecurityDesc |
getSecurity(Node parent) |
Version |
getSpecVersion() |
java.net.URL |
getURL(Node node,
java.lang.String name,
java.net.URL base) |
static java.net.URL |
getURL(java.lang.String href,
java.lang.String nodeName,
java.net.URL base,
boolean strict) |
public static final java.lang.String MALFORMED_PARSER_CLASS
public static final java.lang.String NORMAL_PARSER_CLASS
public Parser(JNLPFile file, java.net.URL base, Node root, ParserSettings settings) throws ParseException
The root node may be normalized as a side effect of this constructor.
file
- the (uninitialized) file referencebase
- if codebase is not specified, a default base for relative
URLsroot
- the root nodesettings
- the parser settings to use when parsing the JNLP fileParseException
- if the JNLP file is invalidpublic Parser(JNLPFile file, java.net.URL base, Node root, ParserSettings settings, java.net.URL codebase) throws ParseException
The root node may be normalized as a side effect of this constructor.
file
- the (uninitialized) file referencebase
- if codebase is not specified, a default base for relative
URLsroot
- the root nodesettings
- the parser settings to use when parsing the JNLP filecodebase
- codebase to use if we did not parse one from JNLP file.ParseException
- if the JNLP file is invalidpublic Version getFileVersion()
public java.net.URL getFileLocation()
public java.net.URL getCodeBase()
public Version getSpecVersion()
public java.util.List<ResourcesDesc> getResources(Node parent, boolean j2se) throws ParseException
parent
- the parent node (either jnlp or j2se)j2se
- true if the resources are located under a j2se or java nodeParseException
- if the JNLP file is invalidpublic java.util.List<InformationDesc> getInfo(Node parent) throws ParseException
parent
- the parent node (jnlp)ParseException
- if the JNLP file is invalidprotected void addInfo(InformationDesc info, Node node, java.lang.String mod, java.lang.Object value)
info
- the information objectnode
- node name to be used as the keymod
- key name appended with "-"+mod if not nullvalue
- the info object to add (icon or string)public SecurityDesc getSecurity(Node parent) throws ParseException
parent
- the parent nodeParseException
- if the JNLP file is invalidpublic LaunchDesc getLauncher(Node parent) throws ParseException
parent
- the parent nodeParseException
- if the JNLP file is invalidpublic java.util.Locale getLocale(java.lang.String localeStr)
Locale
from a single locale.localeStr
- the locale stringpublic java.net.URL getURL(Node node, java.lang.String name, java.net.URL base) throws ParseException
node
- the nodename
- the attribute containing an hrefbase
- the base URLParseException
- if the JNLP file is invalidpublic static java.net.URL getURL(java.lang.String href, java.lang.String nodeName, java.net.URL base, boolean strict) throws ParseException
ParseException
public static Node getRootNode(java.io.InputStream input, ParserSettings settings) throws ParseException
ParseException
- if the JNLP file is invalidpublic static java.lang.Object getParserInstance(ParserSettings settings) throws java.lang.ClassNotFoundException, java.lang.IllegalAccessException, java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException
java.lang.InstantiationException