public final class LSSerializerImpl extends java.lang.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.Constructor and Description |
---|
LSSerializerImpl()
Constructor: Creates a LSSerializerImpl object.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canSetParameter(java.lang.String name,
java.lang.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.
|
java.lang.String |
getNewLine()
Returns the End-Of-Line sequence of characters to be used in the XML
being serialized.
|
java.lang.Object |
getParameter(java.lang.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
|
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(java.lang.String newLine)
Sets the End-Of-Line sequence of characters to be used in the XML
being serialized.
|
void |
setParameter(java.lang.String name,
java.lang.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.
|
java.lang.String |
writeToString(Node nodeArg)
Serializes the specified node and returns a String with the serialized
data to the caller.
|
boolean |
writeToURI(Node nodeArg,
java.lang.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(java.lang.String name, java.lang.Object value)
canSetParameter
in interface DOMConfiguration
name
- A String containing the DOMConfiguration parameter name.value
- An Object specifying the value of the corresponding parameter.true
if the parameter could be successfully set
to the specified value, or false
if the parameter is
not recognized or the requested value is not supported. This does
not change the current value of the parameter itself.DOMConfiguration.canSetParameter(java.lang.String, java.lang.Object)
public java.lang.Object getParameter(java.lang.String name) throws DOMException
getParameter
in interface DOMConfiguration
name
- A String containing the DOMConfiguration parameter name
whose value is to be returned.DOMException
- NOT_FOUND_ERR: Raised when the parameter name is not recognized.DOMConfiguration.getParameter(java.lang.String)
public DOMStringList getParameterNames()
getParameterNames
in interface DOMConfiguration
DOMConfiguration.getParameterNames()
public void setParameter(java.lang.String name, java.lang.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
- NOT_FOUND_ERR: Raised when the parameter name is not recognized.
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 java.lang.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(java.lang.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.destination
- The destination for the serialized DOM.true
if node
was
successfully serialized. Return false
in case the
normal processing stopped but the implementation kept serializing
the document; the result of the serialization being implementation
dependent then.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 java.lang.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
- DOMSTRING_SIZE_ERR: Raised if the resulting string is too long to
fit in a DOMString
.LSSerializer.writeToString(org.w3c.dom.Node)
public boolean writeToURI(Node nodeArg, java.lang.String uri) throws LSException
writeToURI
in interface LSSerializer
nodeArg
- The Node to serialize.uri
- The URI to write to.true
if node
was
successfully serialized. Return false
in case the
normal processing stopped but the implementation kept serializing
the document; the result of the serialization being implementation
dependent then.LSException
- SERIALIZE_ERR: Raised if the
LSSerializer was unable to serialize the node.LSSerializer.writeToURI(org.w3c.dom.Node, String)
public DOMErrorHandler getErrorHandler()
Copyright © 2014 Apache XML Project. All Rights Reserved.