|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tangosol.util.Base
com.tangosol.run.xml.SimpleParser
public class SimpleParser
This class uses the XmlTokenizer to produce an XmlDocument from XML text.
Field Summary | |
---|---|
protected XmlToken |
m_token
The "current" token being evaluated. |
protected XmlTokenizer |
m_toker
The lexical tokenizer. |
Constructor Summary | |
---|---|
SimpleParser()
Construct an XML SimpleParser. |
Method Summary | |
---|---|
protected XmlToken |
current()
Returns the current token and advances to the next token. |
protected boolean |
hasCurrent()
Determine if there is a current token. |
protected boolean |
hasNext()
Determine if there is a next token. |
protected void |
init()
Internal initialization. |
protected XmlDocument |
instantiateDocument()
Factory method to instantiate an XmlDocument implementation. |
static void |
main(String[] asArgs)
Unit test. |
protected XmlToken |
mark()
Marks the current position and returns it as a token. |
protected XmlToken |
match(int id)
Verifies that the current token matches the passed token id and, if so, advances to the next token. |
protected XmlToken |
match(String sName)
Verifies that the current token is a name token whose name matches the passed String and, if so, advances to the next token. |
protected XmlToken |
next()
Advances to and returns the next token. |
protected void |
parseComment(XmlElement xml)
|
protected void |
parseComment(XmlElement xml,
boolean fIsDocument)
|
protected void |
parseDoctype(XmlDocument xml)
|
protected void |
parseDocument(XmlDocument xml)
Factory method to instantiate an XmlDocument implementation. |
protected void |
parseElement(XmlElement xml)
Note: '<' and element name have already been parsed |
protected void |
parseMisc(XmlElement xml)
|
protected void |
parsePi(XmlElement xml)
|
protected void |
parsePi(XmlElement xml,
boolean fXmlDeclAllowed)
|
XmlDocument |
parseXml(InputStream stream)
Parse the specified InputStream into an XmlDocument object. |
XmlDocument |
parseXml(InputStream stream,
String sCharset)
Parse the specified InputStream into an XmlDocument object using the specified charset. |
XmlDocument |
parseXml(Reader reader)
Parse the specified Reader into an XmlDocument object. |
XmlDocument |
parseXml(String sXml)
Parse the specified String into an XmlDocument object. |
XmlDocument |
parseXml(String sXml,
XmlDocument xml)
Parse the passed script. |
protected void |
parseXmlDecl(XmlDocument xml)
|
protected XmlToken |
peek(int id)
Tests if the current token matches the passed token id and, if so, advances to the next token. |
protected XmlToken |
peek(int cat,
int subcat)
Tests if the current token matches the passed token category and sub-category. |
protected XmlToken |
peek(String sName)
Tests if the current token is a name that matches the passed String and, if so, advances to the next token. |
Field Detail |
---|
protected XmlTokenizer m_toker
protected XmlToken m_token
Constructor Detail |
---|
public SimpleParser()
Method Detail |
---|
protected void init()
public XmlDocument parseXml(String sXml) throws IOException
sXml
- the String to parse
IOException
public XmlDocument parseXml(Reader reader) throws IOException
reader
- the Reader object
IOException
public XmlDocument parseXml(InputStream stream) throws IOException
stream
- the InputStream object
IOException
public XmlDocument parseXml(InputStream stream, String sCharset) throws IOException
stream
- the InputStream objectsCharset
- the charset name
IOException
public XmlDocument parseXml(String sXml, XmlDocument xml) throws IOException
sXml
- the script to parse (as a string)xml
- the XML document object to parse into
IOException
protected XmlDocument instantiateDocument()
public static void main(String[] asArgs)
protected void parseDocument(XmlDocument xml) throws CompilerException
xml
- a blank XmlDocument
CompilerException
protected void parsePi(XmlElement xml) throws CompilerException
CompilerException
protected void parsePi(XmlElement xml, boolean fXmlDeclAllowed) throws CompilerException
CompilerException
protected void parseXmlDecl(XmlDocument xml) throws CompilerException
CompilerException
protected void parseDoctype(XmlDocument xml) throws CompilerException
CompilerException
protected void parseElement(XmlElement xml) throws CompilerException
CompilerException
protected void parseMisc(XmlElement xml) throws CompilerException
CompilerException
protected void parseComment(XmlElement xml) throws CompilerException
CompilerException
protected void parseComment(XmlElement xml, boolean fIsDocument) throws CompilerException
CompilerException
protected boolean hasCurrent()
protected XmlToken current() throws CompilerException
CompilerException
- potentially thrown by the tokenizerprotected boolean hasNext()
protected XmlToken next() throws CompilerException
CompilerException
- potentially thrown by the tokenizerprotected XmlToken match(int id) throws CompilerException
id
- the token id to match
SyntaxException
- thrown if the token does not match
CompilerException
- potentially thrown by the tokenizerprotected XmlToken match(String sName) throws CompilerException
sName
- the name token text to match
SyntaxException
- thrown if the token does not match
CompilerException
- potentially thrown by the tokenizerprotected XmlToken peek(int id) throws CompilerException
id
- the token id to peek for
CompilerException
- potentially thrown by the tokenizerprotected XmlToken peek(int cat, int subcat) throws CompilerException
cat
- the category to peek forsubcat
- the sub-category to peek for
CompilerException
- potentially thrown by the tokenizerprotected XmlToken peek(String sName) throws CompilerException
sName
- the name token text to peek for
CompilerException
- potentially thrown by the tokenizerprotected XmlToken mark()
|
CoherenceTM v3.3 Copyright© 2000-2007 by Oracle Corporation |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |