public final class LSSerializerImpl extends Object implements DOMConfiguration, LSSerializer
org.apache.xml.serializer.ToStream or
one of its derived classes depending on the serialization method, while walking
the DOM in DOM3TreeWalker.| Modifier and Type | Field and Description |
|---|---|
protected int |
fFeatures |
| Constructor and Description |
|---|
LSSerializerImpl()
Constructor: Creates a LSSerializerImpl object.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canSetParameter(String name,
Object value)
Checks if setting a parameter to a specific value is supported.
|
DOMConfiguration |
getDomConfig()
Returns the DOMConfiguration of the LSSerializer.
|
DOMErrorHandler |
getErrorHandler()
This method returns the LSSerializer's error handler.
|
LSSerializerFilter |
getFilter()
Returns the DOMConfiguration of the LSSerializer.
|
protected String |
getInputEncoding(Node nodeArg)
Determines the Input Encoding of the Document Node to serialize.
|
String |
getNewLine()
Returns the End-Of-Line sequence of characters to be used in the XML
being serialized.
|
Object |
getParameter(String name)
This method returns the value of a parameter if known.
|
DOMStringList |
getParameterNames()
This method returns a of the parameters supported by this DOMConfiguration object
and for which at least one value can be set by the application
|
protected String |
getXMLEncoding(Node nodeArg)
Determines the XML Encoding of the Document Node to serialize.
|
protected String |
getXMLVersion(Node nodeArg)
Determines the XML Version of the Document Node to serialize.
|
void |
initializeSerializerProps()
Initializes the underlying serializer's configuration depending on the
default DOMConfiguration parameters.
|
void |
setFilter(LSSerializerFilter filter)
Set a LSSerilizerFilter on the LSSerializer.
|
void |
setNewLine(String newLine)
Sets the End-Of-Line sequence of characters to be used in the XML
being serialized.
|
void |
setParameter(String name,
Object value)
This method sets the value of the named parameter.
|
boolean |
write(Node nodeArg,
LSOutput destination)
Serializes the specified node to the specified LSOutput and returns true if the Node
was successfully serialized.
|
String |
writeToString(Node nodeArg)
Serializes the specified node and returns a String with the serialized
data to the caller.
|
boolean |
writeToURI(Node nodeArg,
String uri)
Serializes the specified node to the specified URI and returns true if the Node
was successfully serialized.
|
public LSSerializerImpl()
public void initializeSerializerProps()
public boolean canSetParameter(String name, Object value)
canSetParameter in interface DOMConfigurationname - A String containing the DOMConfiguration parameter name.value - An Object specifying the value of the corresponding parameter.DOMConfiguration.canSetParameter(java.lang.String, java.lang.Object)public Object getParameter(String name) throws DOMException
getParameter in interface DOMConfigurationname - A String containing the DOMConfiguration parameter name
whose value is to be returned.DOMExceptionDOMConfiguration.getParameter(java.lang.String)public DOMStringList getParameterNames()
getParameterNames in interface DOMConfigurationDOMConfiguration.getParameterNames()public void setParameter(String name, Object value) throws DOMException
setParameter in interface DOMConfigurationname - A String containing the DOMConfiguration parameter name.value - An Object contaiing the parameters value to set.DOMExceptionDOMConfiguration.setParameter(java.lang.String, java.lang.Object)public DOMConfiguration getDomConfig()
getDomConfig in interface LSSerializerLSSerializer.getDomConfig()public LSSerializerFilter getFilter()
getFilter in interface LSSerializerLSSerializer.getFilter()public String getNewLine()
getNewLine in interface LSSerializerLSSerializer.getNewLine()public void setFilter(LSSerializerFilter filter)
setFilter in interface LSSerializerfilter - A LSSerializerFilter to be applied to the stream to serialize.LSSerializer.setFilter(org.w3c.dom.ls.LSSerializerFilter)public void setNewLine(String newLine)
setNewLine in interface LSSerializernewLine - a String that is the end-of-line character sequence to be used in
serialization.LSSerializer.setNewLine(java.lang.String)public boolean write(Node nodeArg, LSOutput destination) throws LSException
write in interface LSSerializernodeArg - The Node to serialize.LSException - SERIALIZE_ERR: Raised if the
LSSerializer was unable to serialize the node.LSSerializer.write(org.w3c.dom.Node, org.w3c.dom.ls.LSOutput)public String writeToString(Node nodeArg) throws DOMException, LSException
writeToString in interface LSSerializernodeArg - The Node to serialize.LSException - SERIALIZE_ERR: Raised if the
LSSerializer was unable to serialize the node.DOMExceptionLSSerializer.writeToString(org.w3c.dom.Node)public boolean writeToURI(Node nodeArg, String uri) throws LSException
writeToURI in interface LSSerializernodeArg - The Node to serialize.LSException - SERIALIZE_ERR: Raised if the
LSSerializer was unable to serialize the node.LSSerializer.writeToURI(org.w3c.dom.Node, String)protected String getXMLVersion(Node nodeArg)
nodeArg - The Node to serializeThrowable - if the DOM implementation does not implement Document.getXmlVersion()protected String getXMLEncoding(Node nodeArg)
nodeArg - The Node to serializeThrowable - if the DOM implementation does not implement Document.getXmlEncoding()protected String getInputEncoding(Node nodeArg)
nodeArg - The Node to serializepublic DOMErrorHandler getErrorHandler()
Copyright © 2017 JBoss by Red Hat. All rights reserved.