Modifier and Type | Class and Description |
---|---|
private static class | SAX2StAXBaseWriter.
|
Modifier and Type | Field and Description |
---|---|
protected StringBuffer | |
protected Locator | |
pack-priv String | |
protected boolean | |
protected List | |
protected XMLReporter | |
pack-priv String |
Access | Constructor and Description |
---|---|
public | |
public |
Modifier and Type | Method and Description |
---|---|
public void | characters(char[]
The characters. ch, int The start position in the character array. start, int The number of characters to use from the
character array. length)Overrides org. Implements org. Receive notification of character data inside an element. |
public void | comment(char[]
An array holding the characters in the comment. ch, int The starting position in the array. start, int The number of characters to use from the array. length)Implements org. Report an XML comment anywhere in the document. |
public void | |
public void | endDocument()
Overrides org. Implements org. Receive notification of the end of the document. |
public void | |
public void | endElement(String
The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed. uri, String The local name (without prefix), or the
empty string if Namespace processing is not being
performed. localName, String The qualified name (with prefix), or the
empty string if qualified names are not available. qName)Overrides org. Implements org. Receive notification of the end of an element. |
public void | endEntity(String
The name of the entity that is ending. name)Implements org. Report the end of an entity. |
public void | endPrefixMapping(String
The Namespace prefix being declared. prefix)Overrides org. Implements org. Receive notification of the end of a Namespace mapping. |
public void | error(SAXParseException
The error information encoded as an exception. e)Overrides org. Implements org. Receive notification of a recoverable parser error. |
public void | fatalError(SAXParseException
The error information encoded as an exception. e)Overrides org. Implements org. Report a fatal XML parsing error. |
public Location | |
public static final void | parseQName(String
The qualified name to parse. qName, String[] An array where parse results will be placed. The prefix
will be placed at results)results[0] , and the local
part at results[1] Parses an XML qualified name, and places the resulting prefix and local name in the provided String array. |
protected void | reportException(String type, SAXException e)
Used to report a |
public void | setDocumentLocator(Locator
A locator for all SAX document events. locator)Overrides org. Implements org. Receive a Locator object for document events. |
public void | |
public void | |
public void | |
public void | startCDATA()
Implements org. Report the start of a CDATA section. |
public void | startDocument()
Overrides org. Implements org. Receive notification of the beginning of the document. |
public void | startDTD(String
The document type name. name, String The declared public identifier for the
external DTD subset, or null if none was declared. publicId, String The declared system identifier for the
external DTD subset, or null if none was declared.
(Note that this is not resolved against the document
base URI.) systemId)Implements org. Report the start of DTD declarations, if any. |
public void | startElement(String
The Namespace URI, or the empty string if the
element has no Namespace URI or if Namespace
processing is not being performed. uri, String The local name (without prefix), or the
empty string if Namespace processing is not being
performed. localName, String The qualified name (with prefix), or the
empty string if qualified names are not available. qName, Attributes The attributes attached to the element. If
there are no attributes, it shall be an empty
Attributes object. attributes)Overrides org. Implements org. Receive notification of the start of an element. |
public void | startEntity(String
The name of the entity. If it is a parameter
entity, the name will begin with '%', and if it is the
external DTD subset, it will be "[dtd]". name)Implements org. Report the beginning of some internal and external XML entities. |
public void | startPrefixMapping(String
The Namespace prefix being declared. prefix, String The Namespace URI mapped to the prefix. uri)Overrides org. Implements org. Receive notification of the start of a Namespace mapping. |
private void | |
public void | warning(SAXParseException
The warning information encoded as an exception. e)Overrides org. Implements org. Receive notification of a parser warning. |
pack-priv void |
CDATABuffer | back to summary |
---|---|
protected StringBuffer CDATABuffer |
docLocator | back to summary |
---|---|
protected Locator docLocator |
encoding | back to summary |
---|---|
pack-priv String encoding |
isCDATA | back to summary |
---|---|
protected boolean isCDATA |
namespaces | back to summary |
---|---|
protected List<String> namespaces |
reporter | back to summary |
---|---|
protected XMLReporter reporter |
xmlVersion | back to summary |
---|---|
pack-priv String xmlVersion |
SAX2StAXBaseWriter | back to summary |
---|---|
public SAX2StAXBaseWriter() |
SAX2StAXBaseWriter | back to summary |
---|---|
public SAX2StAXBaseWriter(XMLReporter reporter) |
characters | back to summary |
---|---|
public void characters(char[] ch, int start, int length) throws SAXException Overrides org. Implements org. Doc from org. Receive notification of character data inside an element. By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).
|
comment | back to summary |
---|---|
public void comment(char[] ch, int start, int length) throws SAXException Implements org. Doc from org. Report an XML comment anywhere in the document. This callback will be used for comments inside or outside the document element, including comments in the external DTD subset (if read). Comments in the DTD must be properly nested inside start/endDTD and start/endEntity events (if used).
|
endCDATA | back to summary |
---|---|
public void endCDATA() throws SAXException Implements org. Doc from org. Report the end of a CDATA section.
|
endDocument | back to summary |
---|---|
public void endDocument() throws SAXException Overrides org. Implements org. Doc from org. Receive notification of the end of the document. By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of a document (such as finalising a tree or closing an output file).
|
endDTD | back to summary |
---|---|
public void endDTD() throws SAXException Implements org. Doc from org. Report the end of DTD declarations. This method is intended to report the end of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked.
|
endElement | back to summary |
---|---|
public void endElement(String uri, String localName, String qName) throws SAXException Overrides org. Implements org. Doc from org. Receive notification of the end of an element. By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).
|
endEntity | back to summary |
---|---|
public void endEntity(String name) throws SAXException Implements org. Doc from org. Report the end of an entity.
|
endPrefixMapping | back to summary |
---|---|
public void endPrefixMapping(String prefix) throws SAXException Overrides org. Implements org. Doc from org. Receive notification of the end of a Namespace mapping. By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each prefix mapping.
|
error | back to summary |
---|---|
public void error(SAXParseException e) throws SAXException Overrides org. Implements org. Doc from org. Receive notification of a recoverable parser error. The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.
|
fatalError | back to summary |
---|---|
public void fatalError(SAXParseException e) throws SAXException Overrides org. Implements org. Doc from org. Report a fatal XML parsing error. The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.
|
getCurrentLocation | back to summary |
---|---|
public Location getCurrentLocation() |
parseQName | back to summary |
---|---|
public static final void parseQName(String qName, String[] results) Parses an XML qualified name, and places the resulting prefix and local name in the provided String array. |
reportException | back to summary |
---|---|
protected void reportException(String type, SAXException e) throws SAXException Used to report a |
setDocumentLocator | back to summary |
---|---|
public void setDocumentLocator(Locator locator) Overrides org. Implements org. Doc from org. Receive a Locator object for document events. By default, do nothing. Application writers may override this method in a subclass if they wish to store the locator for use with other document events.
|
setEncoding | back to summary |
---|---|
public void setEncoding(String encoding) |
setXMLReporter | back to summary |
---|---|
public void setXMLReporter(XMLReporter reporter) |
setXmlVersion | back to summary |
---|---|
public void setXmlVersion(String version) |
startCDATA | back to summary |
---|---|
public void startCDATA() throws SAXException Implements org. Doc from org. Report the start of a CDATA section. The contents of the CDATA section will be reported through
the regular
|
startDocument | back to summary |
---|---|
public void startDocument() throws SAXException Overrides org. Implements org. Doc from org. Receive notification of the beginning of the document. By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).
|
startDTD | back to summary |
---|---|
public void startDTD(String name, String publicId, String systemId) throws SAXException Implements org. Doc from org. Report the start of DTD declarations, if any. This method is intended to report the beginning of the DOCTYPE declaration; if the document has no DOCTYPE declaration, this method will not be invoked. All declarations reported through
Note that the start/endDTD events will appear within
the start/endDocument events from ContentHandler and
before the first
|
startElement | back to summary |
---|---|
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException Overrides org. Implements org. Doc from org. Receive notification of the start of an element. By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).
|
startEntity | back to summary |
---|---|
public void startEntity(String name) throws SAXException Implements org. Doc from org. Report the beginning of some internal and external XML entities. The reporting of parameter entities (including
the external DTD subset) is optional, and SAX2 drivers that
report LexicalHandler events may not implement it; you can use the
General entities are reported with their regular names, parameter entities have '%' prepended to their names, and the external DTD subset has the pseudo-entity name "[dtd]". When a SAX2 driver is providing these events, all other
events must be properly nested within start/end entity
events. There is no additional requirement that events from
Note that skipped entities will be reported through the
Because of the streaming event model that SAX uses, some entity boundaries cannot be reported under any circumstances:
These will be silently expanded, with no indication of where the original entity boundaries were. Note also that the boundaries of character references (which are not really entities anyway) are not reported. All start/endEntity events must be properly nested.
|
startPrefixMapping | back to summary |
---|---|
public void startPrefixMapping(String prefix, String uri) throws SAXException Overrides org. Implements org. Doc from org. Receive notification of the start of a Namespace mapping. By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each Namespace prefix scope (such as storing the prefix mapping).
|
updateVersionAndEncoding | back to summary |
---|---|
private void updateVersionAndEncoding() |
warning | back to summary |
---|---|
public void warning(SAXParseException e) throws SAXException Overrides org. Implements org. Doc from org. Receive notification of a parser warning. The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.
|
writeStartDocument | back to summary |
---|---|
pack-priv void writeStartDocument() throws SAXException |
Modifier and Type | Field and Description |
---|---|
private int | |
private int | |
private String | |
private String |
Access | Constructor and Description |
---|---|
private |
Modifier and Type | Method and Description |
---|---|
public int | getCharacterOffset()
Implements javax. Return the byte or character offset into the input source this location is pointing to. |
public int | getColumnNumber()
Implements javax. Return the column number where the current event ends, returns -1 if none is available. |
public int | getLineNumber()
Implements javax. Return the line number where the current event ends, returns -1 if none is available. |
public String | |
public String |
columnNumber | back to summary |
---|---|
private int columnNumber |
lineNumber | back to summary |
---|---|
private int lineNumber |
publicId | back to summary |
---|---|
private String publicId |
systemId | back to summary |
---|---|
private String systemId |
SAXLocation | back to summary |
---|---|
private SAXLocation(Locator locator) |
getCharacterOffset | back to summary |
---|---|
public int getCharacterOffset() Implements javax. Doc from javax. Return the byte or character offset into the input source this location is pointing to. If the input source is a file or a byte stream then this is the byte offset into that stream, but if the input source is a character media then the offset is the character offset. Returns -1 if there is no offset available.
|
getColumnNumber | back to summary |
---|---|
public int getColumnNumber() Implements javax. Doc from javax. Return the column number where the current event ends, returns -1 if none is available.
|
getLineNumber | back to summary |
---|---|
public int getLineNumber() Implements javax. Doc from javax. Return the line number where the current event ends, returns -1 if none is available.
|
getPublicId | back to summary |
---|---|
public String getPublicId() Implements javax. Doc from javax. Returns the public ID of the XML
|
getSystemId | back to summary |
---|---|
public String getSystemId() Implements javax. Doc from javax. Returns the system ID of the XML
|