Package org.biojava.nbio.core.util
Class PrettyXMLWriter
java.lang.Object
org.biojava.nbio.core.util.PrettyXMLWriter
- All Implemented Interfaces:
 XMLWriter
Implementation of XMLWriter which emits nicely formatted documents
 to a PrintWriter.
- Since:
 - 1.3
 - Author:
 - Thomas Down
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidAdd an un-qualified attribute to an element.voidAdd an attribute to an element.voidclose()Close this XMLWriter, and it's underlying stream.voidCloses an un-qualified element.voidCloses an elementvoiddeclareNamespace(String nsURI, String prefixHint) Hints that a namespace is going to be used in a sub-tree.protected voidnumericalEntity(char c) voidOpen a new unqualified XML tag.voidOpen a new namespace-qualified XML tag.voidPrints some textual content in an element.protected voidprintAttributeValue(String data) protected voidprintChars(String data) voidPrints some textual content, terminated with a newline character.voidSend raw data to the stream.protected void 
- 
Constructor Details
- 
PrettyXMLWriter
 
 - 
 - 
Method Details
- 
declareNamespace
Description copied from interface:XMLWriterHints that a namespace is going to be used in a sub-tree. Use this method to avoid namespaces that are used only in leaf-nodes of a tree being re-defined every time they are used. The XMLWriter will generally try to use the suggested prefix for this namespace, but there is no guarentee of this. In particular, if the namespace is already in use, the current prefix will still be used. Similarly if the suggested prefix has already been used for another namespace, a new one will be auto-generated.- Specified by:
 declareNamespacein interfaceXMLWriter- Parameters:
 nsURI- The namespace to declareprefixHint- A suggested prefix-string for this namespace.- Throws:
 IOException
 - 
writeIndent
- Throws:
 IOException
 - 
openTag
Description copied from interface:XMLWriterOpen a new namespace-qualified XML tag.- Specified by:
 openTagin interfaceXMLWriter- Parameters:
 nsURI- A URI for the namespace to uselocalName- The name of the tag- Throws:
 IOException
 - 
openTag
Description 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- Specified by:
 openTagin interfaceXMLWriter- Parameters:
 qName- The name of the tag.- Throws:
 IOException
 - 
attribute
Description copied from interface:XMLWriterAdd an attribute to an element. This will throw an exception if it's not called immediately after anopenTagcommand.- Specified by:
 attributein interfaceXMLWriter- Parameters:
 nsURI- A URI for the namespace to uselocalName- The name of the attributevalue- The textual value of the attribute- Throws:
 IOException
 - 
attribute
Description copied from interface:XMLWriterAdd an un-qualified attribute to an element. This will throw an exception if it's not called immediately after anopenTagcommand.- Specified by:
 attributein interfaceXMLWriter- Parameters:
 qName- The name of the attribute to setvalue- The textual value of the attribute- Throws:
 IOException
 - 
closeTag
Description copied from interface:XMLWriterCloses an element- Specified by:
 closeTagin interfaceXMLWriter- Parameters:
 nsURI- A URI for the namespace to uselocalName- The name of the tag- Throws:
 IOException
 - 
closeTag
Description copied from interface:XMLWriterCloses an un-qualified element.- Specified by:
 closeTagin interfaceXMLWriter- Parameters:
 qName- The tag name- Throws:
 IOException
 - 
println
Description copied from interface:XMLWriterPrints some textual content, terminated with a newline character.- Specified by:
 printlnin interfaceXMLWriter- Throws:
 IOException
 - 
print
Description copied from interface:XMLWriterPrints some textual content in an element.- Specified by:
 printin interfaceXMLWriter- Throws:
 IOException
 - 
printRaw
Description copied from interface:XMLWriterSend raw data to the stream. Mainly useful for things like DOCTYPE declarations. Use with care!- Specified by:
 printRawin interfaceXMLWriter- Parameters:
 data- a string of data to include verbatim in the XML stream- Throws:
 IOException
 - 
printChars
- Throws:
 IOException
 - 
printAttributeValue
- Throws:
 IOException
 - 
numericalEntity
- Throws:
 IOException
 - 
close
Description copied from interface:XMLWriterClose this XMLWriter, and it's underlying stream.- Specified by:
 closein interfaceXMLWriter- Throws:
 IOException
 
 -