NODETYPE - The DOM node type to usepublic abstract class AbstractXMLSerializer<NODETYPE> extends Object
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractXMLSerializer.NamespaceLevel
Contains the XML namespace definitions for a single element.
|
protected static class |
AbstractXMLSerializer.NamespaceStack
Contains the hierarchy of XML namespaces within a document structure.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_NAMESPACE_PREFIX_PREFIX
The prefix to be used for created namespace prefixes :) (e.g. for "ns0" or
"ns1")
|
protected StringBuilder |
m_aIndent
helper variable: current indentation.
|
protected AbstractXMLSerializer.NamespaceStack |
m_aNSStack
Current stack of namespaces.
|
protected IXMLWriterSettings |
m_aSettings
The serialization settings
|
| Constructor and Description |
|---|
AbstractXMLSerializer(IXMLWriterSettings aSettings) |
| Modifier and Type | Method and Description |
|---|---|
protected XMLEmitter |
createXMLEmitter(Writer aWriter,
IXMLWriterSettings aSettings) |
protected abstract void |
emitNode(XMLEmitter aXMLWriter,
NODETYPE aParentNode,
NODETYPE aPrevSibling,
NODETYPE aNode,
NODETYPE aNextSibling) |
IXMLWriterSettings |
getSettings() |
protected void |
handlePutNamespaceContextPrefixInRoot(Map<QName,String> aAttrMap)
This method handles the case, if all namespace context entries should be
emitted on the root element.
|
String |
toString() |
void |
write(NODETYPE aNode,
OutputStream aOS)
Write the specified node to the specified
OutputStream. |
void |
write(NODETYPE aNode,
Writer aWriter)
Write the specified node to the specified
Writer. |
void |
write(NODETYPE aNode,
XMLEmitter aXMLEmitter) |
public static final String DEFAULT_NAMESPACE_PREFIX_PREFIX
protected final IXMLWriterSettings m_aSettings
protected final StringBuilder m_aIndent
protected final AbstractXMLSerializer.NamespaceStack m_aNSStack
public AbstractXMLSerializer(@Nonnull IXMLWriterSettings aSettings)
@Nonnull public final IXMLWriterSettings getSettings()
protected final void handlePutNamespaceContextPrefixInRoot(@Nonnull Map<QName,String> aAttrMap)
aAttrMap - protected abstract void emitNode(@Nonnull XMLEmitter aXMLWriter, @Nullable NODETYPE aParentNode, @Nullable NODETYPE aPrevSibling, @Nonnull NODETYPE aNode, @Nullable NODETYPE aNextSibling)
@Nonnull @OverrideOnDemand protected XMLEmitter createXMLEmitter(@Nonnull @WillNotClose Writer aWriter, @Nonnull IXMLWriterSettings aSettings)
public final void write(@Nonnull NODETYPE aNode, @Nonnull XMLEmitter aXMLEmitter)
public final void write(@Nonnull NODETYPE aNode, @Nonnull @WillNotClose OutputStream aOS)
OutputStream.aNode - The node to write. May not be null.aOS - The stream to serialize onto. May not be null.public final void write(@Nonnull NODETYPE aNode, @Nonnull @WillNotClose Writer aWriter)
Writer.aNode - The node to write. May not be null.aWriter - The writer to serialize onto. May not be null.Copyright © 2014–2018 Philip Helger. All rights reserved.