public class PrettyXMLWriter extends Object implements XMLWriter
Constructor and Description |
---|
PrettyXMLWriter(PrintWriter writer) |
Modifier and Type | Method and Description |
---|---|
void |
attribute(String qName,
String value)
Add an un-qualified attribute to an element.
|
void |
attribute(String nsURI,
String localName,
String value)
Add an attribute to an element.
|
void |
close()
Close this XMLWriter, and it's underlying stream.
|
void |
closeTag(String qName)
Closes an un-qualified element.
|
void |
closeTag(String nsURI,
String localName)
Closes an element
|
void |
declareNamespace(String nsURI,
String prefixHint)
Hints that a namespace is going to be used in a sub-tree.
|
protected void |
numericalEntity(char c) |
void |
openTag(String qName)
Open a new unqualified XML tag.
|
void |
openTag(String nsURI,
String localName)
Open a new namespace-qualified XML tag.
|
void |
print(String data)
Prints some textual content in an element.
|
protected void |
printAttributeValue(String data) |
protected void |
printChars(String data) |
void |
println(String data)
Prints some textual content, terminated with a newline character.
|
void |
printRaw(String data)
Send raw data to the stream.
|
protected void |
writeIndent() |
public PrettyXMLWriter(PrintWriter writer)
public void declareNamespace(String nsURI, String prefixHint) throws IOException
XMLWriter
declareNamespace
in interface XMLWriter
nsURI
- The namespace to declareprefixHint
- A suggested prefix-string for this namespace.IOException
protected void writeIndent() throws IOException
IOException
public void openTag(String nsURI, String localName) throws IOException
XMLWriter
openTag
in interface XMLWriter
nsURI
- A URI for the namespace to uselocalName
- The name of the tagIOException
public void openTag(String qName) throws IOException
XMLWriter
openTag
in interface XMLWriter
qName
- The name of the tag.IOException
public void attribute(String nsURI, String localName, String value) throws IOException
XMLWriter
openTag
command.attribute
in interface XMLWriter
nsURI
- A URI for the namespace to uselocalName
- The name of the attributevalue
- The textual value of the attributeIOException
public void attribute(String qName, String value) throws IOException
XMLWriter
openTag
command.attribute
in interface XMLWriter
qName
- The name of the attribute to setvalue
- The textual value of the attributeIOException
public void closeTag(String nsURI, String localName) throws IOException
XMLWriter
closeTag
in interface XMLWriter
nsURI
- A URI for the namespace to uselocalName
- The name of the tagIOException
public void closeTag(String qName) throws IOException
XMLWriter
closeTag
in interface XMLWriter
qName
- The tag nameIOException
public void println(String data) throws IOException
XMLWriter
println
in interface XMLWriter
IOException
public void print(String data) throws IOException
XMLWriter
print
in interface XMLWriter
IOException
public void printRaw(String data) throws IOException
XMLWriter
printRaw
in interface XMLWriter
data
- a string of data to include verbatim in the XML streamIOException
protected void printChars(String data) throws IOException
IOException
protected void printAttributeValue(String data) throws IOException
IOException
protected void numericalEntity(char c) throws IOException
IOException
public void close() throws IOException
XMLWriter
close
in interface XMLWriter
IOException
Copyright © 2014 BioJava. All rights reserved.