public class EmptySerializer extends Object implements SerializationHandler
Modifier and Type | Field and Description |
---|---|
protected static String |
ERR |
HTML_ATTREMPTY, HTML_ATTRURL, NO_BAD_CHARS
Constructor and Description |
---|
EmptySerializer() |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String name,
String value)
Add an attribute to the current element.
|
void |
addAttribute(String uri,
String localName,
String rawName,
String type,
String value)
Add at attribute to the current element, not from an xsl:attribute
element.
|
void |
addAttribute(String uri,
String localName,
String rawName,
String type,
String value,
boolean XSLAttribute)
Add at attribute to the current element
|
void |
addAttributes(Attributes atts)
Add attributes to the current element
|
void |
addUniqueAttribute(String name,
String value,
int flags)
Add a unique attribute to the current element.
|
void |
addXSLAttribute(String qName,
String value,
String uri)
Add an attribute from an xsl:attribute element.
|
ContentHandler |
asContentHandler()
Return a
ContentHandler interface to provide SAX input to. |
Object |
asDOM3Serializer()
Return an Object into this serializer to be cast to a DOM3Serializer.
|
DOMSerializer |
asDOMSerializer()
Return a
DOMSerializer interface into this serializer. |
void |
attributeDecl(String arg0,
String arg1,
String arg2,
String arg3,
String arg4) |
void |
characters(char[] arg0,
int arg1,
int arg2) |
void |
characters(Node node)
This method is used to notify of a character event, but passing the data
as a DOM Node rather than the standard character array.
|
void |
characters(String chars)
This method is used to notify of a character event, but passing the data
as a character String rather than the standard character array.
|
void |
close() |
void |
comment(char[] arg0,
int arg1,
int arg2) |
void |
comment(String comment)
This method is used to notify of a comment
|
protected void |
couldThrowException() |
protected void |
couldThrowIOException() |
protected void |
couldThrowSAXException() |
protected void |
couldThrowSAXException(char[] chars,
int off,
int len) |
protected void |
couldThrowSAXException(String elemQName) |
void |
elementDecl(String arg0,
String arg1) |
void |
endCDATA() |
void |
endDocument() |
void |
endDTD() |
void |
endElement(String elemName)
This method is used to notify that an element has ended.
|
void |
endElement(String arg0,
String arg1,
String arg2) |
void |
endEntity(String arg0) |
void |
endPrefixMapping(String arg0) |
void |
entityReference(String entityName)
Notify of an entity reference.
|
void |
error(SAXParseException arg0) |
void |
externalEntityDecl(String arg0,
String arg1,
String arg2) |
void |
fatalError(SAXParseException arg0) |
void |
flushPending()
A SerializationHandler accepts SAX-like events, so
it can accumulate attributes or namespace nodes after
a startElement().
|
String |
getDoctypePublic()
Returns the previously set value of the value to be used as the public
identifier in the document type declaration (DTD).
|
String |
getDoctypeSystem()
Returns the previously set value of the value to be used
as the system identifier in the document type declaration (DTD).
|
String |
getEncoding() |
boolean |
getIndent() |
int |
getIndentAmount() |
String |
getMediaType() |
NamespaceMappings |
getNamespaceMappings()
This method returns an object that has the current namespace mappings in
effect.
|
String |
getNamespaceURI(String name,
boolean isElement)
This method gets the prefix associated with a current element or
attribute name.
|
String |
getNamespaceURIFromPrefix(String prefix)
This method returns the namespace URI currently associated with the
prefix.
|
boolean |
getOmitXMLDeclaration() |
Properties |
getOutputFormat()
Returns the output format properties for this serializer.
|
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()
Get the output stream where the events will be serialized to.
|
String |
getPrefix(String uri)
This method returns the prefix that currently maps to the given namespace
URI.
|
String |
getStandalone() |
Transformer |
getTransformer()
Get the transformer associated with the serializer.
|
String |
getVersion() |
Writer |
getWriter()
Get the character stream where the events will be serialized to.
|
void |
ignorableWhitespace(char[] arg0,
int arg1,
int arg2) |
void |
internalEntityDecl(String arg0,
String arg1) |
void |
namespaceAfterStartElement(String uri,
String prefix)
This method is used to notify that a prefix mapping is to start, but
after an element is started.
|
void |
notationDecl(String arg0,
String arg1,
String arg2) |
void |
processingInstruction(String arg0,
String arg1) |
boolean |
reset()
This method resets the serializer.
|
void |
serialize(Node node)
Notify that the serializer should take this DOM node as input to be
serialized.
|
void |
setCdataSectionElements(Hashtable h) |
void |
setCdataSectionElements(Vector URI_and_localNames)
Sets the value coming from the xsl:output cdata-section-elements
stylesheet property.
|
void |
setContentHandler(ContentHandler ch)
Set the SAX Content handler that the serializer sends its output to.
|
void |
setDoctype(String system,
String pub)
Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties
|
void |
setDoctypePublic(String doctype)
Set the value coming from the xsl:output doctype-public stylesheet attribute.
|
void |
setDoctypeSystem(String doctype)
Set the value coming from the xsl:output doctype-system stylesheet attribute.
|
void |
setDocumentLocator(Locator arg0) |
void |
setDTDEntityExpansion(boolean expand)
Default behavior is to expand DTD entities,
that is the initall default value is true.
|
void |
setEncoding(String encoding)
Sets the character encoding coming from the xsl:output encoding stylesheet attribute.
|
boolean |
setEscaping(boolean escape)
Turns special character escaping on/off.
|
void |
setIndent(boolean indent)
Sets the value coming from the xsl:output indent stylesheet
attribute.
|
void |
setIndentAmount(int spaces)
Set the number of spaces to indent for each indentation level.
|
void |
setMediaType(String mediatype)
Sets the value coming from the xsl:output media-type stylesheet attribute.
|
void |
setNamespaceMappings(NamespaceMappings mappings)
Used only by TransformerSnapshotImpl to restore the serialization
to a previous state.
|
void |
setOmitXMLDeclaration(boolean b)
Sets the value coming from the xsl:output omit-xml-declaration stylesheet attribute
|
void |
setOutputFormat(Properties format)
Specifies an output format for this serializer.
|
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)
Specifies an output stream to which the document should be
serialized.
|
void |
setSourceLocator(SourceLocator locator)
This method is used to set the source locator, which might be used to
generated an error message.
|
void |
setStandalone(String standalone)
Sets the value coming from the xsl:output standalone stylesheet attribute.
|
void |
setTransformer(Transformer transformer)
Set the transformer associated with the serializer.
|
void |
setVersion(String version)
Sets the value coming from the xsl:output version attribute.
|
void |
setWriter(Writer writer)
Specifies a writer to which the document should be serialized.
|
void |
skippedEntity(String arg0) |
void |
startCDATA() |
void |
startDocument() |
void |
startDTD(String arg0,
String arg1,
String arg2) |
void |
startElement(String qName)
This method is used to notify of the start of an element
|
void |
startElement(String uri,
String localName,
String qName)
This method is used to notify that an element is starting.
|
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)
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.
|
void |
unparsedEntityDecl(String arg0,
String arg1,
String arg2,
String arg3) |
void |
warning(SAXParseException arg0) |
protected static final String ERR
protected void couldThrowIOException() throws IOException
IOException
Serializer.asContentHandler()
protected void couldThrowSAXException() throws SAXException
SAXException
protected void couldThrowSAXException(char[] chars, int off, int len) throws SAXException
SAXException
protected void couldThrowSAXException(String elemQName) throws SAXException
SAXException
public ContentHandler asContentHandler() throws IOException
Serializer
ContentHandler
interface to provide SAX input to.
Through the returned object the document to be serailized,
as a series of SAX events, can be provided to the serialzier.
If the serializer does not support the ContentHandler
interface, it will return null.
In principle only one of asDOMSerializer() or asContentHander() should be called.
asContentHandler
in interface Serializer
ContentHandler
interface into this serializer,
or null if the serializer is not SAX 2 capableIOException
- An I/O exception occuredSerializer.asContentHandler()
public void setContentHandler(ContentHandler ch)
SerializationHandler
setContentHandler
in interface SerializationHandler
SerializationHandler.setContentHandler(org.xml.sax.ContentHandler)
public void close()
close
in interface SerializationHandler
SerializationHandler.close()
public Properties getOutputFormat()
Serializer
getOutputFormat
in interface Serializer
Serializer.getOutputFormat()
public OutputStream getOutputStream()
Serializer
getOutputStream
in interface Serializer
Serializer.getOutputStream()
public Writer getWriter()
Serializer
getWriter
in interface Serializer
Serializer.getWriter()
public boolean reset()
Serializer
reset
in interface Serializer
Serializer.reset()
public void serialize(Node node) throws IOException
SerializationHandler
serialize
in interface DOMSerializer
serialize
in interface SerializationHandler
node
- the DOM node to be serialized.IOException
- if an I/O exception occured while serializingSerializationHandler.serialize(org.w3c.dom.Node)
public void setCdataSectionElements(Vector URI_and_localNames)
URI_and_localNames
- 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.XSLOutputAttributes.setCdataSectionElements(java.util.Vector)
public boolean setEscaping(boolean escape) throws SAXException
SerializationHandler
setEscaping
in interface SerializationHandler
escape
- true if escaping is to be set on.SAXException
SerializationHandler.setEscaping(boolean)
public void setIndent(boolean indent)
indent
- true if the output document should be indented to visually
indicate its structure.XSLOutputAttributes.setIndent(boolean)
public void setIndentAmount(int spaces)
SerializationHandler
setIndentAmount
in interface SerializationHandler
spaces
- the number of spaces to indent for each indentation level.SerializationHandler.setIndentAmount(int)
public void setOutputFormat(Properties format)
Serializer
The standard property keys supported are: "method", "version", "encoding", "omit-xml-declaration", "standalone", doctype-public", "doctype-system", "cdata-section-elements", "indent", "media-type". These property keys and their values are described in the XSLT recommendation, see XSLT 1.0 recommendation
The non-standard property keys supported are defined in OutputPropertiesFactory
.
This method can be called multiple times before a document is serialized. Each time it is called more, or over-riding property values, can be specified. One property value that can not be changed is that of the "method" property key.
The value of the "cdata-section-elements" property key is a whitespace separated list of elements. If the element is in a namespace then value is passed in this format: {uri}localName
If the "cdata-section-elements" key is specified on multiple calls to this method the set of elements specified in the value is not replaced from one call to the next, but it is cumulative across the calls.
setOutputFormat
in interface Serializer
format
- The output format to use, as a set of key/value pairs.Serializer.setOutputFormat(java.util.Properties)
public void setOutputStream(OutputStream output)
Serializer
The encoding specified in the output Properties
is used, or
if no encoding was specified, the default for the selected
output method.
Only one of setWriter() or setOutputStream() should be called.
setOutputStream
in interface Serializer
output
- The output streamSerializer.setOutputStream(java.io.OutputStream)
public void setVersion(String version)
version
- the version of the output format.XSLOutputAttributes.setVersion(java.lang.String)
public void setWriter(Writer writer)
Serializer
The encoding specified for the output Properties
must be
identical to the output format used with the writer.
Only one of setWriter() or setOutputStream() should be called.
setWriter
in interface Serializer
writer
- The output writer streamSerializer.setWriter(java.io.Writer)
public void setTransformer(Transformer transformer)
SerializationHandler
setTransformer
in interface SerializationHandler
transformer
- the transformer associated with the serializer.SerializationHandler.setTransformer(javax.xml.transform.Transformer)
public Transformer getTransformer()
SerializationHandler
getTransformer
in interface SerializationHandler
SerializationHandler.getTransformer()
public void flushPending() throws SAXException
SerializationHandler
If the SerializationHandler has a Writer or OutputStream, a call to this method will flush such accumulated events as a closed start tag for an element.
If the SerializationHandler wraps a ContentHandler, a call to this method will flush such accumulated events as a SAX (not SAX-like) calls to startPrefixMapping() and startElement().
If one calls endDocument() then one need not call this method since a call to endDocument() will do what this method does. However, in some circumstances, such as with document fragments, endDocument() is not called and it may be necessary to call this method to flush any pending events.
For performance reasons this method should not be called very often.
flushPending
in interface SerializationHandler
SAXException
SerializationHandler.flushPending()
public void addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute) throws SAXException
ExtendedContentHandler
addAttribute
in interface ExtendedContentHandler
uri
- the namespace URI of the attribute namelocalName
- the local name of the attribute (without prefix)rawName
- the qualified name of the attributetype
- the attribute type typically character data (CDATA)value
- the value of the attributeXSLAttribute
- true if the added attribute is coming from an xsl:attribute elementSAXException
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void addAttributes(Attributes atts) throws SAXException
ExtendedContentHandler
addAttributes
in interface ExtendedContentHandler
atts
- the attributes to add.SAXException
ExtendedContentHandler.addAttributes(org.xml.sax.Attributes)
public void addAttribute(String name, String value)
ExtendedContentHandler
addAttribute
in interface ExtendedContentHandler
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String)
public void characters(String chars) throws SAXException
ExtendedContentHandler
characters
in interface ExtendedContentHandler
chars
- the character dataSAXException
ExtendedContentHandler.characters(java.lang.String)
public void endElement(String elemName) throws SAXException
ExtendedContentHandler
endElement(namespaceURI,localName,qName)only the last parameter is passed. If needed the serializer can derive the localName from the qualified name and derive the namespaceURI from its implementation.
endElement
in interface ExtendedContentHandler
elemName
- the fully qualified element name.SAXException
ExtendedContentHandler.endElement(java.lang.String)
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
SAXException
ContentHandler.startDocument()
public void startElement(String uri, String localName, String qName) throws SAXException
ExtendedContentHandler
startElement(uri,localName,qname,atts)but without the attributes.
startElement
in interface ExtendedContentHandler
uri
- the namespace URI of the elementlocalName
- the local name (without prefix) of the elementqName
- the qualified name of the elementSAXException
ExtendedContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String)
public void startElement(String qName) throws SAXException
ExtendedContentHandler
startElement
in interface ExtendedContentHandler
qName
- the fully qualified name of the elementSAXException
ExtendedContentHandler.startElement(java.lang.String)
public void namespaceAfterStartElement(String uri, String prefix) throws SAXException
ExtendedContentHandler
startPrefixMapping(prefix,uri)is used just before an element starts and applies to the element to come, not to the current element. This method applies to the current element. For example one could make the calls in this order:
startElement("prfx8:elem9") namespaceAfterStartElement("http://namespace8","prfx8")
namespaceAfterStartElement
in interface ExtendedContentHandler
uri
- the namespace URI being declaredprefix
- the prefix that maps to the given namespaceSAXException
ExtendedContentHandler.namespaceAfterStartElement(java.lang.String, java.lang.String)
public boolean startPrefixMapping(String prefix, String uri, boolean shouldFlush) throws SAXException
ExtendedContentHandler
startPrefixMapping
in interface ExtendedContentHandler
prefix
- the prefix that maps to the given URIuri
- the namespace URI of the given prefixshouldFlush
- 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.SAXException
ExtendedContentHandler.startPrefixMapping(java.lang.String, java.lang.String, boolean)
public void entityReference(String entityName) throws SAXException
ExtendedContentHandler
entityReference
in interface ExtendedContentHandler
entityName
- the name of the entitySAXException
ExtendedContentHandler.entityReference(java.lang.String)
public NamespaceMappings getNamespaceMappings()
ExtendedContentHandler
getNamespaceMappings
in interface ExtendedContentHandler
ExtendedContentHandler.getNamespaceMappings()
public String getPrefix(String uri)
ExtendedContentHandler
getPrefix
in interface ExtendedContentHandler
uri
- the namespace URIExtendedContentHandler.getPrefix(java.lang.String)
public String getNamespaceURI(String name, boolean isElement)
ExtendedContentHandler
getNamespaceURI
in interface ExtendedContentHandler
name
- the qualified name of an element, or attributeisElement
- true if it is an element name, false if it is an
atttribute nameExtendedContentHandler.getNamespaceURI(java.lang.String, boolean)
public String getNamespaceURIFromPrefix(String prefix)
ExtendedContentHandler
getNamespaceURIFromPrefix
in interface ExtendedContentHandler
prefix
- a prefix of an element or attribute.ExtendedContentHandler.getNamespaceURIFromPrefix(java.lang.String)
public void setDocumentLocator(Locator arg0)
setDocumentLocator
in interface ContentHandler
ContentHandler.setDocumentLocator(org.xml.sax.Locator)
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
SAXException
ContentHandler.endDocument()
public void startPrefixMapping(String arg0, String arg1) throws SAXException
startPrefixMapping
in interface ContentHandler
SAXException
ContentHandler.startPrefixMapping(java.lang.String, java.lang.String)
public void endPrefixMapping(String arg0) throws SAXException
endPrefixMapping
in interface ContentHandler
SAXException
ContentHandler.endPrefixMapping(java.lang.String)
public void startElement(String arg0, String arg1, String arg2, Attributes arg3) throws SAXException
startElement
in interface ContentHandler
SAXException
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void endElement(String arg0, String arg1, String arg2) throws SAXException
endElement
in interface ContentHandler
SAXException
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void characters(char[] arg0, int arg1, int arg2) throws SAXException
characters
in interface ContentHandler
SAXException
ContentHandler.characters(char[], int, int)
public void ignorableWhitespace(char[] arg0, int arg1, int arg2) throws SAXException
ignorableWhitespace
in interface ContentHandler
SAXException
ContentHandler.ignorableWhitespace(char[], int, int)
public void processingInstruction(String arg0, String arg1) throws SAXException
processingInstruction
in interface ContentHandler
SAXException
ContentHandler.processingInstruction(java.lang.String, java.lang.String)
public void skippedEntity(String arg0) throws SAXException
skippedEntity
in interface ContentHandler
SAXException
ContentHandler.skippedEntity(java.lang.String)
public void comment(String comment) throws SAXException
ExtendedLexicalHandler
comment
in interface ExtendedLexicalHandler
comment
- the comment, but unlike the SAX comment() method this
method takes a String rather than a character array.SAXException
ExtendedLexicalHandler.comment(java.lang.String)
public void startDTD(String arg0, String arg1, String arg2) throws SAXException
startDTD
in interface LexicalHandler
SAXException
LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)
public void endDTD() throws SAXException
endDTD
in interface LexicalHandler
SAXException
LexicalHandler.endDTD()
public void startEntity(String arg0) throws SAXException
startEntity
in interface LexicalHandler
SAXException
LexicalHandler.startEntity(java.lang.String)
public void endEntity(String arg0) throws SAXException
endEntity
in interface LexicalHandler
SAXException
LexicalHandler.endEntity(java.lang.String)
public void startCDATA() throws SAXException
startCDATA
in interface LexicalHandler
SAXException
LexicalHandler.startCDATA()
public void endCDATA() throws SAXException
endCDATA
in interface LexicalHandler
SAXException
LexicalHandler.endCDATA()
public void comment(char[] arg0, int arg1, int arg2) throws SAXException
comment
in interface LexicalHandler
SAXException
LexicalHandler.comment(char[], int, int)
public String getDoctypePublic()
XSLOutputAttributes.getDoctypePublic()
public String getDoctypeSystem()
XSLOutputAttributes.getDoctypeSystem()
public String getEncoding()
XSLOutputAttributes.getEncoding()
public boolean getIndent()
XSLOutputAttributes.getIndent()
public int getIndentAmount()
XSLOutputAttributes.getIndentAmount()
public String getMediaType()
XSLOutputAttributes.getMediaType()
public boolean getOmitXMLDeclaration()
XSLOutputAttributes.getOmitXMLDeclaration()
public String getStandalone()
standalone
delaration is to
be included in the output document.XSLOutputAttributes.getStandalone()
public String getVersion()
XSLOutputAttributes.getVersion()
public void setCdataSectionElements(Hashtable h) throws Exception
Exception
XSLOutputAttributes.setCdataSectionElements(java.util.Vector)
public void setDoctype(String system, String pub)
system
- the system identifier to be used in the DOCTYPE declaration
in the output document.pub
- the public identifier to be used in the DOCTYPE declaration in
the output document.XSLOutputAttributes.setDoctype(java.lang.String, java.lang.String)
public void setDoctypePublic(String doctype)
doctype
- the public identifier to be used in the DOCTYPE
declaration in the output document.XSLOutputAttributes.setDoctypePublic(java.lang.String)
public void setDoctypeSystem(String doctype)
doctype
- the system identifier to be used in the DOCTYPE
declaration in the output document.XSLOutputAttributes.setDoctypeSystem(java.lang.String)
public void setEncoding(String encoding)
encoding
- the character encodingXSLOutputAttributes.setEncoding(java.lang.String)
public void setMediaType(String mediatype)
mediatype
- the media-type or MIME type associated with the output
document.XSLOutputAttributes.setMediaType(java.lang.String)
public void setOmitXMLDeclaration(boolean b)
b
- true if the XML declaration is to be omitted from the output
document.XSLOutputAttributes.setOmitXMLDeclaration(boolean)
public void setStandalone(String standalone)
standalone
- a value of "yes" indicates that the
standalone
delaration is to be included in the output
document.XSLOutputAttributes.setStandalone(java.lang.String)
public void elementDecl(String arg0, String arg1) throws SAXException
elementDecl
in interface DeclHandler
SAXException
DeclHandler.elementDecl(java.lang.String, java.lang.String)
public void attributeDecl(String arg0, String arg1, String arg2, String arg3, String arg4) throws SAXException
attributeDecl
in interface DeclHandler
SAXException
DeclHandler.attributeDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void internalEntityDecl(String arg0, String arg1) throws SAXException
internalEntityDecl
in interface DeclHandler
SAXException
DeclHandler.internalEntityDecl(java.lang.String, java.lang.String)
public void externalEntityDecl(String arg0, String arg1, String arg2) throws SAXException
externalEntityDecl
in interface DeclHandler
SAXException
DeclHandler.externalEntityDecl(java.lang.String, java.lang.String, java.lang.String)
public void warning(SAXParseException arg0) throws SAXException
warning
in interface ErrorHandler
SAXException
ErrorHandler.warning(org.xml.sax.SAXParseException)
public void error(SAXParseException arg0) throws SAXException
error
in interface ErrorHandler
SAXException
ErrorHandler.error(org.xml.sax.SAXParseException)
public void fatalError(SAXParseException arg0) throws SAXException
fatalError
in interface ErrorHandler
SAXException
ErrorHandler.fatalError(org.xml.sax.SAXParseException)
public DOMSerializer asDOMSerializer() throws IOException
Serializer
DOMSerializer
interface into this serializer.
Through the returned object the document to be serialized,
a DOM, can be provided to the serializer.
If the serializer does not support the DOMSerializer
interface, it should return null.
In principle only one of asDOMSerializer() or asContentHander() should be called.
asDOMSerializer
in interface Serializer
DOMSerializer
interface into this serializer,
or null if the serializer is not DOM capableIOException
- An I/O exception occuredSerializer.asDOMSerializer()
public void setNamespaceMappings(NamespaceMappings mappings)
SerializationHandler
setNamespaceMappings
in interface SerializationHandler
mappings
- NamespaceMappingsSerializationHandler.setNamespaceMappings(NamespaceMappings)
public void setSourceLocator(SourceLocator locator)
ExtendedContentHandler
setSourceLocator
in interface ExtendedContentHandler
locator
- the source locatorExtendedContentHandler.setSourceLocator(javax.xml.transform.SourceLocator)
public void addUniqueAttribute(String name, String value, int flags) throws SAXException
ExtendedContentHandler
addUniqueAttribute
in interface ExtendedContentHandler
name
- the fully qualified attribute name.value
- the attribute valueflags
- a bitwise flagSAXException
ExtendedContentHandler.addUniqueAttribute(java.lang.String, java.lang.String, int)
public void characters(Node node) throws SAXException
ExtendedContentHandler
characters
in interface ExtendedContentHandler
node
- a DOM Node containing text.SAXException
ExtendedContentHandler.characters(org.w3c.dom.Node)
public void addXSLAttribute(String qName, String value, String uri)
ExtendedContentHandler
addXSLAttribute
in interface ExtendedContentHandler
qName
- the qualified attribute name (prefix:localName)value
- the attributes valueuri
- the uri that the prefix of the qName is mapped to.ExtendedContentHandler.addXSLAttribute(java.lang.String, java.lang.String, java.lang.String)
public void addAttribute(String uri, String localName, String rawName, String type, String value) throws SAXException
ExtendedContentHandler
addAttribute
in interface ExtendedContentHandler
uri
- the namespace URI of the attribute namelocalName
- the local name of the attribute (without prefix)rawName
- the qualified name of the attributetype
- the attribute type typically character data (CDATA)value
- the value of the attributeSAXException
ExtendedContentHandler.addAttribute(java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void notationDecl(String arg0, String arg1, String arg2) throws SAXException
notationDecl
in interface DTDHandler
SAXException
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)
public void unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3) throws SAXException
unparsedEntityDecl
in interface DTDHandler
SAXException
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
public void setDTDEntityExpansion(boolean expand)
SerializationHandler
setDTDEntityExpansion
in interface SerializationHandler
expand
- true if DTD entities are to be expanded,
false if they are to be left as DTD entity references.SerializationHandler.setDTDEntityExpansion(boolean)
public String getOutputProperty(String name)
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:
public String getOutputPropertyDefault(String name)
name
- The name of the property.public void setOutputProperty(String name, String val)
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:
public void setOutputPropertyDefault(String name, String val)
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:
public Object asDOM3Serializer() throws IOException
Serializer
DOM3Serializer
interface, it should return null.
In principle only one of asDOM3Serializer() or asContentHander() should be called.
asDOM3Serializer
in interface Serializer
IOException
- An I/O exception occuredSerializer.asDOM3Serializer()
Copyright © 2021 JBoss by Red Hat. All rights reserved.