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
org.apache.xml.serializer.ToXMLSAXHandler
public class ToXMLSAXHandler
extends ToSAXHandler
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 | |
BEGCDATA , CDATA_CONTINUE , CDATA_DELIMITER_CLOSE , CDATA_DELIMITER_OPEN , CNTCDATA , DEFAULT_SAX_SERIALIZER , EMPTYSTRING , ENDCDATA , ENTITY_AMP , ENTITY_CRLF , ENTITY_GT , ENTITY_LT , ENTITY_QUOT , XMLNS_PREFIX , XMLNS_URI , XML_PREFIX |
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Properties | |
OutputStream | |
Writer | |
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
void | |
void |
|
boolean |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
boolean |
|
Methods inherited from class org.apache.xml.serializer.ToSAXHandler | |
addUniqueAttribute , characters , characters , comment , error , fatalError , flushPending , processingInstruction , reset , setCdataSectionElements , setContentHandler , setLexHandler , setShouldOutputNSAttr , setTransformState , startDTD , startElement , startElement , startElement , warning |
public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException
Adds the given attribute to the set of attributes, and also makes sure that the needed prefix/uri mapping is declared, but only if there is a currently open element.
- Specified by:
- addAttribute in interface ExtendedContentHandler
- Overrides:
- addAttribute in interface SerializerBase
- Parameters:
uri
- the URI of the attributelocalName
- the local name of the attributerawName
- the qualified name of the attributetype
- the type of the attribute (probably CDATA)value
- the value of the attribute
public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException
- Specified by:
- attributeDecl in interface DeclHandler
public void characters(String chars) throws SAXException
- Specified by:
- characters in interface ExtendedContentHandler
- Overrides:
- characters in interface ToSAXHandler
public void closeCDATA() throws SAXException
Closes ane open cdata tag, and unlike the this.endCDATA() method (from the LexicalHandler) interface, this "internal" method will send the endCDATA() call to the wrapped handler.
public void comment(char[] arg0, int arg1, int arg2) throws SAXException
- See Also:
org.xml.sax.ext.LexicalHandler.comment(char[], int, int)
public void elementDecl(String arg0, String arg1) throws SAXException
- Specified by:
- elementDecl in interface DeclHandler
public void endCDATA() throws SAXException
- Specified by:
- endCDATA in interface LexicalHandler
- See Also:
LexicalHandler.endCDATA()
public void endDTD() throws SAXException
- Specified by:
- endDTD in interface LexicalHandler
- See Also:
LexicalHandler.endDTD()
public void endDocument() throws SAXException
Receives notification of the end of the document.
- Specified by:
- endDocument in interface ContentHandler
- See Also:
ContentHandler.endDocument()
public void endElement(String elemName) throws SAXException
- Specified by:
- endElement in interface ExtendedContentHandler
public void endElement(String namespaceURI, String localName, String qName) throws SAXException
- Specified by:
- endElement in interface ContentHandler
public void endPrefixMapping(String prefix) throws SAXException
- Specified by:
- endPrefixMapping in interface ContentHandler
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException
- Specified by:
- externalEntityDecl in interface DeclHandler
public Properties getOutputFormat()
- Specified by:
- getOutputFormat in interface Serializer
- See Also:
Serializer.getOutputFormat()
public OutputStream getOutputStream()
- Specified by:
- getOutputStream in interface Serializer
- See Also:
Serializer.getOutputStream()
public Writer getWriter()
- Specified by:
- getWriter in interface Serializer
- See Also:
Serializer.getWriter()
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException
- See Also:
org.xml.sax.ContentHandler.ignorableWhitespace(char[], int, int)
public void internalEntityDecl(String arg0, String arg1) throws SAXException
- Specified by:
- internalEntityDecl in interface DeclHandler
public void namespaceAfterStartElement(String prefix, String uri) throws SAXException
Send a namespace declaration in the output document. The namespace declaration will not be include if the namespace is already in scope with the same prefix.
- Specified by:
- namespaceAfterStartElement in interface ExtendedContentHandler
- Overrides:
- namespaceAfterStartElement in interface SerializerBase
public void processingInstruction(String target, String data) throws SAXException
- Specified by:
- processingInstruction in interface ContentHandler
- Overrides:
- processingInstruction in interface ToSAXHandler
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 ToSAXHandler
- Returns:
- true if the class was successfuly reset.
- See Also:
Serializer.reset()
public void serialize(Node node) throws IOException
- Specified by:
- serialize in interface SerializationHandler
- serialize in interface DOMSerializer
- See Also:
DOMSerializer.serialize(Node)
public void setDocumentLocator(Locator arg0)
- Specified by:
- setDocumentLocator in interface ContentHandler
- Overrides:
- setDocumentLocator in interface SerializerBase
public boolean setEscaping(boolean escape) throws SAXException
- Specified by:
- setEscaping in interface SerializationHandler
public void setOutputFormat(Properties format)
- Specified by:
- setOutputFormat in interface Serializer
public void setOutputStream(OutputStream output)
- Specified by:
- setOutputStream in interface Serializer
public void setWriter(Writer writer)
- Specified by:
- setWriter in interface Serializer
- See Also:
Serializer.setWriter(Writer)
public void skippedEntity(String arg0) throws SAXException
- Specified by:
- skippedEntity in interface ContentHandler
- See Also:
ContentHandler.skippedEntity(String)
public void startCDATA() throws SAXException
Report the start of a CDATA section. The contents of the CDATA section will be reported through the regularcharacters
event; this event is intended only to report the boundary.
- Specified by:
- startCDATA in interface LexicalHandler
- Throws:
SAXException
- The application may raise an exception.
- See Also:
LexicalHandler.endCDATA()
public void startElement(String elementName) throws SAXException
An element starts, but attributes are not fully known yet.
- Specified by:
- startElement in interface ExtendedContentHandler
- Overrides:
- startElement in interface ToSAXHandler
- Parameters:
elementName
- the element name, with prefix (if any).
public void startElement(String elementNamespaceURI, String elementLocalName, String elementName) throws SAXException
Start an element in the output document. This might be an XML element (data type) or a CDATA section.
- Specified by:
- startElement in interface ExtendedContentHandler
- Overrides:
- startElement in interface ToSAXHandler
public void startElement(String namespaceURI, String localName, String name, Attributes atts) throws SAXException
- Specified by:
- startElement in interface ContentHandler
- Overrides:
- startElement in interface ToSAXHandler
public void startEntity(String arg0) throws SAXException
- Specified by:
- startEntity in interface LexicalHandler
- See Also:
LexicalHandler.startEntity(String)
public void startPrefixMapping(String prefix, String uri) throws SAXException
- Specified by:
- startPrefixMapping in interface ContentHandler
- Parameters:
prefix
- The prefix that maps to the URIuri
- The URI for the namespace
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXException
Remember the prefix/uri mapping at the current nested element depth.
- Specified by:
- startPrefixMapping in interface ExtendedContentHandler
- Parameters:
prefix
- The prefix that maps to the URIuri
- The URI for the namespaceshouldFlush
- a flag indicating if the mapping applies to the current element or an up coming child (not used).