Package edu.umd.cs.findbugs.xml
Class OutputStreamXMLOutput
java.lang.Object
edu.umd.cs.findbugs.xml.OutputStreamXMLOutput
- All Implemented Interfaces:
XMLOutput
Write XML to an output stream.
- Author:
- David Hovemeyer
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.OutputStreamXMLOutput(OutputStream os, String stylesheet) Constructor.OutputStreamXMLOutput(Writer writer) Constructor.OutputStreamXMLOutput(Writer writer, String stylesheet) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String name, String value) Add an attribute to a started tag.voidBegin the XML document.voidClose tag with given name.voidfinish()Finish writing XML output, closing any underlying resources (such as output streams).voidflush()voidopenCloseTag(String tagName) Open and close tag with given name.voidopenCloseTag(String tagName, XMLAttributeList attributeList) Open and close tag with given name and given attributes.voidOpen a tag with given name.voidopenTag(String tagName, XMLAttributeList attributeList) Open a tag with given name and given attributes.voidStart a tag, with the intention of adding attributes.voidstopTag(boolean close) End a started tag.voidwriteCDATA(String cdata) Write a CDATA section to the XML document.voidWrite text to the XML document.
-
Constructor Details
-
OutputStreamXMLOutput
Constructor.- Parameters:
os- OutputStream to write XML output to
-
OutputStreamXMLOutput
Constructor.- Parameters:
writer- Writer to write XML output to
-
OutputStreamXMLOutput
Constructor.- Parameters:
os- OutputStream to write XML output tostylesheet- name of stylesheet
-
OutputStreamXMLOutput
-
-
Method Details
-
beginDocument
Description copied from interface:XMLOutputBegin the XML document.- Specified by:
beginDocumentin interfaceXMLOutput- Throws:
IOException
-
openTag
Description copied from interface:XMLOutputOpen a tag with given name.- Specified by:
openTagin interfaceXMLOutput- Parameters:
tagName- the tag name- Throws:
IOException
-
openTag
Description copied from interface:XMLOutputOpen a tag with given name and given attributes.- Specified by:
openTagin interfaceXMLOutput- Parameters:
tagName- the tag nameattributeList- the attributes- Throws:
IOException
-
openCloseTag
Description copied from interface:XMLOutputOpen and close tag with given name.- Specified by:
openCloseTagin interfaceXMLOutput- Parameters:
tagName- the tag name- Throws:
IOException
-
openCloseTag
Description copied from interface:XMLOutputOpen and close tag with given name and given attributes.- Specified by:
openCloseTagin interfaceXMLOutput- Parameters:
tagName- the tag nameattributeList- the attributes- Throws:
IOException
-
startTag
Description copied from interface:XMLOutputStart a tag, with the intention of adding attributes. Must be followed by stopTag after zero or more addAttribute calls.- Specified by:
startTagin interfaceXMLOutput- Parameters:
tagName- the tag name- Throws:
IOException
-
addAttribute
Description copied from interface:XMLOutputAdd an attribute to a started tag. Must follow a call to startTag.- Specified by:
addAttributein interfaceXMLOutput- Parameters:
name- the attribute name.value- the attribute value, unescaped.- Throws:
IOException
-
stopTag
Description copied from interface:XMLOutputEnd a started tag. Must follow a call to startTag.- Specified by:
stopTagin interfaceXMLOutput- Parameters:
close- true if the element has no content.- Throws:
IOException
-
closeTag
Description copied from interface:XMLOutputClose tag with given name.- Specified by:
closeTagin interfaceXMLOutput- Parameters:
tagName- the tag name- Throws:
IOException
-
writeText
Description copied from interface:XMLOutputWrite text to the XML document. XML metacharacters are automatically escaped.- Specified by:
writeTextin interfaceXMLOutput- Parameters:
text- the text to write- Throws:
IOException
-
writeCDATA
Description copied from interface:XMLOutputWrite a CDATA section to the XML document. The characters are not escaped in any way.- Specified by:
writeCDATAin interfaceXMLOutput- Parameters:
cdata- the character data to write- Throws:
IOException
-
flush
- Throws:
IOException
-
finish
Description copied from interface:XMLOutputFinish writing XML output, closing any underlying resources (such as output streams). A call to this method should always be made, even if one of the XML-generation methods throws an exception. Therefore, a call to this method should be performed in a finally block.- Specified by:
finishin interfaceXMLOutput- Throws:
IOException
-