| Constructor and Description |
|---|
XMLParser(Pattern pattern)
Creates a new XMLParser with the given Pattern
|
XMLParser(java.lang.String pattern)
Creates a new XMLParser using the given string as the command pattern.
|
| Modifier and Type | Method and Description |
|---|---|
org.w3c.dom.Document |
getDocument()
Gets the Document object of the parsed xml command
|
java.lang.String[] |
getList(java.lang.String name)
Gets the list of values for the given variable name
|
Pattern |
getPattern()
Gets the pattern for this parser
|
java.lang.String |
getRawText()
Gets the raw XML string for this command
|
java.lang.String |
getType()
Gets the Type of this command, which is also the code for the command.
|
java.lang.String |
getVariable(java.lang.String name)
Gets the variable value for the given variable name
|
java.lang.String |
getVariable(java.lang.String name,
java.lang.String defaultValue)
Gets the variable value for the given variable name, if the value is blank,
it will return the supplied default value.
|
int |
getVariableInt(java.lang.String name,
int defaultValue)
Gets the integer value for the given variable name, if the variable is blank
then default value is returned.
|
long |
getVariableLong(java.lang.String name,
long defaultValue)
Gets the long value for the given variable name, if the variable is blank then
the given default value is returned.
|
boolean |
hasKeyWord(java.lang.String keyword)
Does this command have the given keyword
|
void |
parse(java.lang.String xml)
Parses the given XML string to a Document representing the command.
|
public XMLParser(java.lang.String pattern)
pattern - the command patternpublic XMLParser(Pattern pattern)
pattern - the command Patternpublic void parse(java.lang.String xml)
throws java.lang.Exception
public boolean hasKeyWord(java.lang.String keyword)
throws java.lang.Exception
hasKeyWord in interface Parserkeyword - the keyword to check forjava.lang.Exception - exceptionpublic java.lang.String getType()
public java.lang.String getRawText()
getRawText in interface Parserpublic java.lang.String getVariable(java.lang.String name)
throws java.lang.Exception
getVariable in interface Parsername - the name of the variablejava.lang.Exception - a serious problempublic java.lang.String getVariable(java.lang.String name,
java.lang.String defaultValue)
throws java.lang.Exception
getVariable in interface Parsername - the name of the variabledefaultValue - the default value, returned if the value is blankjava.lang.Exception - a serious problempublic int getVariableInt(java.lang.String name,
int defaultValue)
throws java.lang.Exception
getVariableInt in interface Parsername - the name of the variabledefaultValue - the default value of the variablejava.lang.Exception - a serious problempublic long getVariableLong(java.lang.String name,
long defaultValue)
throws java.lang.Exception
getVariableLong in interface Parsername - the name of the variable to getdefaultValue - the default value for the variablejava.lang.Exception - a serious problem@Nonnull
public java.lang.String[] getList(java.lang.String name)
throws java.lang.Exception
public org.w3c.dom.Document getDocument()
public Pattern getPattern()
stSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.