|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Abstraction of XML output classes that provide a consistent way to write Xml elements to some output
| Method Summary | |
void |
addNamespace(String URI,
String prefix)
Add a namespace declaration to the root element of the output. |
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 ns)
Begin a new Xml element with given parameters. |
XmlWriter |
writeText(String s)
Write a text node. |
| Method Detail |
public XmlWriter writeComment(String comment)
comment - The content of the comment
public XmlWriter writeProcessingInstruction(String target,
String pi)
target - the target of the processing instructionpi - the instruction itself
public XmlWriter writeStartDocument(String prefix,
String docTag,
String nsURI)
throws GraphMLWriteException
GraphMLWriteException
public XmlWriter writeEndDocument()
throws GraphMLWriteException
GraphMLWriteException
public XmlWriter writeStartElement(String prefix,
String localName,
String ns)
writeEndElement() has been called or a new
element has been started.
prefix - The namespace prefix to use for this elementlocalName - The local name of this elementns - The namespace URI of this element
public XmlWriter writeStartElement(String localName,
String ns)
writeEndElement() has been called or a new
element has been started.
writeStartElement(String,String,String), but
uses the default prefix for the namespace.
localName - The local name of this element.ns - The namespace URI of this element
public XmlWriter writeEndElement()
writeStartElement(String,String) or
writeStartElement(String,String,String).
public XmlWriter writeAttribute(String prefix,
String localName,
String ns,
String value)
writeStartElement(String,String) or
writeStartElement(String,String,String)
prefix - 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)
writeStartElement(String,String) or
writeStartElement(String,String,String)
writeAttribute(String,String,String,String), but does not
use namespaces or prefixes.
localName - The local name of the attributevalue - The value of this attribute
public XmlWriter writeAttribute(String localName,
double value)
writeAttribute(String, String) for double values
localName - the local name of the attributevalue -
public XmlWriter writeAttribute(String localName,
long value)
writeAttribute(String, String) for integer values
localName - the local name of the attributevalue -
public XmlWriter writeAttribute(String localName,
boolean value)
writeAttribute(String, String) for integer values
localName - the local name of the attributevalue -
public XmlWriter writeText(String s)
s - The content of the text node
public XmlWriter writeRaw(String s)
throws GraphMLWriteException
s - raw XML content
GraphMLWriteException - if s does not represent wellformed XML content.public XmlWriter writeDocumentFragment(DocumentFragment frag)
frag - the document fragment
public XmlWriter writeCDATA(String s)
s - The content of the text node
public void addNamespace(String URI,
String prefix)
writeStartDocument(String, String, String) has undefined results
URI - the namespace URI of the declarationprefix - the namespace prefix of the declarationpublic void setDTD(String sysId)
null, no DTD reference will be inserted, otherwise, a declaration will be inserted
Calling this method after writeStartDocument(String, String, String) has undefined results.
sysId - the SYSTEM ID of the DTDpublic void setEncoding(String encoding)
writeStartDocument(String, String, String) has undefined results.
encoding - A valid encoding scpecificationpublic void setWriteXmlDeclaration(boolean writeDecl)
writeDecl -
public void setDTD(String sysId,
String publicId)
null, 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 writeStartDocument(String, String, String) has undefined results.
sysId - the SYSTEM ID of the DTDpublicId - the PUBLIC ID of the DTD
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||