Package ghidra.util.xml
Class XmlWriter
- java.lang.Object
-
- ghidra.util.xml.XmlWriter
-
public class XmlWriter extends java.lang.ObjectA class for creating XML files.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Closes this XML writer.voidendElement(java.lang.String name)Writes the specified end element.ghidra.util.xml.CountergetCounter()Returns the XML summary string.voidstartElement(java.lang.String name)Writes the specified start element.voidstartElement(java.lang.String name, XmlAttributes attrs)Writes the specified start element with the attributes.voidwriteDTD(java.lang.String dtdName)Writes the specified DTD into the file.voidwriteElement(java.lang.String name, XmlAttributes attrs)Writes the specified element with the attributes.voidwriteElement(java.lang.String name, XmlAttributes attrs, java.lang.String text)Writes the specified element with the attributes and text.
-
-
-
Constructor Detail
-
XmlWriter
public XmlWriter(java.io.File file, java.lang.String dtdName) throws java.io.IOExceptionConstructs a new XML writer.- Parameters:
file- the name of the output XML filedtdName- the name of the DTD- Throws:
java.io.IOException- if an i/o error occurs
-
XmlWriter
public XmlWriter(java.io.OutputStream out, java.lang.String dtdName) throws java.io.IOExceptionConstructs a new XML writer.- Parameters:
out- the output streamdtdName- the name of the DTD- Throws:
java.io.IOException- if an i/o error occurs
-
-
Method Detail
-
getCounter
public ghidra.util.xml.Counter getCounter()
Returns the XML summary string.- Returns:
- the XML summary string
-
close
public void close()
Closes this XML writer.
-
writeDTD
public void writeDTD(java.lang.String dtdName) throws java.io.IOExceptionWrites the specified DTD into the file.- Parameters:
dtdName- the name of the DTD- Throws:
java.io.IOException- if an i/o error occurs
-
startElement
public void startElement(java.lang.String name)
Writes the specified start element.- Parameters:
name- the name of the start element
-
startElement
public void startElement(java.lang.String name, XmlAttributes attrs)Writes the specified start element with the attributes.- Parameters:
name- the name of the start elementattrs- the attributes of the start element
-
endElement
public void endElement(java.lang.String name)
Writes the specified end element.- Parameters:
name- the name of the end element
-
writeElement
public void writeElement(java.lang.String name, XmlAttributes attrs)Writes the specified element with the attributes.- Parameters:
name- the name of the start elementattrs- the attributes of the start element
-
writeElement
public void writeElement(java.lang.String name, XmlAttributes attrs, java.lang.String text)Writes the specified element with the attributes and text.- Parameters:
name- the name of the elementattrs- the attributes of the elementtext- the text of the element
-
-