Package edu.umd.cs.findbugs.xml
Class Dom4JXMLOutput
- java.lang.Object
-
- edu.umd.cs.findbugs.xml.Dom4JXMLOutput
-
-
Constructor Summary
Constructors Constructor Description Dom4JXMLOutput(org.dom4j.Branch topLevel)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(java.lang.String name, java.lang.String value)Add an attribute to a started tag.voidbeginDocument()Begin the XML document.voidcloseTag(java.lang.String tagName)Close tag with given name.voidfinish()Finish writing XML output, closing any underlying resources (such as output streams).voidopenCloseTag(java.lang.String tagName)Open and close tag with given name.voidopenCloseTag(java.lang.String tagName, XMLAttributeList attributeList)Open and close tag with given name and given attributes.voidopenTag(java.lang.String tagName)Open a tag with given name.voidopenTag(java.lang.String tagName, XMLAttributeList attributeList)Open a tag with given name and given attributes.voidstartTag(java.lang.String tagName)Start a tag, with the intention of adding attributes.voidstopTag(boolean close)End a started tag.voidwrite(XMLWriteable obj)Add given object to the tree.voidwriteCDATA(java.lang.String cdata)Write a CDATA section to the XML document.voidwriteCollection(java.util.Collection<? extends XMLWriteable> collection)Add a Collection of XMLWriteable objects to the tree.voidwriteElementList(java.lang.String tagName, java.util.Collection<java.lang.String> listValues)Add a list of Strings to document as elements with given tag name to the tree.voidwriteText(java.lang.String text)Write text to the XML document.
-
-
-
Method Detail
-
beginDocument
public void beginDocument()
Description copied from interface:XMLOutputBegin the XML document.- Specified by:
beginDocumentin interfaceXMLOutput
-
openTag
public void openTag(java.lang.String tagName)
Description copied from interface:XMLOutputOpen a tag with given name.
-
openTag
public void openTag(java.lang.String tagName, XMLAttributeList attributeList)Description copied from interface:XMLOutputOpen a tag with given name and given attributes.
-
openCloseTag
public void openCloseTag(java.lang.String tagName)
Description copied from interface:XMLOutputOpen and close tag with given name.- Specified by:
openCloseTagin interfaceXMLOutput- Parameters:
tagName- the tag name
-
openCloseTag
public void openCloseTag(java.lang.String tagName, XMLAttributeList attributeList)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
-
startTag
public void startTag(java.lang.String tagName)
Description copied from interface:XMLOutputStart a tag, with the intention of adding attributes. Must be followed by stopTag after zero or more addAttribute calls.
-
addAttribute
public void addAttribute(java.lang.String name, java.lang.String value)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.
-
stopTag
public void stopTag(boolean close)
Description copied from interface:XMLOutputEnd a started tag. Must follow a call to startTag.
-
closeTag
public void closeTag(java.lang.String tagName)
Description copied from interface:XMLOutputClose tag with given name.
-
writeText
public void writeText(java.lang.String text)
Description copied from interface:XMLOutputWrite text to the XML document. XML metacharacters are automatically escaped.
-
writeCDATA
public void writeCDATA(java.lang.String cdata)
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
-
writeElementList
public void writeElementList(java.lang.String tagName, java.util.Collection<java.lang.String> listValues)Add a list of Strings to document as elements with given tag name to the tree.- Parameters:
tagName- the tag namelistValues- Collection of String values to add
-
write
public void write(XMLWriteable obj)
Add given object to the tree.- Parameters:
obj- the object
-
writeCollection
public void writeCollection(java.util.Collection<? extends XMLWriteable> collection)
Add a Collection of XMLWriteable objects to the tree.- Parameters:
collection- Collection of XMLWriteable objects
-
finish
public void 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.
-
-