Top Fields Constructors Methods
com.sun.org.apache.xalan.internal.xsltc.trax

public Class SAX2StAXStreamWriter

extends SAX2StAXBaseWriter
Class Inheritance
Imports
javax.xml.stream.XMLStreamException, .XMLStreamWriter, org.xml.sax.Attributes, .SAXException, org.xml.sax.ext.Locator2

Author
Sunitha Reddy

Field Summary

Modifier and TypeField and Description
private boolean
private XMLStreamWriter
Inherited from com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter:
CDATABufferdocLocatorencodingisCDATAnamespacesreporterxmlVersion

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod 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 com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.characters.

Implements org.xml.sax.ContentHandler.characters.

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
)

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.comment.

Implements org.xml.sax.ext.LexicalHandler.comment.

Report an XML comment anywhere in the document.

public void
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 com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.

public XMLStreamWriter
public void
ignorableWhitespace(char[]
The whitespace 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.xml.sax.helpers.DefaultHandler.ignorableWhitespace.

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Receive notification of ignorable whitespace in element content.

public void
processingInstruction(String
The processing instruction target.
target
,
String
The processing instruction data, or null if none is supplied.
data
)

Overrides org.xml.sax.helpers.DefaultHandler.processingInstruction.

Implements org.xml.sax.ContentHandler.processingInstruction.

Receive notification of a processing instruction.

public void
public void
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 com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the start of an element.

pack-priv void
Inherited from com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter:
endDTDendEntityendPrefixMappingerrorfatalErrorgetCurrentLocationparseQNamereportExceptionsetDocumentLocatorsetEncodingsetXMLReportersetXmlVersionstartCDATAstartDTDstartEntitystartPrefixMappingwarning

Field Detail

needToCallStartDocumentback to summary
private boolean needToCallStartDocument
writerback to summary
private XMLStreamWriter writer

Constructor Detail

SAX2StAXStreamWriterback to summary
public SAX2StAXStreamWriter()
SAX2StAXStreamWriterback to summary
public SAX2StAXStreamWriter(XMLStreamWriter writer)

Method Detail

charactersback to summary
public void characters(char[] ch, int start, int length) throws SAXException

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.characters.

Implements org.xml.sax.ContentHandler.characters.

Doc from org.xml.sax.helpers.DefaultHandler.characters.

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).

Parameters
ch:char[]

The characters.

start:int

The start position in the character array.

length:int

The number of characters to use from the character array.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
commentback to summary
public void comment(char[] ch, int start, int length) throws SAXException

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.comment.

Implements org.xml.sax.ext.LexicalHandler.comment.

Doc from org.xml.sax.ext.LexicalHandler.comment.

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).

Parameters
ch:char[]

An array holding the characters in the comment.

start:int

The starting position in the array.

length:int

The number of characters to use from the array.

Exceptions
SAXException:
The application may raise an exception.
endCDATAback to summary
public void endCDATA() throws SAXException

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.endCDATA.

Implements org.xml.sax.ext.LexicalHandler.endCDATA.

Doc from org.xml.sax.ext.LexicalHandler.endCDATA.

Report the end of a CDATA section.

Exceptions
SAXException:
The application may raise an exception.
endDocumentback to summary
public void endDocument() throws SAXException

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.endDocument.

Implements org.xml.sax.ContentHandler.endDocument.

Doc from org.xml.sax.helpers.DefaultHandler.endDocument.

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).

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
endElementback to summary
public void endElement(String uri, String localName, String qName) throws SAXException

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Doc from org.xml.sax.helpers.DefaultHandler.endElement.

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).

Parameters
uri:String

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName:String

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName:String

The qualified name (with prefix), or the empty string if qualified names are not available.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
getStreamWriterback to summary
public XMLStreamWriter getStreamWriter()
ignorableWhitespaceback to summary
public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.ignorableWhitespace.

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Doc from org.xml.sax.helpers.DefaultHandler.ignorableWhitespace.

Receive notification of ignorable whitespace in element content.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of ignorable whitespace (such as adding data to a node or buffer, or printing it to a file).

Parameters
ch:char[]

The whitespace characters.

start:int

The start position in the character array.

length:int

The number of characters to use from the character array.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
processingInstructionback to summary
public void processingInstruction(String target, String data) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.processingInstruction.

Implements org.xml.sax.ContentHandler.processingInstruction.

Doc from org.xml.sax.helpers.DefaultHandler.processingInstruction.

Receive notification of a processing instruction.

By default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.

Parameters
target:String

The processing instruction target.

data:String

The processing instruction data, or null if none is supplied.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
setStreamWriterback to summary
public void setStreamWriter(XMLStreamWriter writer)
startDocumentback to summary
public void startDocument() throws SAXException

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Doc from org.xml.sax.helpers.DefaultHandler.startDocument.

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).

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
startElementback to summary
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from org.xml.sax.helpers.DefaultHandler.startElement.

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).

Parameters
uri:String

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName:String

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName:String

The qualified name (with prefix), or the empty string if qualified names are not available.

attributes:Attributes

The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
writeStartDocumentback to summary
pack-priv void writeStartDocument() throws SAXException

Overrides com.sun.org.apache.xalan.internal.xsltc.trax.SAX2StAXBaseWriter.writeStartDocument.