Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.serializer

public Class EmptySerializer

extends Object
implements SerializationHandler
Class Inheritance
All Implemented Interfaces
com.sun.org.apache.xml.internal.serializer.SerializationHandler, com.sun.org.apache.xml.internal.serializer.Serializer, com.sun.org.apache.xml.internal.serializer.DOMSerializer, org.xml.sax.ErrorHandler, org.xml.sax.DTDHandler, org.xml.sax.ext.DeclHandler, com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes, com.sun.org.apache.xml.internal.serializer.ExtendedLexicalHandler, org.xml.sax.ext.LexicalHandler, com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler, org.xml.sax.ContentHandler
Known Direct Subclasses
com.sun.org.apache.xalan.internal.xsltc.dom.SimpleResultTreeImpl, com.sun.org.apache.xalan.internal.xsltc.runtime.StringValueHandler
Imports
java.io.IOException, .OutputStream, .Writer, java.util.List, .Properties, javax.xml.transform.SourceLocator, .Transformer, org.w3c.dom.Node, org.xml.sax.Attributes, .ContentHandler, .Locator, .SAXException, .SAXParseException

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.

Field Summary

Modifier and TypeField and Description
protected static final String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(String
the namespace URI of the attribute name
uri
,
String
the local name of the attribute (without prefix)
localName
,
String
the qualified name of the attribute
rawName
,
String
the attribute type typically character data (CDATA)
type
,
String
the value of the attribute
value
,
boolean
true if the added attribute is coming from an xsl:attribute element
XSLAttribute
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addAttribute.

Add at attribute to the current element

public void
addAttribute(String name, String value)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addAttribute.

Add an attribute to the current element.

public void
addAttribute(String
the namespace URI of the attribute name
uri
,
String
the local name of the attribute (without prefix)
localName
,
String
the qualified name of the attribute
rawName
,
String
the attribute type typically character data (CDATA)
type
,
String
the value of the attribute
value
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addAttribute.

Add at attribute to the current element, not from an xsl:attribute element.

public void
addAttributes(Attributes
the attributes to add.
atts
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addAttributes.

Add attributes to the current element

public void
addUniqueAttribute(String
the fully qualified attribute name.
name
,
String
the attribute value
value
,
int
a bitwise flag
flags
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addUniqueAttribute.

Add a unique attribute to the current element.

public void
addXSLAttribute(String
the qualified attribute name (prefix:localName)
qName
,
String
the attributes value
value
,
String
the uri that the prefix of the qName is mapped to.
uri
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.addXSLAttribute.

Add an attribute from an xsl:attribute element.

pack-priv void
public ContentHandler
public Object
asDOM3Serializer()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.asDOM3Serializer.

Return an Object into this serializer to be cast to a DOM3Serializer.

public DOMSerializer
public void
attributeDecl(String
The name of the associated element.
arg0
,
String
The name of the attribute.
arg1
,
String
A string representing the attribute type.
arg2
,
String
A string representing the attribute defaulting mode ("#IMPLIED", "#REQUIRED", or "#FIXED") or null if none of these applies.
arg3
,
String
A string representing the attribute's default value, or null if there is none.
arg4
)

Implements org.xml.sax.ext.DeclHandler.attributeDecl.

Report an attribute type declaration.

public void
characters(String
the character data
chars
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.characters.

This method is used to notify of a character event, but passing the data as a character String rather than the standard character array.

public void
characters(char[]
the characters from the XML document
arg0
,
int
the start position in the array
arg1
,
int
the number of characters to read from the array
arg2
)

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data.

public void
characters(Node
a DOM Node containing text.
node
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.characters.

This method is used to notify of a character event, but passing the data as a DOM Node rather than the standard character array.

public void
public void
comment(String
the comment, but unlike the SAX comment() method this method takes a String rather than a character array.
comment
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedLexicalHandler.comment.

This method is used to notify of a comment

public void
comment(char[]
An array holding the characters in the comment.
arg0
,
int
The starting position in the array.
arg1
,
int
The number of characters to use from the array.
arg2
)

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

Report an XML comment anywhere in the document.

protected void
protected void
protected void
couldThrowSAXException(char[] chars, int off, int len)

protected void
public void
elementDecl(String
The element type name.
arg0
,
String
The content model as a normalized string.
arg1
)

Implements org.xml.sax.ext.DeclHandler.elementDecl.

Report an element type declaration.

public void
endCDATA()

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

Report the end of a CDATA section.

public void
endDocument()

Implements org.xml.sax.ContentHandler.endDocument.

Receive notification of the end of a document.

public void
endDTD()

Implements org.xml.sax.ext.LexicalHandler.endDTD.

Report the end of DTD declarations.

public void
endElement(String
the fully qualified element name.
elemName
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.endElement.

This method is used to notify that an element has ended.

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
arg0
,
String
the local name (without prefix), or the empty string if Namespace processing is not being performed
arg1
,
String
the qualified XML name (with prefix), or the empty string if qualified names are not available
arg2
)

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.

public void
endEntity(String
The name of the entity that is ending.
arg0
)

Implements org.xml.sax.ext.LexicalHandler.endEntity.

Report the end of an entity.

public void
endPrefixMapping(String
the prefix that was being mapped. This is the empty string when a default mapping scope ends.
arg0
)

Implements org.xml.sax.ContentHandler.endPrefixMapping.

End the scope of a prefix-URI mapping.

public void
entityReference(String
the name of the entity
entityName
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.entityReference.

Notify of an entity reference.

public void
error(SAXParseException
The error information encapsulated in a SAX parse exception.
arg0
)

Implements org.xml.sax.ErrorHandler.error.

Receive notification of a recoverable error.

public void
externalEntityDecl(String
The name of the entity. If it is a parameter entity, the name will begin with '%'.
arg0
,
String
The entity's public identifier, or null if none was given.
arg1
,
String
The entity's system identifier.
arg2
)

Implements org.xml.sax.ext.DeclHandler.externalEntityDecl.

Report a parsed external entity declaration.

public void
fatalError(SAXParseException
The error information encapsulated in a SAXParseException.
arg0
)

Implements org.xml.sax.ErrorHandler.fatalError.

Receive notification of a non-recoverable, fatal error.

public void
flushPending()

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.flushPending.

A SerializationHandler accepts SAX-like events, so it can accumulate attributes or namespace nodes after a startElement().

public String
getDoctypePublic()

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.getDoctypePublic.

Returns the previously set value of the value to be used as the public identifier in the document type declaration (DTD).

public String
getDoctypeSystem()

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.getDoctypeSystem.

Returns the previously set value of the value to be used as the system identifier in the document type declaration (DTD).

public String
public boolean
public int
public String
public NamespaceMappings
getNamespaceMappings()

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.getNamespaceMappings.

This method returns an object that has the current namespace mappings in effect.

public String
getNamespaceURI(String
the qualified name of an element, or attribute
name
,
boolean
true if it is an element name, false if it is an atttribute name
isElement
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.getNamespaceURI.

This method gets the prefix associated with a current element or attribute name.

public String
getNamespaceURIFromPrefix(String
a prefix of an element or attribute.
prefix
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.getNamespaceURIFromPrefix.

This method returns the namespace URI currently associated with the prefix.

public boolean
public Properties
getOutputFormat()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getOutputFormat.

Returns the output format properties for this serializer.

public String
getOutputProperty(String
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"
name
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.getOutputProperty.

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.

public String
getOutputPropertyDefault(String
The name of the property.
name
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.getOutputPropertyDefault.

Get the default value for a property that affects seraialization, or null if there is none.

public OutputStream
getOutputStream()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getOutputStream.

Get the output stream where the events will be serialized to.

public String
getPrefix(String
the namespace URI
uri
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.getPrefix.

This method returns the prefix that currently maps to the given namespace URI.

public String
public Transformer
getTransformer()

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.getTransformer.

Get the transformer associated with the serializer.

public String
public Writer
getWriter()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.getWriter.

Get the character stream where the events will be serialized to.

public void
ignorableWhitespace(char[]
the characters from the XML document
arg0
,
int
the start position in the array
arg1
,
int
the number of characters to read from the array
arg2
)

Implements org.xml.sax.ContentHandler.ignorableWhitespace.

Receive notification of ignorable whitespace in element content.

public void
internalEntityDecl(String
The name of the entity. If it is a parameter entity, the name will begin with '%'.
arg0
,
String
The replacement text of the entity.
arg1
)

Implements org.xml.sax.ext.DeclHandler.internalEntityDecl.

Report an internal entity declaration.

public void
namespaceAfterStartElement(String
the namespace URI being declared
uri
,
String
the prefix that maps to the given namespace
prefix
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.namespaceAfterStartElement.

This method is used to notify that a prefix mapping is to start, but after an element is started.

public void
notationDecl(String
The notation name.
arg0
,
String
The notation's public identifier, or null if none was given.
arg1
,
String
The notation's system identifier, or null if none was given.
arg2
)

Implements org.xml.sax.DTDHandler.notationDecl.

Receive notification of a notation declaration event.

public void
processingInstruction(String
the processing instruction target
arg0
,
String
the processing instruction data, or null if none was supplied. The data does not include any whitespace separating it from the target
arg1
)

Implements org.xml.sax.ContentHandler.processingInstruction.

Receive notification of a processing instruction.

public boolean
reset()

Implements com.sun.org.apache.xml.internal.serializer.Serializer.reset.

This method resets the serializer.

public void
serialize(Node
the DOM node to be serialized.
node
)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.serialize.

Notify that the serializer should take this DOM node as input to be serialized.

public void
setCdataSectionElements(List<String>
pairs of namespace URI and local names that identify elements whose text elements are to be output as CDATA sections. The namespace of the local element must be the given URI to match. The qName is not given because the prefix does not matter, only the namespace URI to which that prefix would map matters, so the prefix itself is not relevant in specifying which elements have their text to be output as CDATA sections.
URI_and_localNames
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setCdataSectionElements.

Sets the value coming from the xsl:output cdata-section-elements stylesheet property.

public void
setContentHandler(ContentHandler ch)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setContentHandler.

Set the SAX Content handler that the serializer sends its output to.

public void
setDoctype(String
the system identifier to be used in the DOCTYPE declaration in the output document.
system
,
String
the public identifier to be used in the DOCTYPE declaration in the output document.
pub
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setDoctype.

Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties

public void
setDoctypePublic(String
the public identifier to be used in the DOCTYPE declaration in the output document.
doctype
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setDoctypePublic.

Set the value coming from the xsl:output doctype-public stylesheet attribute.

public void
setDoctypeSystem(String
the system identifier to be used in the DOCTYPE declaration in the output document.
doctype
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setDoctypeSystem.

Set the value coming from the xsl:output doctype-system stylesheet attribute.

public void
setDocumentLocator(Locator
an object that can return the location of any SAX document event
arg0
)

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Receive an object for locating the origin of SAX document events.

public void
setDTDEntityExpansion(boolean
true if DTD entities are to be expanded, false if they are to be left as DTD entity references.
expand
)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setDTDEntityExpansion.

Default behavior is to expand DTD entities, that is the initall default value is true.

public void
setEncoding(String
the character encoding
encoding
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setEncoding.

Sets the character encoding coming from the xsl:output encoding stylesheet attribute.

public boolean
setEscaping(boolean
true if escaping is to be set on.
escape
)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setEscaping.

Turns special character escaping on/off.

public void
setIndent(boolean
true if the output document should be indented to visually indicate its structure.
indent
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setIndent.

Sets the value coming from the xsl:output indent stylesheet attribute.

public void
setIndentAmount(int
the number of spaces to indent for each indentation level.
spaces
)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setIndentAmount.

Set the number of spaces to indent for each indentation level.

public void
setIsStandalone(boolean
true if the property "jdk.xml.xsltcIsStandalone" is set to yes
isStandalone
)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setIsStandalone.

Specify if the output will be treated as a standalone property

public void
setMediaType(String
the media-type or MIME type associated with the output document.
mediatype
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setMediaType.

Sets the value coming from the xsl:output media-type stylesheet attribute.

public void
setNamespaceMappings(NamespaceMappings
NamespaceMappings
mappings
)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setNamespaceMappings.

Used only by TransformerSnapshotImpl to restore the serialization to a previous state.

public void
setOmitXMLDeclaration(boolean
true if the XML declaration is to be omitted from the output document.
b
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setOmitXMLDeclaration.

Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute

public void
setOutputFormat(Properties
The output format to use, as a set of key/value pairs.
format
)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setOutputFormat.

Specifies an output format for this serializer.

public void
setOutputProperty(String
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"
name
,
String
The non-default value of the parameter
val
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setOutputProperty.

Set the non-default value for a property that affects seraialization.

public void
setOutputPropertyDefault(String
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"
name
,
String
The default value of the parameter
val
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setOutputPropertyDefault.

Set the default value for a property that affects seraialization.

public void
setOutputStream(OutputStream
The output stream
output
)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setOutputStream.

Specifies an output stream to which the document should be serialized.

public void
setSourceLocator(SourceLocator
the source locator
locator
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.setSourceLocator.

This method is used to set the source locator, which might be used to generated an error message.

public void
setStandalone(String
a value of "yes" indicates that the standalone delaration is to be included in the output document.
standalone
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setStandalone.

Sets the value coming from the xsl:output standalone stylesheet attribute.

public void
setTransformer(Transformer
the transformer associated with the serializer.
transformer
)

Implements com.sun.org.apache.xml.internal.serializer.SerializationHandler.setTransformer.

Set the transformer associated with the serializer.

public void
setVersion(String
the version of the output format.
version
)

Implements com.sun.org.apache.xml.internal.serializer.XSLOutputAttributes.setVersion.

Sets the value coming from the xsl:output version attribute.

public void
setWriter(Writer
The output writer stream
writer
)

Implements com.sun.org.apache.xml.internal.serializer.Serializer.setWriter.

Specifies a writer to which the document should be serialized.

public void
skippedEntity(String
the name of the skipped entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be the string "[dtd]"
arg0
)

Implements org.xml.sax.ContentHandler.skippedEntity.

Receive notification of a skipped entity.

public void
startCDATA()

Implements org.xml.sax.ext.LexicalHandler.startCDATA.

Report the start of a CDATA section.

public void
startDocument()

Implements org.xml.sax.ContentHandler.startDocument.

Receive notification of the beginning of a document.

public void
startDTD(String
The document type name.
arg0
,
String
The declared public identifier for the external DTD subset, or null if none was declared.
arg1
,
String
The declared system identifier for the external DTD subset, or null if none was declared. (Note that this is not resolved against the document base URI.)
arg2
)

Implements org.xml.sax.ext.LexicalHandler.startDTD.

Report the start of DTD declarations, if any.

public void
startElement(String
the namespace URI of the element
uri
,
String
the local name (without prefix) of the element
localName
,
String
the qualified name of the element
qName
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.startElement.

This method is used to notify that an element is starting.

public void
startElement(String
the fully qualified name of the element
qName
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.startElement.

This method is used to notify of the start of an element

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
arg0
,
String
the local name (without prefix), or the empty string if Namespace processing is not being performed
arg1
,
String
the qualified name (with prefix), or the empty string if qualified names are not available
arg2
,
Attributes
the attributes attached to the element. If there are no attributes, it shall be an empty Attributes object. The value of this object after startElement returns is undefined
arg3
)

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the beginning of an element.

public void
startEntity(String
The name of the entity. If it is a parameter entity, the name will begin with '%', and if it is the external DTD subset, it will be "[dtd]".
arg0
)

Implements org.xml.sax.ext.LexicalHandler.startEntity.

Report the beginning of some internal and external XML entities.

public boolean
startPrefixMapping(String
the prefix that maps to the given URI
prefix
,
String
the namespace URI of the given prefix
uri
,
boolean
if true this call is like the SAX startPrefixMapping(prefix,uri) call and the mapping applies to the element to come. If false the mapping applies to the current element.
shouldFlush
)

Implements com.sun.org.apache.xml.internal.serializer.ExtendedContentHandler.startPrefixMapping.

This method is used to notify that a prefix maping is to start, which can be for the current element, or for the one to come.

public void
startPrefixMapping(String
the Namespace prefix being declared. An empty string is used for the default element namespace, which has no prefix.
arg0
,
String
the Namespace URI the prefix is mapped to
arg1
)

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Begin the scope of a prefix-URI Namespace mapping.

public void
unparsedEntityDecl(String
The unparsed entity's name.
arg0
,
String
The entity's public identifier, or null if none was given.
arg1
,
String
The entity's system identifier.
arg2
,
String
The name of the associated notation.
arg3
)

Implements org.xml.sax.DTDHandler.unparsedEntityDecl.

Receive notification of an unparsed entity declaration event.

public void
warning(SAXParseException
The warning information encapsulated in a SAX parse exception.
arg0
)

Implements org.xml.sax.ErrorHandler.warning.

Receive notification of a warning.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait