org.apache.xml.serializer
public abstract class SerializerBase extends Object implements SerializationHandler, SerializerConstants
UNKNOWN: internal
Method Summary | |
---|---|
void | addAttribute(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)
Adds the given attribute to the set of collected attributes , but only if
there is a currently open element.
|
void | addAttribute(String name, String value)
Adds the given attribute to the set of collected attributes,
but only if there is a currently open element.
|
void | addAttribute(String uri, String localName, String rawName, String type, String value)
This method adds an attribute the the current element,
but should not be used for an xsl:attribute child. |
boolean | addAttributeAlways(String uri, String localName, String rawName, String type, String value, boolean XSLAttribute)
Adds the given attribute to the set of attributes, even if there is
no currently open element. |
void | addAttributes(Attributes atts)
Add the given attributes to the currently collected ones. |
void | addXSLAttribute(String name, String value, String uri)
Adds the given xsl:attribute to the set of collected attributes,
but only if there is a currently open element.
|
ContentHandler | asContentHandler()
Return a {@link ContentHandler} interface into this serializer.
|
DOMSerializer | asDOMSerializer()
Return a {@link DOMSerializer} interface into this serializer. |
void | characters(Node node)
This method gets the nodes value as a String and uses that String as if
it were an input character notification. |
void | close()
Flush and close the underlying java.io.Writer. |
void | comment(String data)
Receive notification of a comment.
|
void | endEntity(String name)
Report the end of an entity.
|
void | entityReference(String name)
Entity reference event.
|
void | error(SAXParseException exc) |
void | fatalError(SAXParseException exc) |
void | fireEndEntity(String name)
To fire off end entity trace event |
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()
Returns the character encoding to be used in the output document. |
boolean | getIndent() |
int | getIndentAmount() |
String | getMediaType()
Gets the mediatype the media-type or MIME type associated with the output
document. |
NamespaceMappings | getNamespaceMappings()
Some users of the serializer may need the current namespace mappings |
String | getNamespaceURI(String qname, boolean isElement)
Returns the URI of an element or attribute. |
String | getNamespaceURIFromPrefix(String prefix)
Returns the URI of prefix (if any)
|
boolean | getOmitXMLDeclaration() |
String | getPrefix(String namespaceURI)
Returns the prefix currently pointing to the given URI (if any). |
String | getStandalone()
Gets the XSL standalone attribute |
Transformer | getTransformer()
Gets the transformer associated with this serializer |
String | getVersion()
Gets the version of the output format. |
void | namespaceAfterStartElement(String uri, String prefix)
This method is used when a prefix/uri namespace mapping
is indicated after the element was started with a
startElement() and before and endElement().
startPrefixMapping(prefix,uri) would be used before the
startElement() call. |
void | notationDecl(String arg0, String arg1, String arg2) |
boolean | reset() |
void | setDoctype(String doctypeSystem, String doctypePublic) Set the value coming from the xsl:output doctype-public and doctype-system stylesheet properties |
void | setDoctypePublic(String doctypePublic) Set the value coming from the xsl:output doctype-public stylesheet attribute. |
void | setDoctypeSystem(String doctypeSystem) Set the value coming from the xsl:output doctype-system stylesheet attribute. |
void | setDocumentLocator(Locator locator)
Receive an object for locating the origin of SAX document events.
|
void | setDTDEntityExpansion(boolean expand)
If set to false the serializer does not expand DTD entities,
but leaves them as is, the default value is true. |
void | setEncoding(String m_encoding)
Sets the character encoding coming from the xsl:output encoding stylesheet attribute. |
void | setIndent(boolean doIndent)
Sets the value coming from the xsl:output indent stylesheet
attribute. |
void | setIndentAmount(int m_indentAmount)
Sets the indentation amount. |
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 | 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 t)
Sets the transformer associated with this serializer |
void | setVersion(String version)
Sets the value coming from the xsl:output version attribute. |
void | startDocument()
Receive notification of the beginning of a document.
|
void | unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3) |
void | warning(SAXParseException exc) |
Parameters: uri the URI of the attribute localName the local name of the attribute rawName the qualified name of the attribute type the type of the attribute (probably CDATA) value the value of the attribute XSLAttribute true if this attribute is coming from an xsl:attriute element
See Also: ExtendedContentHandler
Parameters: name the attribute's qualified name value the value of the attribute
See Also: ExtendedContentHandler
Parameters: uri the URI of the attribute localName the local name of the attribute rawName the qualified name of the attribute type the type of the attribute (probably CDATA) value the value of the attribute XSLAttribute true if this attribute is coming from an xsl:attribute element
Returns: true if the attribute was added, false if an existing value was replaced.
Parameters: atts List of attributes to add to this list
Parameters: name the attribute's qualified name (prefix:localName) value the value of the attribute uri the URI that the prefix of the name points to
Returns: A {@link ContentHandler} interface into this serializer, or null if the serializer is not SAX 2 capable
Throws: IOException An I/O exception occured
Returns: A {@link DOMSerializer} interface into this serializer, or null if the serializer is not DOM capable
Throws: IOException An I/O exception occured
See Also: asDOMSerializer
Parameters: node the Node to serialize
Throws: org.xml.sax.SAXException
See Also: ToStream
See Also: comment
Parameters: name The name of the entity that is ending.
Throws: org.xml.sax.SAXException The application may raise an exception.
See Also: SerializerBase
Parameters: name Name of entity
Throws: org.xml.sax.SAXException
See Also: org.xml.sax.ErrorHandler#error(SAXParseException)
See Also: org.xml.sax.ErrorHandler#fatalError(SAXParseException)
Parameters: name Name of entity
Returns: the public identifier to be used in the DOCTYPE declaration in the output document.
Returns: the system identifier to be used in the DOCTYPE declaration in the output document.
Returns: the character encoding to be used in the output document.
Returns: true if the output document should be indented to visually indicate its structure.
Returns: the number of spaces to indent for each indentation level.
Returns: the mediatype the media-type or MIME type associated with the output document.
Returns: the current namespace mappings (prefix/uri)
See Also: getNamespaceMappings
Parameters: qname a qualified name isElement true if the qualified name is the name of an element.
Returns: returns the namespace URI associated with the qualified name.
Parameters: prefix the prefix whose URI is searched for
Returns: the namespace URI currently associated with the prefix, null if the prefix is undefined.
Returns: true if the XML declaration is to be omitted from the output document.
Parameters: namespaceURI the uri of the namespace in question
Returns: a prefix pointing to the given URI (if any).
See Also: getPrefix
Returns: a value of "yes" if the standalone
delaration is to
be included in the output document.
See Also: getStandalone
Returns: returns the transformer associated with this serializer.
See Also: getTransformer
Returns: the version of the output format.
Parameters: uri the URI of the namespace prefix the prefix associated with the given URI.
See Also: ExtendedContentHandler
See Also: org.xml.sax.DTDHandler#notationDecl(java.lang.String, java.lang.String, java.lang.String)
Parameters: doctypeSystem the system identifier to be used in the DOCTYPE declaration in the output document. doctypePublic the public identifier to be used in the DOCTYPE declaration in the output document.
Parameters: doctypePublic the public identifier to be used in the DOCTYPE declaration in the output document.
Parameters: doctypeSystem the system identifier to be used in the DOCTYPE declaration in the output document.
Parameters: locator An object that can return the location of any SAX document
event.
Receive an object for locating the origin of SAX document events.
SAX parsers are strongly encouraged (though not absolutely
required) to supply a locator: if it does so, it must supply
the locator to the application by invoking this method before
invoking any of the other methods in the DocumentHandler
interface. The locator allows the application to determine the end
position of any document-related event, even if the parser is
not reporting an error. Typically, the application will
use this information for reporting its own errors (such as
character content that does not match an application's
business rules). The information returned by the locator
is probably not sufficient for use with a search engine. Note that the locator will return correct information only
during the invocation of the events in this interface. The
application should not attempt to use it at any other time.
Parameters: m_encoding the character encoding
Parameters: doIndent true if the output document should be indented to visually indicate its structure.
See Also: XSLOutputAttributes
Parameters: m_indentAmount The m_indentAmount to set
Parameters: mediaType the non-null media-type or MIME type associated with the output document.
See Also: javax.xml.transform.OutputKeys#MEDIA_TYPE SerializationHandler
Parameters: mappings NamespaceMappings
Parameters: b true if the XML declaration is to be omitted from the output document.
Parameters: locator the source locator
See Also: setSourceLocator
Parameters: standalone a value of "yes" indicates that the
standalone
delaration is to be included in the output
document. This method remembers if the value was explicitly set using
this method, verses if the value is the default value.
Parameters: t the transformer associated with this serializer.
See Also: setTransformer
Parameters: version the version of the output format.
See Also: SerializationHandler
The SAX parser will invoke this method only once, before any other methods in this interface or in DTDHandler (except for setDocumentLocator).
Throws: org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception. org.xml.sax.SAXException
See Also: org.xml.sax.DTDHandler#unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)
See Also: org.xml.sax.ErrorHandler#warning(SAXParseException)