|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.graphdrawing.graphml.writer.DomXmlWriter
Implementation of interface XmlWriter that used a
DOM tree internally to build the serialized graphml representation.
| Constructor Summary | |
DomXmlWriter(OutputStream ostr)
Create a new instance that writes the content to the specified stream |
|
DomXmlWriter(Result result)
Create a new instance that writes the content to the specified Result instance |
|
DomXmlWriter(Writer w)
Create a new instance that writes the content to the specified Writer instance |
|
| Method Summary | |
void |
addNamespace(String URI,
String prefix)
Add a namespace declaration to the root element of the output. |
protected void |
configureTransformer(Transformer transformer)
|
protected Transformer |
createTransformer()
|
void |
setDTD(String sysId)
Add a DTD system ID to the root element. |
void |
setDTD(String sysId,
String publicId)
Add a DTD system ID and a DTD public ID to the root element. |
void |
setEncoding(String encoding)
Set the document's encoding Calling this method after writeStartDocument(String, String, String) has undefined results. |
void |
setWriteXmlDeclaration(boolean writeDecl)
Set if the XML declaration at the beginning of the document should be written. |
XmlWriter |
writeAttribute(String localName,
boolean value)
Overload of writeAttribute(String, String) for integer values |
XmlWriter |
writeAttribute(String localName,
double value)
Overload of writeAttribute(String, String) for double values |
XmlWriter |
writeAttribute(String localName,
long value)
Overload of writeAttribute(String, String) for integer values |
XmlWriter |
writeAttribute(String localName,
String value)
Write a Xml attribute node. |
XmlWriter |
writeAttribute(String prefix,
String localName,
String ns,
String value)
Write a Xml attribute node. |
XmlWriter |
writeCDATA(String s)
Write a CDATA section. |
XmlWriter |
writeComment(String comment)
Write a Xml comment node |
XmlWriter |
writeDocumentFragment(DocumentFragment frag)
Write a document fragment. |
XmlWriter |
writeEndDocument()
Close the output. |
XmlWriter |
writeEndElement()
Close a XML element previously opened with writeStartElement(String,String) or
writeStartElement(String,String,String). |
XmlWriter |
writeProcessingInstruction(String target,
String pi)
Write a processing instruction |
XmlWriter |
writeRaw(String s)
Write a raw content to the result. |
XmlWriter |
writeStartDocument(String prefix,
String docTag,
String nsURI)
Begin the output process |
XmlWriter |
writeStartElement(String localName,
String ns)
Begin a new XmlElement with given parameters. |
XmlWriter |
writeStartElement(String prefix,
String localName,
String nsURI)
Begin a new Xml element with given parameters. |
XmlWriter |
writeText(String s)
Write a text node. |
void |
writeToResult()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DomXmlWriter(OutputStream ostr)
ostr - the stream target of the writerpublic DomXmlWriter(Writer w)
w - the Writer target of this instancepublic DomXmlWriter(Result result)
Result instance
result - the Result target of this instance| Method Detail |
public void addNamespace(String URI,
String prefix)
XmlWriterXmlWriter.writeStartDocument(String, String, String) has undefined results
addNamespace in interface XmlWriterURI - the namespace URI of the declarationprefix - the namespace prefix of the declarationpublic void setDTD(String sysId)
XmlWriternull, no DTD reference will be inserted, otherwise, a declaration will be inserted
Calling this method after XmlWriter.writeStartDocument(String, String, String) has undefined results.
setDTD in interface XmlWritersysId - the SYSTEM ID of the DTD
public void setDTD(String sysId,
String publicId)
XmlWriternull, no DTD reference will be inserted. If sysId != null and publicId == null, only a system
declaration will be inserted. Otherwise, both declarations will be inserted.
Calling this method after XmlWriter.writeStartDocument(String, String, String) has undefined results.
setDTD in interface XmlWritersysId - the SYSTEM ID of the DTDpublicId - the PUBLIC ID of the DTDpublic void setEncoding(String encoding)
XmlWriterXmlWriter.writeStartDocument(String, String, String) has undefined results.
setEncoding in interface XmlWriterencoding - A valid encoding scpecificationpublic void setWriteXmlDeclaration(boolean writeDecl)
XmlWriter
setWriteXmlDeclaration in interface XmlWriterwriteDecl - public XmlWriter writeComment(String comment)
XmlWriter
writeComment in interface XmlWritercomment - The content of the comment
public XmlWriter writeProcessingInstruction(String target,
String pi)
XmlWriter
writeProcessingInstruction in interface XmlWritertarget - the target of the processing instructionpi - the instruction itself
public XmlWriter writeStartDocument(String prefix,
String docTag,
String nsURI)
throws GraphMLWriteException
XmlWriter
writeStartDocument in interface XmlWriterGraphMLWriteException
public XmlWriter writeEndDocument()
throws GraphMLWriteException
XmlWriter
writeEndDocument in interface XmlWriterGraphMLWriteException
public void writeToResult()
throws GraphMLWriteException
GraphMLWriteExceptionprotected void configureTransformer(Transformer transformer)
protected Transformer createTransformer()
throws GraphMLWriteException
GraphMLWriteException
public XmlWriter writeStartElement(String prefix,
String localName,
String nsURI)
XmlWriterXmlWriter.writeEndElement() has been called or a new
element has been started.
writeStartElement in interface XmlWriterprefix - The namespace prefix to use for this elementlocalName - The local name of this elementnsURI - The namespace URI of this element
public XmlWriter writeStartElement(String localName,
String ns)
XmlWriterXmlWriter.writeEndElement() has been called or a new
element has been started.
XmlWriter.writeStartElement(String,String,String), but
uses the default prefix for the namespace.
writeStartElement in interface XmlWriterlocalName - The local name of this element.ns - The namespace URI of this element
public XmlWriter writeEndElement()
XmlWriterXmlWriter.writeStartElement(String,String) or
XmlWriter.writeStartElement(String,String,String).
writeEndElement in interface XmlWriter
public XmlWriter writeAttribute(String prefix,
String localName,
String ns,
String value)
XmlWriterXmlWriter.writeStartElement(String,String) or
XmlWriter.writeStartElement(String,String,String)
writeAttribute in interface XmlWriterprefix - The namespace prefix of the attributelocalName - The local name of the attributens - The namespace URI of this attributevalue - The value of this attribute
public XmlWriter writeAttribute(String localName,
String value)
XmlWriterXmlWriter.writeStartElement(String,String) or
XmlWriter.writeStartElement(String,String,String)
XmlWriter.writeAttribute(String,String,String,String), but does not
use namespaces or prefixes.
writeAttribute in interface XmlWriterlocalName - The local name of the attributevalue - The value of this attribute
public XmlWriter writeAttribute(String localName,
double value)
XmlWriterXmlWriter.writeAttribute(String, String) for double values
writeAttribute in interface XmlWriterlocalName - the local name of the attributevalue -
public XmlWriter writeAttribute(String localName,
long value)
XmlWriterXmlWriter.writeAttribute(String, String) for integer values
writeAttribute in interface XmlWriterlocalName - the local name of the attributevalue -
public XmlWriter writeAttribute(String localName,
boolean value)
XmlWriterXmlWriter.writeAttribute(String, String) for integer values
writeAttribute in interface XmlWriterlocalName - the local name of the attributevalue -
public XmlWriter writeText(String s)
XmlWriter
writeText in interface XmlWriters - The content of the text node
public XmlWriter writeCDATA(String s)
XmlWriter
writeCDATA in interface XmlWriters - The content of the text node
public XmlWriter writeRaw(String s)
throws GraphMLWriteException
XmlWriter
writeRaw in interface XmlWriters - raw XML content
GraphMLWriteException - if s does not represent wellformed XML content.public XmlWriter writeDocumentFragment(DocumentFragment frag)
XmlWriter
writeDocumentFragment in interface XmlWriterfrag - the document fragment
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||