org.apache.xml.serializer

Class EmptySerializer

Implemented Interfaces:
org.xml.sax.ContentHandler, DeclHandler, org.xml.sax.DTDHandler, ErrorHandler, DOMSerializer, ExtendedContentHandler, ExtendedLexicalHandler, org.xml.sax.ext.LexicalHandler, SerializationHandler, Serializer, org.apache.xml.serializer.XSLOutputAttributes
Known Direct Subclasses:
SimpleResultTreeImpl, StringValueHandler

public class EmptySerializer
extends java.lang.Object
implements SerializationHandler

This class is an adapter class. Its only purpose is to be extended and for that extended class to over-ride all methods that are to be used. This class is not a public API, it is only public because it is used across package boundaries.

Fields inherited from interface org.apache.xml.serializer.ExtendedContentHandler

HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS

Method Summary

void
addAttribute(String name, String value)
void
addAttribute(String uri, String localName, String rawName, String type, String value)
void
addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)
void
addAttributes(Attributes atts)
void
addUniqueAttribute(String name, String value, int flags)
void
addXSLAttribute(String qName, String value, String uri)
ContentHandler
asContentHandler()
Object
asDOM3Serializer()
DOMSerializer
asDOMSerializer()
void
attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4)
void
characters(Node node)
void
characters(String chars)
void
characters(char[] arg0, int arg1, int arg2)
void
close()
void
comment(String comment)
void
comment(char[] arg0, int arg1, int arg2)
void
elementDecl(String arg0, String arg1)
void
endCDATA()
void
endDTD()
void
endDocument()
void
endElement(String elemName)
void
endElement(String arg0, String arg1, String arg2)
void
endEntity(String arg0)
void
endPrefixMapping(String arg0)
void
entityReference(String entityName)
void
error(SAXParseException arg0)
void
externalEntityDecl(String arg0, String arg1, String arg2)
void
fatalError(SAXParseException arg0)
void
flushPending()
String
getDoctypePublic()
String
getDoctypeSystem()
String
getEncoding()
boolean
getIndent()
int
getIndentAmount()
String
getMediaType()
NamespaceMappings
getNamespaceMappings()
String
getNamespaceURI(String name, boolean isElement)
String
getNamespaceURIFromPrefix(String prefix)
boolean
getOmitXMLDeclaration()
Properties
getOutputFormat()
String
getOutputProperty(String name)
Get the value for a property that affects seraialization, if a property was set return that value, otherwise return the default value, otherwise return null.
String
getOutputPropertyDefault(String name)
Get the default value for a property that affects seraialization, or null if there is none.
OutputStream
getOutputStream()
String
getPrefix(String uri)
String
getStandalone()
Transformer
getTransformer()
String
getVersion()
Writer
getWriter()
void
ignorableWhitespace(char[] arg0, int arg1, int arg2)
void
internalEntityDecl(String arg0, String arg1)
void
namespaceAfterStartElement(String uri, String prefix)
void
notationDecl(String arg0, String arg1, String arg2)
void
processingInstruction(String arg0, String arg1)
boolean
reset()
void
serialize(Node node)
void
setCdataSectionElements(Hashtable h)
void
setCdataSectionElements(Vector URI_and_localNames)
void
setContentHandler(ContentHandler ch)
void
setDTDEntityExpansion(boolean expand)
void
setDoctype(String system, String pub)
void
setDoctypePublic(String doctype)
void
setDoctypeSystem(String doctype)
void
setDocumentLocator(Locator arg0)
void
setEncoding(String encoding)
boolean
setEscaping(boolean escape)
void
setIndent(boolean indent)
void
setIndentAmount(int spaces)
void
setMediaType(String mediatype)
void
setNamespaceMappings(NamespaceMappings mappings)
void
setOmitXMLDeclaration(boolean b)
void
setOutputFormat(Properties format)
void
setOutputProperty(String name, String val)
Set the non-default value for a property that affects seraialization.
void
setOutputPropertyDefault(String name, String val)
Set the default value for a property that affects seraialization.
void
setOutputStream(OutputStream output)
void
setSourceLocator(SourceLocator locator)
void
setStandalone(String standalone)
void
setTransformer(Transformer transformer)
void
setVersion(String version)
void
setWriter(Writer writer)
void
skippedEntity(String arg0)
void
startCDATA()
void
startDTD(String arg0, String arg1, String arg2)
void
startDocument()
void
startElement(String qName)
void
startElement(String uri, String localName, String qName)
void
startElement(String arg0, String arg1, String arg2, Attributes arg3)
void
startEntity(String arg0)
void
startPrefixMapping(String arg0, String arg1)
boolean
startPrefixMapping(String prefix, String uri, boolean shouldFlush)
void
unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3)
void
warning(SAXParseException arg0)

Method Details

addAttribute

public void addAttribute(String name,
                         String value)
Specified by:
addAttribute in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String)

addAttribute

public void addAttribute(String uri,
                         String localName,
                         String rawName,
                         String type,
                         String value)
            throws SAXException
Specified by:
addAttribute in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

addAttribute

public void addAttribute(String uri,
                         String localName,
                         String rawName,
                         String type,
                         String value,
                         boolean XSLAttribute)
            throws SAXException
Specified by:
addAttribute in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

addAttributes

public void addAttributes(Attributes atts)
            throws SAXException

addUniqueAttribute

public void addUniqueAttribute(String name,
                               String value,
                               int flags)
            throws SAXException
Specified by:
addUniqueAttribute in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.addUniqueAttribute(java.lang.String, java.lang.String, int)

addXSLAttribute

public void addXSLAttribute(String qName,
                            String value,
                            String uri)
Specified by:
addXSLAttribute in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.addXSLAttribute(java.lang.String, java.lang.String, java.lang.String)

asContentHandler

public ContentHandler asContentHandler()
            throws IOException
Specified by:
asContentHandler in interface Serializer
See Also:
SerializationHandler.asContentHandler()

asDOM3Serializer

public Object asDOM3Serializer()
            throws IOException
Specified by:
asDOM3Serializer in interface Serializer

asDOMSerializer

public DOMSerializer asDOMSerializer()
            throws IOException
Specified by:
asDOMSerializer in interface Serializer

attributeDecl

public void attributeDecl(String arg0,
                          String arg1,
                          String arg2,
                          String arg3,
                          String arg4)
            throws SAXException
See Also:
org.xml.sax.ext.DeclHandler.attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)

characters

public void characters(Node node)
            throws SAXException

characters

public void characters(String chars)
            throws SAXException
Specified by:
characters in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.characters(java.lang.String)

characters

public void characters(char[] arg0,
                       int arg1,
                       int arg2)
            throws SAXException
See Also:
org.xml.sax.ContentHandler.characters(char[], int, int)

close

public void close()
Specified by:
close in interface SerializationHandler

comment

public void comment(String comment)
            throws SAXException
Specified by:
comment in interface ExtendedLexicalHandler
See Also:
ExtendedLexicalHandler.comment(java.lang.String)

comment

public void comment(char[] arg0,
                    int arg1,
                    int arg2)
            throws SAXException
See Also:
org.xml.sax.ext.LexicalHandler.comment(char[], int, int)

elementDecl

public void elementDecl(String arg0,
                        String arg1)
            throws SAXException
See Also:
org.xml.sax.ext.DeclHandler.elementDecl(java.lang.String, java.lang.String)

endCDATA

public void endCDATA()
            throws SAXException
See Also:
org.xml.sax.ext.LexicalHandler.endCDATA()

endDTD

public void endDTD()
            throws SAXException
See Also:
org.xml.sax.ext.LexicalHandler.endDTD()

endDocument

public void endDocument()
            throws SAXException
See Also:
org.xml.sax.ContentHandler.endDocument()

endElement

public void endElement(String elemName)
            throws SAXException
Specified by:
endElement in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.endElement(java.lang.String)

endElement

public void endElement(String arg0,
                       String arg1,
                       String arg2)
            throws SAXException
See Also:
org.xml.sax.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

endEntity

public void endEntity(String arg0)
            throws SAXException
See Also:
org.xml.sax.ext.LexicalHandler.endEntity(java.lang.String)

endPrefixMapping

public void endPrefixMapping(String arg0)
            throws SAXException
See Also:
org.xml.sax.ContentHandler.endPrefixMapping(java.lang.String)

entityReference

public void entityReference(String entityName)
            throws SAXException
Specified by:
entityReference in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.entityReference(java.lang.String)

error

public void error(SAXParseException arg0)
            throws SAXException
See Also:
org.xml.sax.ErrorHandler.error(org.xml.sax.SAXParseException)

externalEntityDecl

public void externalEntityDecl(String arg0,
                               String arg1,
                               String arg2)
            throws SAXException
See Also:
org.xml.sax.ext.DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)

fatalError

public void fatalError(SAXParseException arg0)
            throws SAXException
See Also:
org.xml.sax.ErrorHandler.fatalError(org.xml.sax.SAXParseException)

flushPending

public void flushPending()
            throws SAXException
Specified by:
flushPending in interface SerializationHandler

getDoctypePublic

public String getDoctypePublic()
Specified by:
getDoctypePublic in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getDoctypePublic()

getDoctypeSystem

public String getDoctypeSystem()
Specified by:
getDoctypeSystem in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getDoctypeSystem()

getEncoding

public String getEncoding()
Specified by:
getEncoding in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getEncoding()

getIndent

public boolean getIndent()
Specified by:
getIndent in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getIndent()

getIndentAmount

public int getIndentAmount()
Specified by:
getIndentAmount in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getIndentAmount()

getMediaType

public String getMediaType()
Specified by:
getMediaType in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getMediaType()

getNamespaceMappings

public NamespaceMappings getNamespaceMappings()
Specified by:
getNamespaceMappings in interface ExtendedContentHandler

getNamespaceURI

public String getNamespaceURI(String name,
                              boolean isElement)
Specified by:
getNamespaceURI in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.getNamespaceURI(java.lang.String, boolean)

getNamespaceURIFromPrefix

public String getNamespaceURIFromPrefix(String prefix)
Specified by:
getNamespaceURIFromPrefix in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.getNamespaceURIFromPrefix(java.lang.String)

getOmitXMLDeclaration

public boolean getOmitXMLDeclaration()
Specified by:
getOmitXMLDeclaration in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getOmitXMLDeclaration()

getOutputFormat

public Properties getOutputFormat()
Specified by:
getOutputFormat in interface Serializer
See Also:
SerializationHandler.getOutputFormat()

getOutputProperty

public String getOutputProperty(String name)
Get the value for a property that affects seraialization, if a property was set return that value, otherwise return the default value, otherwise return null.
Specified by:
getOutputProperty in interface org.apache.xml.serializer.XSLOutputAttributes
Parameters:
name - The name of the property, which is just the local name if it is in no namespace, but is the URI in curly braces followed by the local name if it is in a namespace, for example:
  • "encoding"
  • "method"
  • "{http://xml.apache.org/xalan}indent-amount"
  • "{http://xml.apache.org/xalan}line-separator"
Returns:
The value of the parameter

getOutputPropertyDefault

public String getOutputPropertyDefault(String name)
Get the default value for a property that affects seraialization, or null if there is none. It is possible that a non-default value was set for the property, however the value returned by this method is unaffected by any non-default settings.
Specified by:
getOutputPropertyDefault in interface org.apache.xml.serializer.XSLOutputAttributes
Parameters:
name - The name of the property.
Returns:
The default value of the parameter, or null if there is no default value.

getOutputStream

public OutputStream getOutputStream()
Specified by:
getOutputStream in interface Serializer
See Also:
SerializationHandler.getOutputStream()

getPrefix

public String getPrefix(String uri)
Specified by:
getPrefix in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.getPrefix(java.lang.String)

getStandalone

public String getStandalone()
Specified by:
getStandalone in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getStandalone()

getTransformer

public Transformer getTransformer()
Specified by:
getTransformer in interface SerializationHandler

getVersion

public String getVersion()
Specified by:
getVersion in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.getVersion()

getWriter

public Writer getWriter()
Specified by:
getWriter in interface Serializer
See Also:
SerializationHandler.getWriter()

ignorableWhitespace

public void ignorableWhitespace(char[] arg0,
                                int arg1,
                                int arg2)
            throws SAXException
See Also:
org.xml.sax.ContentHandler.ignorableWhitespace(char[], int, int)

internalEntityDecl

public void internalEntityDecl(String arg0,
                               String arg1)
            throws SAXException
See Also:
org.xml.sax.ext.DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)

namespaceAfterStartElement

public void namespaceAfterStartElement(String uri,
                                       String prefix)
            throws SAXException
Specified by:
namespaceAfterStartElement in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.namespaceAfterStartElement(java.lang.String, java.lang.String)

notationDecl

public void notationDecl(String arg0,
                         String arg1,
                         String arg2)
            throws SAXException
See Also:
org.xml.sax.DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)

processingInstruction

public void processingInstruction(String arg0,
                                  String arg1)
            throws SAXException
See Also:
org.xml.sax.ContentHandler.processingInstruction(java.lang.String, java.lang.String)

reset

public boolean reset()
Specified by:
reset in interface Serializer
See Also:
SerializationHandler.reset()

serialize

public void serialize(Node node)
            throws IOException
Specified by:
serialize in interface SerializationHandler
serialize in interface DOMSerializer
See Also:
SerializationHandler.serialize(org.w3c.dom.Node)

setCdataSectionElements

public void setCdataSectionElements(Hashtable h)
            throws Exception
See Also:
XSLOutputAttributes.setCdataSectionElements

setCdataSectionElements

public void setCdataSectionElements(Vector URI_and_localNames)
Specified by:
setCdataSectionElements in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
SerializationHandler.setCdataSectionElements(java.util.Vector)

setContentHandler

public void setContentHandler(ContentHandler ch)
Specified by:
setContentHandler in interface SerializationHandler
See Also:
SerializationHandler.setContentHandler(org.xml.sax.ContentHandler)

setDTDEntityExpansion

public void setDTDEntityExpansion(boolean expand)
Specified by:
setDTDEntityExpansion in interface SerializationHandler

setDoctype

public void setDoctype(String system,
                       String pub)
Specified by:
setDoctype in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.setDoctype(java.lang.String, java.lang.String)

setDoctypePublic

public void setDoctypePublic(String doctype)
Specified by:
setDoctypePublic in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.setDoctypePublic(java.lang.String)

setDoctypeSystem

public void setDoctypeSystem(String doctype)
Specified by:
setDoctypeSystem in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.setDoctypeSystem(java.lang.String)

setDocumentLocator

public void setDocumentLocator(Locator arg0)
See Also:
org.xml.sax.ContentHandler.setDocumentLocator(org.xml.sax.Locator)

setEncoding

public void setEncoding(String encoding)
Specified by:
setEncoding in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.setEncoding(java.lang.String)

setEscaping

public boolean setEscaping(boolean escape)
            throws SAXException
Specified by:
setEscaping in interface SerializationHandler

setIndent

public void setIndent(boolean indent)
Specified by:
setIndent in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
SerializationHandler.setIndent(boolean)

setIndentAmount

public void setIndentAmount(int spaces)
Specified by:
setIndentAmount in interface SerializationHandler

setMediaType

public void setMediaType(String mediatype)
Specified by:
setMediaType in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.setMediaType(java.lang.String)

setNamespaceMappings

public void setNamespaceMappings(NamespaceMappings mappings)
Specified by:
setNamespaceMappings in interface SerializationHandler

setOmitXMLDeclaration

public void setOmitXMLDeclaration(boolean b)
Specified by:
setOmitXMLDeclaration in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.setOmitXMLDeclaration(boolean)

setOutputFormat

public void setOutputFormat(Properties format)
Specified by:
setOutputFormat in interface Serializer
See Also:
SerializationHandler.setOutputFormat(java.util.Properties)

setOutputProperty

public void setOutputProperty(String name,
                              String val)
Set the non-default value for a property that affects seraialization.
Specified by:
setOutputProperty in interface org.apache.xml.serializer.XSLOutputAttributes
Parameters:
name - The name of the property, which is just the local name if it is in no namespace, but is the URI in curly braces followed by the local name if it is in a namespace, for example:
  • "encoding"
  • "method"
  • "{http://xml.apache.org/xalan}indent-amount"
  • "{http://xml.apache.org/xalan}line-separator"

setOutputPropertyDefault

public void setOutputPropertyDefault(String name,
                                     String val)
Set the default value for a property that affects seraialization.
Specified by:
setOutputPropertyDefault in interface org.apache.xml.serializer.XSLOutputAttributes
Parameters:
name - The name of the property, which is just the local name if it is in no namespace, but is the URI in curly braces followed by the local name if it is in a namespace, for example:
  • "encoding"
  • "method"
  • "{http://xml.apache.org/xalan}indent-amount"
  • "{http://xml.apache.org/xalan}line-separator"

setOutputStream

public void setOutputStream(OutputStream output)
Specified by:
setOutputStream in interface Serializer
See Also:
SerializationHandler.setOutputStream(java.io.OutputStream)

setSourceLocator

public void setSourceLocator(SourceLocator locator)
Specified by:
setSourceLocator in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.setSourceLocator(javax.xml.transform.SourceLocator)

setStandalone

public void setStandalone(String standalone)
Specified by:
setStandalone in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
XSLOutputAttributes.setStandalone(java.lang.String)

setTransformer

public void setTransformer(Transformer transformer)
Specified by:
setTransformer in interface SerializationHandler
See Also:
SerializationHandler.setTransformer(javax.xml.transform.Transformer)

setVersion

public void setVersion(String version)
Specified by:
setVersion in interface org.apache.xml.serializer.XSLOutputAttributes
See Also:
SerializationHandler.setVersion(java.lang.String)

setWriter

public void setWriter(Writer writer)
Specified by:
setWriter in interface Serializer
See Also:
SerializationHandler.setWriter(java.io.Writer)

skippedEntity

public void skippedEntity(String arg0)
            throws SAXException
See Also:
org.xml.sax.ContentHandler.skippedEntity(java.lang.String)

startCDATA

public void startCDATA()
            throws SAXException
See Also:
org.xml.sax.ext.LexicalHandler.startCDATA()

startDTD

public void startDTD(String arg0,
                     String arg1,
                     String arg2)
            throws SAXException
See Also:
org.xml.sax.ext.LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)

startDocument

public void startDocument()
            throws SAXException
See Also:
ExtendedContentHandler.startDocument()

startElement

public void startElement(String qName)
            throws SAXException
Specified by:
startElement in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.startElement(java.lang.String)

startElement

public void startElement(String uri,
                         String localName,
                         String qName)
            throws SAXException
Specified by:
startElement in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String)

startElement

public void startElement(String arg0,
                         String arg1,
                         String arg2,
                         Attributes arg3)
            throws SAXException
See Also:
org.xml.sax.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

startEntity

public void startEntity(String arg0)
            throws SAXException
See Also:
org.xml.sax.ext.LexicalHandler.startEntity(java.lang.String)

startPrefixMapping

public void startPrefixMapping(String arg0,
                               String arg1)
            throws SAXException
See Also:
org.xml.sax.ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)

startPrefixMapping

public boolean startPrefixMapping(String prefix,
                                  String uri,
                                  boolean shouldFlush)
            throws SAXException
Specified by:
startPrefixMapping in interface ExtendedContentHandler
See Also:
ExtendedContentHandler.startPrefixMapping(java.lang.String, java.lang.String, boolean)

unparsedEntityDecl

public void unparsedEntityDecl(String arg0,
                               String arg1,
                               String arg2,
                               String arg3)
            throws SAXException
See Also:
org.xml.sax.DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)

warning

public void warning(SAXParseException arg0)
            throws SAXException
See Also:
org.xml.sax.ErrorHandler.warning(org.xml.sax.SAXParseException)

Copyright © 2006 Apache XML Project. All Rights Reserved.