org.jhotdraw.xml
Interface DOMOutput
-
- All Known Implementing Classes:
- JavaxDOMOutput, NanoXMLDOMOutput
public interface DOMOutputDOMOutput.
Design PatternsAbstract Factory
DOMFactoryis used byDOMInputandDOMOutputfor creating Java objects and DOM elements. Abstract Factory:DOMFactory
Client:DOMInput,DOMOutput.Strategy
DOMFactoryis used byDOMInputandDOMOutputfor reading and writing objects. Client:DOMInput,DOMOutput.
Strategy:DOMFactory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddAttribute(java.lang.String name, boolean value)Adds an attribute to current element of the DOM Document.voidaddAttribute(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.voidaddAttribute(java.lang.String name, double value)Adds an attribute to current element of the DOM Document.voidaddAttribute(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.voidaddAttribute(java.lang.String name, float value)Adds an attribute to current element of the DOM Document.voidaddAttribute(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.voidaddAttribute(java.lang.String name, int value)Adds an attribute to current element of the DOM Document.voidaddAttribute(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.voidaddAttribute(java.lang.String name, java.lang.String value)Adds an attribute to current element of the DOM Document.voidaddAttribute(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.voidaddComment(java.lang.String comment)Adds a comment to the current element of the DOM Document.voidaddText(java.lang.String text)Adds a text to current element of the DOM Document.voidcloseElement()Closes the current element of the DOM Document.java.lang.ObjectgetPrototype()Returns a prototype for the object currently being written.voidopenElement(java.lang.String tagName)Adds a new element to the DOM Document and opens it.voidsetDoctype(java.lang.String doctype)Sets the doctype for the XML document.voidwriteObject(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.IOExceptionWrites 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.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG