|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jhotdraw.xml.JavaxDOMOutput
public class JavaxDOMOutput
DOMOutput.
Design pattern:
Name: Adapter.
Role: Adapter.
Partners: Document as Adaptee.
| Field Summary | |
|---|---|
private org.w3c.dom.Node |
current
The current node used for output. |
private java.lang.String |
doctype
The doctype of the XML document. |
private org.w3c.dom.Document |
document
The document used for output. |
private DOMFactory |
factory
The factory used to create objects. |
private java.util.HashMap<java.lang.Object,java.lang.String> |
objectids
This map is used to marshall references to objects to the XML DOM. |
private java.util.HashMap<java.lang.String,java.lang.Object> |
prototypes
This map is used to cache prototype objects. |
| Constructor Summary | |
|---|---|
JavaxDOMOutput(DOMFactory factory)
Creates a new instance. |
|
| Method Summary | |
|---|---|
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. |
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. |
protected void |
reset()
|
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 output stream. |
void |
setDoctype(java.lang.String doctype)
Sets the doctype for the XML document. |
void |
writeObject(java.lang.Object o)
Writes an object. |
private void |
writeStorable(DOMStorable o)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.lang.String doctype
private java.util.HashMap<java.lang.Object,java.lang.String> objectids
private java.util.HashMap<java.lang.String,java.lang.Object> prototypes
private org.w3c.dom.Document document
private org.w3c.dom.Node current
private DOMFactory factory
| Constructor Detail |
|---|
public JavaxDOMOutput(DOMFactory factory)
throws java.io.IOException
java.io.IOException| Method Detail |
|---|
protected void reset()
throws java.io.IOException
java.io.IOException
public void save(java.io.OutputStream out)
throws java.io.IOException
java.io.IOException
public void save(java.io.Writer out)
throws java.io.IOException
java.io.IOExceptionpublic 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)
addText in interface DOMOutput
public void addAttribute(java.lang.String name,
java.lang.String value)
addAttribute in interface DOMOutput
public void addAttribute(java.lang.String name,
int value)
addAttribute in interface DOMOutput
public void addAttribute(java.lang.String name,
boolean value)
addAttribute in interface DOMOutput
public void addAttribute(java.lang.String name,
float value)
addAttribute in interface DOMOutput
public void addAttribute(java.lang.String name,
double value)
addAttribute in interface DOMOutput
public void writeObject(java.lang.Object o)
throws java.io.IOException
DOMOutput
writeObject in interface DOMOutputjava.io.IOException
private void writeStorable(DOMStorable o)
throws java.io.IOException
java.io.IOException
public void addAttribute(java.lang.String name,
float value,
float defaultValue)
DOMOutput
addAttribute in interface DOMOutput
public void addAttribute(java.lang.String name,
int value,
int defaultValue)
DOMOutput
addAttribute in interface DOMOutput
public void addAttribute(java.lang.String name,
double value,
double defaultValue)
DOMOutput
addAttribute in interface DOMOutput
public void addAttribute(java.lang.String name,
boolean value,
boolean defaultValue)
DOMOutput
addAttribute in interface DOMOutput
public void addAttribute(java.lang.String name,
java.lang.String value,
java.lang.String defaultValue)
DOMOutput
addAttribute in interface DOMOutputpublic java.lang.Object getPrototype()
DOMOutput
getPrototype in interface DOMOutputpublic void setDoctype(java.lang.String doctype)
DOMOutput
setDoctype in interface DOMOutput
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||