public class NanoXMLDOMOutput extends java.lang.Object implements DOMOutput, Disposable
Design pattern:
Name: Adapter.
Role: Adapter.
Partners: XMLElement as Adaptee.
| Constructor and Description |
|---|
NanoXMLDOMOutput(DOMFactory factory)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttribute(java.lang.String name,
boolean value)
Adds an attribute to current element of the DOM Document.
|
void |
addAttribute(java.lang.String name,
boolean value,
boolean defaultValue)
Adds an attribute to current element of the DOM Document if it is
different from the default value.
|
void |
addAttribute(java.lang.String name,
double value)
Adds an attribute to current element of the DOM Document.
|
void |
addAttribute(java.lang.String name,
double value,
double defaultValue)
Adds an attribute to current element of the DOM Document if it is
different from the default value.
|
void |
addAttribute(java.lang.String name,
float value)
Adds an attribute to current element of the DOM Document.
|
void |
addAttribute(java.lang.String name,
float value,
float defaultValue)
Adds an attribute to current element of the DOM Document if it is
different from the default value.
|
void |
addAttribute(java.lang.String name,
int value)
Adds an attribute to current element of the DOM Document.
|
void |
addAttribute(java.lang.String name,
int value,
int defaultValue)
Adds an attribute to current element of the DOM Document if it is
different from the default value.
|
void |
addAttribute(java.lang.String name,
java.lang.String value)
Adds an attribute to current element of the DOM Document.
|
void |
addAttribute(java.lang.String name,
java.lang.String value,
java.lang.String defaultValue)
Adds an attribute to current element of the DOM Document if it is
different from the default value.
|
void |
addComment(java.lang.String comment)
Adds a comment to the current element of the DOM Document.
|
void |
addText(java.lang.String text)
Adds a text to current element of the DOM Document.
|
void |
closeElement()
Closes the current element of the DOM Document.
|
void |
dispose()
Disposes of all resources held by this object so that they can be
garbage collected.
|
java.lang.Object |
getPrototype()
Returns a prototype for the object currently being written.
|
void |
openElement(java.lang.String tagName)
Puts a new element into the DOM Document.
|
void |
print(java.io.PrintWriter out)
Prints the contents of the DOMOutput into the specified print writer.
|
void |
save(java.io.OutputStream out)
Writes the contents of the DOMOutput into the specified output stream.
|
void |
save(java.io.Writer out)
Writes the contents of the DOMOutput into the specified writer.
|
void |
setDoctype(java.lang.String doctype)
Sets the doctype for the XML document.
|
void |
writeObject(java.lang.Object o)
Writes an object.
|
public NanoXMLDOMOutput(DOMFactory factory)
public void save(java.io.OutputStream out)
throws java.io.IOException
java.io.IOExceptionpublic void save(java.io.Writer out)
throws java.io.IOException
java.io.IOExceptionpublic void print(java.io.PrintWriter out)
public void openElement(java.lang.String tagName)
openElement in interface DOMOutputpublic void closeElement()
closeElement in interface DOMOutputjava.lang.IllegalArgumentException - if the provided tagName does
not match the tag name of the element.public void addComment(java.lang.String comment)
addComment in interface DOMOutputpublic void addText(java.lang.String text)
public void addAttribute(java.lang.String name,
java.lang.String value)
addAttribute in interface DOMOutputpublic void addAttribute(java.lang.String name,
int value)
addAttribute in interface DOMOutputpublic void addAttribute(java.lang.String name,
boolean value)
addAttribute in interface DOMOutputpublic void addAttribute(java.lang.String name,
float value)
addAttribute in interface DOMOutputpublic void addAttribute(java.lang.String name,
double value)
addAttribute in interface DOMOutputpublic void writeObject(java.lang.Object o)
throws java.io.IOException
DOMOutputwriteObject in interface DOMOutputjava.io.IOExceptionpublic void addAttribute(java.lang.String name,
float value,
float defaultValue)
DOMOutputaddAttribute in interface DOMOutputpublic void addAttribute(java.lang.String name,
int value,
int defaultValue)
DOMOutputaddAttribute in interface DOMOutputpublic void addAttribute(java.lang.String name,
double value,
double defaultValue)
DOMOutputaddAttribute in interface DOMOutputpublic void addAttribute(java.lang.String name,
boolean value,
boolean defaultValue)
DOMOutputaddAttribute in interface DOMOutputpublic void addAttribute(java.lang.String name,
java.lang.String value,
java.lang.String defaultValue)
DOMOutputaddAttribute in interface DOMOutputpublic java.lang.Object getPrototype()
DOMOutputgetPrototype in interface DOMOutputpublic void setDoctype(java.lang.String doctype)
DOMOutputsetDoctype in interface DOMOutputpublic void dispose()
Disposabledispose in interface Disposable