org.apache.xml.serializer

Class ToSAXHandler

public abstract class ToSAXHandler extends SerializerBase

This class is used to provide a base behavior to be inherited by other To...SAXHandler serializers. This class is not a public API.

UNKNOWN: internal

Constructor Summary
ToSAXHandler()
ToSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding)
ToSAXHandler(ContentHandler handler, String encoding)
Method Summary
voidaddUniqueAttribute(String qName, String value, int flags)
Add a unique attribute
voidcharacters(String characters)
Receive notification of character data.
voidcharacters(Node node)
This method gets the node's value as a String and uses that String as if it were an input character notification.
voidcomment(String comment)
Receive notification of a comment.
voiderror(SAXParseException exc)
voidfatalError(SAXParseException exc)
voidflushPending()
This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section.
voidprocessingInstruction(String target, String data)
Do nothing as this is an abstract class.
booleanreset()
Try's to reset the super class and reset this class for re-use, so that you don't need to create a new serializer (mostly for performance reasons).
voidsetCdataSectionElements(Vector URI_and_localNames)
Does nothing.
voidsetContentHandler(ContentHandler _saxHandler)
Sets the SAX ContentHandler.
voidsetLexHandler(LexicalHandler _lexHandler)
Sets the LexicalHandler.
voidsetShouldOutputNSAttr(boolean doOutputNSAttr)
Set whether or not namespace declarations (e.g. xmlns:foo) should appear as attributes of elements
voidsetTransformState(TransformStateSetter ts)
Pass in a reference to a TransformState object, which can be used during SAX ContentHandler events to obtain information about he state of the transformation.
voidstartDTD(String arg0, String arg1, String arg2)
Do nothing.
voidstartElement(String arg0, String arg1, String arg2, Attributes arg3)
Receive notification of the beginning of an element, although this is a SAX method additional namespace or attribute information can occur before or after this call, that is associated with this element.
voidstartElement(String uri, String localName, String qName)
Receives notification that an element starts, but attributes are not fully known yet.
voidstartElement(String qName)
An element starts, but attributes are not fully known yet.
voidwarning(SAXParseException exc)

Constructor Detail

ToSAXHandler

public ToSAXHandler()

ToSAXHandler

public ToSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding)

ToSAXHandler

public ToSAXHandler(ContentHandler handler, String encoding)

Method Detail

addUniqueAttribute

public void addUniqueAttribute(String qName, String value, int flags)
Add a unique attribute

characters

public void characters(String characters)
Receive notification of character data.

Parameters: characters The string of characters to process.

Throws: org.xml.sax.SAXException

See Also: characters

characters

public void characters(Node node)
This method gets the node's value as a String and uses that String as if it were an input character notification.

Parameters: node the Node to serialize

Throws: org.xml.sax.SAXException

comment

public void comment(String comment)
Receive notification of a comment.

See Also: comment

error

public void error(SAXParseException exc)

See Also: org.xml.sax.ErrorHandler#error(SAXParseException)

fatalError

public void fatalError(SAXParseException exc)

See Also: org.xml.sax.ErrorHandler#fatalError(SAXParseException)

flushPending

public void flushPending()
This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section.

processingInstruction

public void processingInstruction(String target, String data)
Do nothing as this is an abstract class. All subclasses will need to define their behavior if it is different.

See Also: org.xml.sax.ContentHandler#processingInstruction(String, String)

reset

public boolean reset()
Try's to reset the super class and reset this class for re-use, so that you don't need to create a new serializer (mostly for performance reasons).

Returns: true if the class was successfuly reset.

See Also: reset

setCdataSectionElements

public void setCdataSectionElements(Vector URI_and_localNames)
Does nothing. The setting of CDATA section elements has an impact on stream serializers.

See Also: SerializationHandler

setContentHandler

public void setContentHandler(ContentHandler _saxHandler)
Sets the SAX ContentHandler.

Parameters: _saxHandler The ContentHandler to set

setLexHandler

public void setLexHandler(LexicalHandler _lexHandler)
Sets the LexicalHandler.

Parameters: _lexHandler The LexicalHandler to set

setShouldOutputNSAttr

public void setShouldOutputNSAttr(boolean doOutputNSAttr)
Set whether or not namespace declarations (e.g. xmlns:foo) should appear as attributes of elements

Parameters: doOutputNSAttr whether or not namespace declarations should appear as attributes

setTransformState

public void setTransformState(TransformStateSetter ts)
Pass in a reference to a TransformState object, which can be used during SAX ContentHandler events to obtain information about he state of the transformation. This method will be called before each startDocument event.

Parameters: ts A reference to a TransformState object

startDTD

public void startDTD(String arg0, String arg1, String arg2)
Do nothing.

See Also: org.xml.sax.ext.LexicalHandler#startDTD(String, String, String)

startElement

public void startElement(String arg0, String arg1, String arg2, Attributes arg3)
Receive notification of the beginning of an element, although this is a SAX method additional namespace or attribute information can occur before or after this call, that is associated with this element.

Throws: org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception. org.xml.sax.SAXException

See Also: org.xml.sax.ContentHandler#startElement org.xml.sax.ContentHandler#endElement org.xml.sax.AttributeList org.xml.sax.ContentHandler#startElement(String,String,String,Attributes)

startElement

public void startElement(String uri, String localName, String qName)
Receives notification that an element starts, but attributes are not fully known yet.

Parameters: uri the URI of the namespace of the element (optional) localName the element name, but without prefix (optional) qName the element name, with prefix, if any (required)

See Also: ExtendedContentHandler

startElement

public void startElement(String qName)
An element starts, but attributes are not fully known yet.

Parameters: qName the element name, with prefix (if any).

See Also: startElement

warning

public void warning(SAXParseException exc)

See Also: org.xml.sax.ErrorHandler#warning(SAXParseException)

Copyright B) 2006 Apache XML Project. All Rights Reserved.