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 DOMConfiguration
name
- 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 DOMConfiguration
name
- A String containing the DOMConfiguration parameter name
whose value is to be returned.DOMException
DOMConfiguration.getParameter(java.lang.String)
public DOMStringList getParameterNames()
getParameterNames
in interface DOMConfiguration
DOMConfiguration.getParameterNames()
public void setParameter(String name, Object value) throws DOMException
setParameter
in interface DOMConfiguration
name
- A String containing the DOMConfiguration parameter name.value
- An Object contaiing the parameters value to set.DOMException
DOMConfiguration.setParameter(java.lang.String, java.lang.Object)
public DOMConfiguration getDomConfig()
getDomConfig
in interface LSSerializer
LSSerializer.getDomConfig()
public LSSerializerFilter getFilter()
getFilter
in interface LSSerializer
LSSerializer.getFilter()
public String getNewLine()
getNewLine
in interface LSSerializer
LSSerializer.getNewLine()
public void setFilter(LSSerializerFilter filter)
setFilter
in interface LSSerializer
filter
- 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 LSSerializer
newLine
- 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 LSSerializer
nodeArg
- 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 LSSerializer
nodeArg
- The Node to serialize.LSException
- SERIALIZE_ERR: Raised if the
LSSerializer was unable to serialize the node.DOMException
LSSerializer.writeToString(org.w3c.dom.Node)
public boolean writeToURI(Node nodeArg, String uri) throws LSException
writeToURI
in interface LSSerializer
nodeArg
- 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 © 2016 JBoss by Red Hat. All rights reserved.