Quadcap Embeddable Database

com.quadcap.text.sax.Parser Class Reference

Inheritance diagram for com.quadcap.text.sax.Parser:

List of all members.

Detailed Description

SAX Parser implementation.

Author:
Stan Bailes

Definition at line 65 of file Parser.java.

Public Member Functions

 Parser ()
 Parse an XML document.

void parse (String s)
 Parse an XML document from a system identifier (URI).

 Allow an application to register a document event handler.

 Allow an application to register a DTD event handler.

 Allow an application to register a custom entity resolver.

 Allow an application to register an error event handler.

void setLocale (java.util.Locale locale)
int step (int state, int c) throws SAXException, IOException
void parse () throws SAXException, IOException
boolean parseUntilEOF () throws SAXException, IOException
int getLineNumber ()
int getColumnNumber ()

Package Functions

boolean popInputSource ()
final void addTagChar (int c) throws SAXException
final int read () throws IOException
final char parseEntity () throws SAXException, IOException
void startElement (String name, AttributeList attributes) throws SAXException

Package Attributes

boolean docStarted = false
StringPool pool = new NoStringPool()
Reader r
char[] ebuf = new char[6]
char[] tag = new char[1024*32]
int taglen = 0
CharArrayWriter data = new CharArrayWriter()
AttributeList attributes = new AttributeList()
String attrName = null
String tagName = null
ArrayQueue inStack = null
ArrayQueue locStack = null
int lineNumber = 1
int columnNumber = 1
String lastEntityVal = ""
boolean trace = false
int commentLevel = 0


Constructor & Destructor Documentation

com.quadcap.text.sax.Parser.Parser  ) 
 

Definition at line 90 of file Parser.java.


Member Function Documentation

final void com.quadcap.text.sax.Parser.addTagChar int  c  ) 
 

Definition at line 143 of file Parser.java.

References com.quadcap.text.sax.Parser.addTagChar(), com.quadcap.text.sax.Parser.tag, and com.quadcap.text.sax.Parser.taglen.

Referenced by com.quadcap.text.sax.Parser.addTagChar().

final Reader com.quadcap.text.sax.Parser.getCharacterStream in  )  [package]
 

Definition at line 111 of file Parser.java.

References org.xml.sax.InputSource.getByteStream(), org.xml.sax.InputSource.getCharacterStream(), and com.quadcap.text.sax.Parser.getCharacterStream().

Referenced by com.quadcap.text.sax.Parser.getCharacterStream(), and com.quadcap.text.sax.Parser.parse().

int com.quadcap.text.sax.Parser.getColumnNumber  ) 
 

Definition at line 623 of file Parser.java.

References com.quadcap.text.sax.Parser.columnNumber.

Referenced by com.quadcap.text.sax.Locator.getColumnNumber().

 ) 
 

Definition at line 163 of file Parser.java.

References com.quadcap.text.sax.Parser.entityResolver.

int com.quadcap.text.sax.Parser.getLineNumber  ) 
 

Definition at line 619 of file Parser.java.

References com.quadcap.text.sax.Parser.lineNumber.

Referenced by com.quadcap.text.sax.Locator.getLineNumber().

void com.quadcap.text.sax.Parser.parse  ) 
 

Definition at line 596 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.parse().

void com.quadcap.text.sax.Parser.parse String  s  )  [virtual]
 

Parse an XML document from a system identifier (URI).

This method is a shortcut for the common case of reading a document from a system identifier. It is the exact equivalent of the following:

 parse(new InputSource(systemId));
 

If the system identifier is a URL, it must be fully resolved by the application before it is passed to the parser.

Parameters:
systemId The system identifier (URI).
Exceptions:
org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception.
java.io.IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.

Definition at line 148 of file Parser.java.

void com.quadcap.text.sax.Parser.parse in  ) 
 

Parse an XML document.

The application can use this method to instruct the SAX parser to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

Applications may not invoke this method while a parse is in progress (they should create a new Parser instead for each additional XML document). Once a parse is complete, an application may reuse the same Parser object, possibly with a different input source.

Parameters:
source The input source for the top-level of the XML document.
Exceptions:
org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception.
java.io.IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
parse(java.lang.String)

setEntityResolver

setDTDHandler

setDocumentHandler

setErrorHandler

Definition at line 92 of file Parser.java.

References com.quadcap.text.sax.Parser.columnNumber, com.quadcap.text.sax.Parser.data, com.quadcap.text.sax.Parser.getCharacterStream(), com.quadcap.text.sax.Parser.in, com.quadcap.text.sax.Parser.lineNumber, com.quadcap.text.sax.Parser.locStack, com.quadcap.text.sax.Parser.parse(), com.quadcap.util.collections.ArrayQueue.size(), com.quadcap.text.sax.Parser.taglen, and com.quadcap.util.collections.ArrayQueue.top().

Referenced by com.quadcap.text.sax.Handler.parse().

final char com.quadcap.text.sax.Parser.parseEntity  ) 
 

Definition at line 185 of file Parser.java.

References com.quadcap.text.sax.Parser.ebuf, com.quadcap.text.sax.Parser.lastEntityVal, and com.quadcap.text.sax.Parser.read().

Referenced by com.quadcap.text.sax.Parser.step().

boolean com.quadcap.text.sax.Parser.parseUntilEOF  ) 
 

Definition at line 603 of file Parser.java.

References com.quadcap.text.sax.Parser.popInputSource(), com.quadcap.text.sax.Parser.r, and com.quadcap.text.sax.Parser.read().

Referenced by com.quadcap.text.sax.Parser.parse().

boolean com.quadcap.text.sax.Parser.popInputSource  )  [package]
 

Definition at line 132 of file Parser.java.

References com.quadcap.text.sax.Parser.columnNumber, com.quadcap.text.sax.Parser.in, com.quadcap.text.sax.Parser.inStack, com.quadcap.text.sax.Parser.lineNumber, com.quadcap.text.sax.Parser.locStack, com.quadcap.util.collections.ArrayQueue.pop(), com.quadcap.text.sax.Parser.r, and com.quadcap.util.collections.ArrayQueue.size().

Referenced by com.quadcap.text.sax.Parser.parseUntilEOF().

void com.quadcap.text.sax.Parser.pushInputSource in2  ) 
 

Definition at line 119 of file Parser.java.

References com.quadcap.text.sax.Parser.columnNumber, com.quadcap.text.sax.Parser.in, com.quadcap.text.sax.Parser.inStack, com.quadcap.text.sax.Parser.lineNumber, com.quadcap.text.sax.Parser.locStack, com.quadcap.util.collections.ArrayQueue.push(), com.quadcap.text.sax.Parser.pushInputSource(), and com.quadcap.text.sax.Parser.r.

Referenced by com.quadcap.text.sax.Parser.pushInputSource().

final int com.quadcap.text.sax.Parser.read  )  throws IOException [package]
 

Definition at line 174 of file Parser.java.

References com.quadcap.text.sax.Parser.columnNumber, com.quadcap.text.sax.Parser.lineNumber, and com.quadcap.text.sax.Parser.r.

Referenced by com.quadcap.text.sax.Parser.parseEntity(), and com.quadcap.text.sax.Parser.parseUntilEOF().

void com.quadcap.text.sax.Parser.setDocumentHandler dh  )  [virtual]
 

Allow an application to register a document event handler.

If the application does not register a document handler, all document events reported by the SAX parser will be silently ignored (this is the default behaviour implemented by HandlerBase).

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters:
handler The document handler.
See also:
DocumentHandler

HandlerBase

Definition at line 151 of file Parser.java.

References com.quadcap.text.sax.Parser.setDocumentHandler().

Referenced by com.quadcap.text.sax.Handler.Handler(), and com.quadcap.text.sax.Parser.setDocumentHandler().

void com.quadcap.text.sax.Parser.setDTDHandler dh  )  [virtual]
 

Allow an application to register a DTD event handler.

If the application does not register a DTD handler, all DTD events reported by the SAX parser will be silently ignored (this is the default behaviour implemented by HandlerBase).

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters:
handler The DTD handler.
See also:
DTDHandler

HandlerBase

Definition at line 155 of file Parser.java.

References com.quadcap.text.sax.Parser.setDTDHandler().

Referenced by com.quadcap.text.sax.Parser.setDTDHandler().

void com.quadcap.text.sax.Parser.setEntityResolver er  )  [virtual]
 

Allow an application to register a custom entity resolver.

If the application does not register an entity resolver, the SAX parser will resolve system identifiers and open connections to entities itself (this is the default behaviour implemented in HandlerBase).

Applications may register a new or different entity resolver in the middle of a parse, and the SAX parser must begin using the new resolver immediately.

Parameters:
resolver The object for resolving entities.
See also:
EntityResolver

HandlerBase

Definition at line 159 of file Parser.java.

References com.quadcap.text.sax.Parser.setEntityResolver().

Referenced by com.quadcap.text.sax.Parser.setEntityResolver().

void com.quadcap.text.sax.Parser.setErrorHandler er  )  [virtual]
 

Allow an application to register an error event handler.

If the application does not register an error event handler, all error events reported by the SAX parser will be silently ignored, except for fatalError, which will throw a SAXException (this is the default behaviour implemented by HandlerBase).

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.

Parameters:
handler The error handler.
See also:
ErrorHandler

SAXException

HandlerBase

Definition at line 167 of file Parser.java.

References com.quadcap.text.sax.Parser.errorHandler, and com.quadcap.text.sax.Parser.setErrorHandler().

Referenced by com.quadcap.text.sax.Handler.Handler(), and com.quadcap.text.sax.Parser.setErrorHandler().

void com.quadcap.text.sax.Parser.setLocale java.util.Locale  locale  ) 
 

Definition at line 171 of file Parser.java.

References com.quadcap.text.sax.Parser.setLocale().

Referenced by com.quadcap.text.sax.Parser.setLocale().

void com.quadcap.text.sax.Parser.startElement String  name,
AttributeList  attributes
 

Definition at line 627 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.startElement(), and com.quadcap.text.sax.Parser.step().

int com.quadcap.text.sax.Parser.step int  state,
int  c
 

Definition at line 212 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.step().


Member Data Documentation

AttributeList com.quadcap.text.sax.Parser.attributes = new AttributeList() [package]
 

Definition at line 79 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.startElement(), and com.quadcap.text.sax.Parser.step().

String com.quadcap.text.sax.Parser.attrName = null [package]
 

Definition at line 80 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.step().

int com.quadcap.text.sax.Parser.columnNumber = 1 [package]
 

Definition at line 85 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.getColumnNumber(), com.quadcap.text.sax.Parser.parse(), com.quadcap.text.sax.Parser.popInputSource(), com.quadcap.text.sax.Parser.pushInputSource(), and com.quadcap.text.sax.Parser.read().

int com.quadcap.text.sax.Parser.commentLevel = 0 [package]
 

Definition at line 88 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.step().

CharArrayWriter com.quadcap.text.sax.Parser.data = new CharArrayWriter() [package]
 

Definition at line 78 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.parse(), and com.quadcap.text.sax.Parser.step().

 

Definition at line 67 of file Parser.java.

 

Definition at line 71 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.parse(), com.quadcap.text.sax.Parser.startElement(), and com.quadcap.text.sax.Parser.step().

boolean com.quadcap.text.sax.Parser.docStarted = false [package]
 

Definition at line 66 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.startElement(), and com.quadcap.text.sax.Parser.step().

 

Definition at line 72 of file Parser.java.

char [] com.quadcap.text.sax.Parser.ebuf = new char[6] [package]
 

Definition at line 75 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.parseEntity().

 

Definition at line 73 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.getEntityResolver().

 

Definition at line 74 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.setErrorHandler().

 

Definition at line 69 of file Parser.java.

Referenced by com.quadcap.text.sax.Locator.getPublicId(), com.quadcap.text.sax.Locator.getSystemId(), com.quadcap.text.sax.Parser.parse(), com.quadcap.text.sax.Parser.popInputSource(), and com.quadcap.text.sax.Parser.pushInputSource().

ArrayQueue com.quadcap.text.sax.Parser.inStack = null [package]
 

Definition at line 82 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.popInputSource(), com.quadcap.text.sax.Parser.pushInputSource(), and com.quadcap.text.sax.Parser.step().

String com.quadcap.text.sax.Parser.lastEntityVal = "" [package]
 

Definition at line 86 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.parseEntity(), and com.quadcap.text.sax.Parser.step().

int com.quadcap.text.sax.Parser.lineNumber = 1 [package]
 

Definition at line 84 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.getLineNumber(), com.quadcap.text.sax.Parser.parse(), com.quadcap.text.sax.Parser.popInputSource(), com.quadcap.text.sax.Parser.pushInputSource(), and com.quadcap.text.sax.Parser.read().

ArrayQueue com.quadcap.text.sax.Parser.locStack = null [package]
 

Definition at line 83 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.parse(), com.quadcap.text.sax.Parser.popInputSource(), and com.quadcap.text.sax.Parser.pushInputSource().

StringPool com.quadcap.text.sax.Parser.pool = new NoStringPool() [package]
 

Definition at line 68 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.step().

Reader com.quadcap.text.sax.Parser.r [package]
 

Definition at line 70 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.parseUntilEOF(), com.quadcap.text.sax.Parser.popInputSource(), com.quadcap.text.sax.Parser.pushInputSource(), and com.quadcap.text.sax.Parser.read().

char [] com.quadcap.text.sax.Parser.tag = new char[1024*32] [package]
 

Definition at line 76 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.addTagChar(), and com.quadcap.text.sax.Parser.step().

int com.quadcap.text.sax.Parser.taglen = 0 [package]
 

Definition at line 77 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.addTagChar(), com.quadcap.text.sax.Parser.parse(), and com.quadcap.text.sax.Parser.step().

String com.quadcap.text.sax.Parser.tagName = null [package]
 

Definition at line 81 of file Parser.java.

Referenced by com.quadcap.text.sax.Parser.startElement(), and com.quadcap.text.sax.Parser.step().

boolean com.quadcap.text.sax.Parser.trace = false [package]
 

Definition at line 87 of file Parser.java.