|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.io.graphml.output.AbstractXmlWriter y.io.graphml.output.DomXmlWriter
public class DomXmlWriter
Implementation of interface XmlWriter
that used a
DOM tree internally to build the serialized graphml representation.
Constructor Summary | |
---|---|
DomXmlWriter(java.io.OutputStream ostr,
java.lang.String encoding)
Create a new instance that writes the content to the specified stream |
|
DomXmlWriter(javax.xml.transform.Result result)
Create a new instance that writes the content to the specified Result instance |
|
DomXmlWriter(java.io.Writer w)
Create a new instance that writes the content to the specified Writer instance |
Method Summary | |
---|---|
protected void |
configureTransformer(javax.xml.transform.Transformer transformer)
Configure the transformer that is used internally to transform the internal DOM tree to the actual result. |
protected XmlNamespaceManager |
createNamespaceManager()
Factory method that creates the namespace manager for this instance. |
protected javax.xml.transform.Transformer |
createTransformer()
Create the transformer that is used internally to transform the internal DOM tree to the actual result. |
void |
flushDocument()
Close the document. |
boolean |
isWriteXmlDeclaration()
Whether to write a xml declaration prolog. |
void |
setWriteXmlDeclaration(boolean writeDecl)
Whether to write a xml declaration prolog. |
protected void |
writeAttributeCore(java.lang.String prefix,
java.lang.String localName,
java.lang.String ns,
java.lang.String value)
The core method that actually writes an attribute. |
XmlWriter |
writeCData(java.lang.String s)
Write a CDATA section. |
XmlWriter |
writeComment(java.lang.String comment)
Write a XML comment node. |
XmlWriter |
writeDocumentFragment(org.w3c.dom.DocumentFragment frag)
Write a document fragment. |
void |
writeEndDocument()
Close the output. |
protected void |
writeEndElementCore()
The core method that actually writes the end element. |
XmlWriter |
writeProcessingInstruction(java.lang.String target,
java.lang.String pi)
Write a xml processing instruction. |
XmlWriter |
writeStartDocument()
Begin the output process. |
protected void |
writeStartElementCore(java.lang.String prefix,
java.lang.String localName,
java.lang.String nsURI)
The core method that actually writes the starting element. |
XmlWriter |
writeText(java.lang.String s)
Write a text node. |
protected void |
writeXmlNode(org.w3c.dom.Node n)
Directly write an XML node. |
Methods inherited from class y.io.graphml.output.AbstractXmlWriter |
---|
getNamespaceManager, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeAttribute, writeEndElement, writeStartElement, writeStartElement |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DomXmlWriter(java.io.OutputStream ostr, java.lang.String encoding) throws GraphMLWriteException
ostr
- the stream target of the writerencoding
- The encoding to use.
GraphMLWriteException
public DomXmlWriter(java.io.Writer w) throws GraphMLWriteException
w
- the Writer target of this instance
GraphMLWriteException
public DomXmlWriter(javax.xml.transform.Result result) throws GraphMLWriteException
Result
instance
result
- the Result target of this instance
GraphMLWriteException
Method Detail |
---|
public boolean isWriteXmlDeclaration()
By default, this value is true
.
true
iff a xml declaration prolog should be written.setWriteXmlDeclaration(boolean)
public void setWriteXmlDeclaration(boolean writeDecl)
By default, this value is true
.
writeDecl
- true
iff a xml declaration prolog should be written.isWriteXmlDeclaration()
public XmlWriter writeComment(java.lang.String comment)
XmlWriter
comment
- The content of the comment
public XmlWriter writeProcessingInstruction(java.lang.String target, java.lang.String pi)
XmlWriter
target
- The target of the PIpi
- The data of the PI
public XmlWriter writeStartDocument()
XmlWriter
public void writeEndDocument()
XmlWriter
public void flushDocument() throws GraphMLWriteException
XmlWriter
GraphMLWriteException
protected void configureTransformer(javax.xml.transform.Transformer transformer)
transformer
- The transformer to configure.createTransformer()
protected javax.xml.transform.Transformer createTransformer() throws GraphMLWriteException
GraphMLWriteException
configureTransformer(javax.xml.transform.Transformer)
protected void writeStartElementCore(java.lang.String prefix, java.lang.String localName, java.lang.String nsURI)
AbstractXmlWriter
writeStartElementCore
in class AbstractXmlWriter
prefix
- The prefix or null
.localName
- The name of the element.nsURI
- The namespace uri of the element.protected void writeEndElementCore()
AbstractXmlWriter
writeEndElementCore
in class AbstractXmlWriter
protected void writeAttributeCore(java.lang.String prefix, java.lang.String localName, java.lang.String ns, java.lang.String value)
AbstractXmlWriter
writeAttributeCore
in class AbstractXmlWriter
prefix
- The prefix or null
.localName
- The name of the element.ns
- The namespace uri of the element.value
- The value of the attribute.protected XmlNamespaceManager createNamespaceManager()
createNamespaceManager
in class AbstractXmlWriter
public XmlWriter writeText(java.lang.String s)
XmlWriter
s
will be correctly escaped
s
- The string that gets written as XML text
public XmlWriter writeCData(java.lang.String s)
XmlWriter
s
- The content of the CDATA section
public XmlWriter writeDocumentFragment(org.w3c.dom.DocumentFragment frag)
XmlWriter
frag
- The fragment.
protected void writeXmlNode(org.w3c.dom.Node n)
AbstractXmlWriter.writeStartElement(String,String,String)
, AbstractXmlWriter.writeAttribute(String,String)
and similar.
n
- The node to write.
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |