Package org.biojava.nbio.core.util
Class PrettyXMLWriter
- java.lang.Object
-
- org.biojava.nbio.core.util.PrettyXMLWriter
-
-
Constructor Summary
Constructors Constructor Description PrettyXMLWriter(java.io.PrintWriter writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidattribute(java.lang.String qName, java.lang.String value)Add an un-qualified attribute to an element.voidattribute(java.lang.String nsURI, java.lang.String localName, java.lang.String value)Add an attribute to an element.voidclose()Close this XMLWriter, and its underlying stream.voidcloseTag(java.lang.String qName)Closes an un-qualified element.voidcloseTag(java.lang.String nsURI, java.lang.String localName)Closes an elementvoiddeclareNamespace(java.lang.String nsURI, java.lang.String prefixHint)Declare a namespace for current and following elements 'prefixHint' is ignored entirely in this implementationprotected voidnumericalEntity(char c)voidopenTag(java.lang.String qName)Open a new unqualified XML tag.voidopenTag(java.lang.String nsURI, java.lang.String localName)Open a new namespace-qualified XML tag.voidprint(java.lang.String data)Prints some textual content in an element.protected voidprintAttributeValue(java.lang.String data)protected voidprintChars(java.lang.String data)voidprintln(java.lang.String data)Prints some textual content, terminated with a newline character.voidprintRaw(java.lang.String data)Send raw data to the stream.protected voidwriteIndent()
-
-
-
Method Detail
-
declareNamespace
public void declareNamespace(java.lang.String nsURI, java.lang.String prefixHint) throws java.io.IOExceptionDeclare a namespace for current and following elements 'prefixHint' is ignored entirely in this implementation- Specified by:
declareNamespacein interfaceXMLWriter- Parameters:
nsURI- The namespace to declareprefixHint- A suggested prefix-string for this namespace.- Throws:
java.io.IOException
-
writeIndent
protected void writeIndent() throws java.io.IOException- Throws:
java.io.IOException
-
openTag
public void openTag(java.lang.String nsURI, java.lang.String localName) throws java.io.IOExceptionDescription copied from interface:XMLWriterOpen a new namespace-qualified XML tag.
-
openTag
public void openTag(java.lang.String qName) throws java.io.IOExceptionDescription copied from interface:XMLWriterOpen a new unqualified XML tag. This may also be used if you want to do namespace management yourself, independantly of the XMLWriter
-
attribute
public void attribute(java.lang.String nsURI, java.lang.String localName, java.lang.String value) throws java.io.IOExceptionDescription copied from interface:XMLWriterAdd an attribute to an element. This will throw an exception if it's not called immediately after anopenTagcommand.
-
attribute
public void attribute(java.lang.String qName, java.lang.String value) throws java.io.IOExceptionDescription copied from interface:XMLWriterAdd an un-qualified attribute to an element. This will throw an exception if it's not called immediately after anopenTagcommand.
-
closeTag
public void closeTag(java.lang.String nsURI, java.lang.String localName) throws java.io.IOExceptionDescription copied from interface:XMLWriterCloses an element
-
closeTag
public void closeTag(java.lang.String qName) throws java.io.IOExceptionDescription copied from interface:XMLWriterCloses an un-qualified element.
-
println
public void println(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:XMLWriterPrints some textual content, terminated with a newline character.
-
print
public void print(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:XMLWriterPrints some textual content in an element.
-
printRaw
public void printRaw(java.lang.String data) throws java.io.IOExceptionDescription copied from interface:XMLWriterSend raw data to the stream. Mainly useful for things like DOCTYPE declarations. Use with care!
-
printChars
protected void printChars(java.lang.String data) throws java.io.IOException- Throws:
java.io.IOException
-
printAttributeValue
protected void printAttributeValue(java.lang.String data) throws java.io.IOException- Throws:
java.io.IOException
-
numericalEntity
protected void numericalEntity(char c) throws java.io.IOException- Throws:
java.io.IOException
-
-