Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
org.apache.xml.serializer.SerializerBase
org.apache.xml.serializer.ToSAXHandler
public abstract class ToSAXHandler
extends SerializerBase
Fields inherited from interface org.apache.xml.serializer.ExtendedContentHandler | |
HTML_ATTREMPTY , HTML_ATTRURL , NO_BAD_CHARS |
Fields inherited from interface org.apache.xml.serializer.SerializerConstants | |
CDATA_CONTINUE , CDATA_DELIMITER_CLOSE , CDATA_DELIMITER_OPEN , DEFAULT_SAX_SERIALIZER , EMPTYSTRING , ENTITY_AMP , ENTITY_CRLF , ENTITY_GT , ENTITY_LT , ENTITY_QUOT , XMLNS_PREFIX , XMLNS_URI , XMLVERSION10 , XMLVERSION11 , XML_PREFIX |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
public ToSAXHandler()
public ToSAXHandler(ContentHandler hdlr, LexicalHandler lex, String encoding)
public ToSAXHandler(ContentHandler handler, String encoding)
public void addUniqueAttribute(String qName, String value, int flags) throws SAXException
Add a unique attribute
- Specified by:
- addUniqueAttribute in interface org.apache.xml.serializer.ExtendedContentHandler
public void characters(String characters) throws SAXException
Receive notification of character data.
- Specified by:
- characters in interface org.apache.xml.serializer.ExtendedContentHandler
- Parameters:
characters
- The string of characters to process.
- See Also:
ExtendedContentHandler.characters(String)
public void characters(org.w3c.dom.Node node) throws org.xml.sax.SAXException
This method gets the node's value as a String and uses that String as if it were an input character notification.
- Specified by:
- characters in interface org.apache.xml.serializer.ExtendedContentHandler
- Overrides:
- characters in interface SerializerBase
- Parameters:
node
- the Node to serialize
public void comment(String comment) throws SAXException
Receive notification of a comment.
- Specified by:
- comment in interface org.apache.xml.serializer.ExtendedLexicalHandler
- Overrides:
- comment in interface SerializerBase
- See Also:
ExtendedLexicalHandler.comment(String)
public void error(SAXParseException exc) throws SAXException
- Overrides:
- error in interface SerializerBase
- See Also:
org.xml.sax.ErrorHandler.error(SAXParseException)
public void fatalError(SAXParseException exc) throws SAXException
- Overrides:
- fatalError in interface SerializerBase
- See Also:
org.xml.sax.ErrorHandler.fatalError(SAXParseException)
public void flushPending() throws SAXException
This method flushes any pending events, which can be startDocument() closing the opening tag of an element, or closing an open CDATA section.
- Specified by:
- flushPending in interface SerializationHandler
public void processingInstruction(String target, String data) throws SAXException
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)
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).
- Specified by:
- reset in interface Serializer
- Overrides:
- reset in interface SerializerBase
- Returns:
- true if the class was successfuly reset.
- See Also:
Serializer.reset()
public void setCdataSectionElements(Vector URI_and_localNames)
Does nothing. The setting of CDATA section elements has an impact on stream serializers.
- Specified by:
- setCdataSectionElements in interface org.apache.xml.serializer.XSLOutputAttributes
- See Also:
SerializationHandler.setCdataSectionElements(java.util.Vector)
public void setContentHandler(ContentHandler _saxHandler)
Sets the SAX ContentHandler.
- Specified by:
- setContentHandler in interface SerializationHandler
- Parameters:
_saxHandler
- The ContentHandler to set
public void setLexHandler(LexicalHandler _lexHandler)
Sets the LexicalHandler.
- Parameters:
_lexHandler
- The LexicalHandler to set
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
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
public void startDTD(String arg0, String arg1, String arg2) throws SAXException
Do nothing.
- See Also:
org.xml.sax.ext.LexicalHandler.startDTD(String, String, String)
public void startElement(String qName) throws SAXException
An element starts, but attributes are not fully known yet.
- Specified by:
- startElement in interface org.apache.xml.serializer.ExtendedContentHandler
- Parameters:
qName
- the element name, with prefix (if any).
- See Also:
ExtendedContentHandler.startElement(String)
public void startElement(String uri, String localName, String qName) throws SAXException
Receives notification that an element starts, but attributes are not fully known yet.
- Specified by:
- startElement in interface org.apache.xml.serializer.ExtendedContentHandler
- 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(String, String, String)
public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException
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.
- 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)
public void warning(SAXParseException exc) throws SAXException
- Overrides:
- warning in interface SerializerBase
- See Also:
org.xml.sax.ErrorHandler.warning(SAXParseException)