JHotDraw 7.3.1

org.jhotdraw.xml
Interface DOMOutput

All Known Implementing Classes:
JavaxDOMOutput, NanoXMLDOMOutput

public interface DOMOutput

DOMOutput.

Design pattern:
Name: Abstract Factory.
Role: Client.
Partners: DOMFactory as the Abstract Factory of the Abstract Factory,.

Version:
$Id: DOMOutput.java 527 2009-06-07 14:28:19Z rawcoder $
Author:
Werner Randelshofer

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)
          Adds a new element to the DOM Document and opens it.
 void setDoctype(java.lang.String doctype)
          Sets the doctype for the XML document.
 void writeObject(java.lang.Object o)
          Writes an object.
 

Method Detail

setDoctype

void setDoctype(java.lang.String doctype)
Sets the doctype for the XML document.


openElement

void openElement(java.lang.String tagName)
Adds a new element to the DOM Document and opens it. The new element is added as a child to the current element in the DOM document. Then it becomes the current element. The element must be closed using closeElement.


closeElement

void closeElement()
Closes the current element of the DOM Document. The parent of the current element becomes the current element.

Throws:
java.lang.IllegalArgumentException - if the provided tagName does not match the tag name of the element.

addComment

void addComment(java.lang.String comment)
Adds a comment to the current element of the DOM Document.


addText

void addText(java.lang.String text)
Adds a text to current element of the DOM Document. Note: Multiple consecutives texts will be merged.


addAttribute

void addAttribute(java.lang.String name,
                  java.lang.String value)
Adds an attribute to current element of the DOM Document.


addAttribute

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.


addAttribute

void addAttribute(java.lang.String name,
                  int value)
Adds an attribute to current element of the DOM Document.


addAttribute

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.


addAttribute

void addAttribute(java.lang.String name,
                  boolean value)
Adds an attribute to current element of the DOM Document.


addAttribute

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.


addAttribute

void addAttribute(java.lang.String name,
                  float value)
Adds an attribute to current element of the DOM Document.


addAttribute

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.


addAttribute

void addAttribute(java.lang.String name,
                  double value)
Adds an attribute to current element of the DOM Document.


addAttribute

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.


writeObject

void writeObject(java.lang.Object o)
                 throws java.io.IOException
Writes an object.

Throws:
java.io.IOException

getPrototype

java.lang.Object getPrototype()
Returns a prototype for the object currently being written. This can be used, to reduce the amount of data written to DOMOutput. For example, by not writing object attributes, which have the same values as the prototype.


Copyright 1996-2009 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.