public class Dsmlv2Parser
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private Dsmlv2Container |
container
The associated DSMLv2 container
|
private Dsmlv2Grammar |
grammar
The thread safe DSMLv2 Grammar
|
private boolean |
storeMsgInBatchReq
flag to indicate if the batch request should maintain a list of all the
operation request objects present in the DSML document.
|
| Constructor and Description |
|---|
Dsmlv2Parser()
Creates a new instance of Dsmlv2Parser.
|
Dsmlv2Parser(boolean storeMsgInBatchReq)
Creates a new instance of Dsmlv2Parser.
|
Dsmlv2Parser(Dsmlv2Grammar grammar)
Creates a new instance of Dsmlv2Parser.
|
| Modifier and Type | Method and Description |
|---|---|
BatchRequestDsml |
getBatchRequest()
Gets the Batch Request or null if the it has not been parsed yet
|
DsmlDecorator<? extends Request> |
getNextRequest()
Gets the next Request or null if there's no more request
|
void |
parse()
Launches the parsing on the input
This method will parse the whole DSML document, without considering the flag
storeMsgInBatchReq |
void |
parseAllRequests()
Parses all the requests
|
void |
parseBatchRequest()
Launches the parsing of the Batch Request only
|
private static void |
processTag(Dsmlv2Container container,
int tagType)
Processes the task required in the grammar to the given tag type
|
void |
setInput(java.io.InputStream inputStream,
java.lang.String inputEncoding)
Sets the input stream the parser is going to process
|
void |
setInput(java.lang.String str)
Sets the input string the parser is going to parse
|
void |
setInputFile(java.lang.String fileName)
Sets the input file the parser is going to parse.
|
private Dsmlv2Container container
private boolean storeMsgInBatchReq
private Dsmlv2Grammar grammar
public Dsmlv2Parser()
throws org.xmlpull.v1.XmlPullParserException
org.xmlpull.v1.XmlPullParserException - if an error occurs during the initialization of the parserpublic Dsmlv2Parser(boolean storeMsgInBatchReq)
throws org.xmlpull.v1.XmlPullParserException
storeMsgInBatchReq - flag to set if the parsed requests should b storedorg.xmlpull.v1.XmlPullParserException - if an error occurs during the initialization of the parserpublic Dsmlv2Parser(Dsmlv2Grammar grammar) throws org.xmlpull.v1.XmlPullParserException
org.xmlpull.v1.XmlPullParserException - if an error occurs during the initialization of the parserpublic void setInputFile(java.lang.String fileName)
throws java.io.FileNotFoundException,
org.xmlpull.v1.XmlPullParserException
fileName - the name of the filejava.io.FileNotFoundException - if the file does not existorg.xmlpull.v1.XmlPullParserException - if an error occurs in the parserpublic void setInput(java.io.InputStream inputStream,
java.lang.String inputEncoding)
throws org.xmlpull.v1.XmlPullParserException
inputStream - contains a raw byte input stream of possibly unknown encoding (when inputEncoding is null)inputEncoding - if not null it MUST be used as encoding for inputStreamorg.xmlpull.v1.XmlPullParserException - if an error occurs in the parserpublic void setInput(java.lang.String str)
throws org.xmlpull.v1.XmlPullParserException
str - the string the parser is going to parseorg.xmlpull.v1.XmlPullParserException - if an error occurs in the parserpublic void parse()
throws org.xmlpull.v1.XmlPullParserException,
java.io.IOException
storeMsgInBatchReqorg.xmlpull.v1.XmlPullParserException - when an unrecoverable error occursjava.io.IOException - when an IO execption occurspublic void parseBatchRequest()
throws org.xmlpull.v1.XmlPullParserException
org.xmlpull.v1.XmlPullParserException - if an error occurs in the parserprivate static void processTag(Dsmlv2Container container, int tagType) throws org.xmlpull.v1.XmlPullParserException
container - the DSML containertagType - the tag typeorg.xmlpull.v1.XmlPullParserException - when an error occurs during the parsingpublic BatchRequestDsml getBatchRequest()
public DsmlDecorator<? extends Request> getNextRequest() throws org.xmlpull.v1.XmlPullParserException
org.xmlpull.v1.XmlPullParserException - when an error occurs during the parsingpublic void parseAllRequests()
throws org.xmlpull.v1.XmlPullParserException
org.xmlpull.v1.XmlPullParserException - when an error occurs during the parsing