JHotDraw 7.6

org.jhotdraw.xml
Interface DOMInput

All Known Implementing Classes:
JavaxDOMInput, NanoXMLDOMInput

public interface DOMInput

DOMInput.


Design Patterns

Abstract Factory
DOMFactory is used by DOMInput and DOMOutput for creating Java objects and DOM elements. Abstract Factory: DOMFactory
Client: DOMInput, DOMOutput.

Strategy
DOMFactory is used by DOMInput and DOMOutput for reading and writing objects. Client: DOMInput, DOMOutput.
Strategy: DOMFactory.

Version:
$Id: DOMInput.java 717 2010-11-21 12:30:57Z rawcoder $
Author:
Werner Randelshofer

Method Summary
 void closeElement()
          Closes the current element of the DOM Document.
 boolean getAttribute(java.lang.String name, boolean defaultValue)
          Gets an attribute of the current element of the DOM Document.
 double getAttribute(java.lang.String name, double defaultValue)
          Gets an attribute of the current element of the DOM Document.
 int getAttribute(java.lang.String name, int defaultValue)
          Gets an attribute of the current element of the DOM Document.
 java.lang.String getAttribute(java.lang.String name, java.lang.String defaultValue)
          Gets an attribute of the current element of the DOM Document.
 int getElementCount()
          Returns the number of child elements of the current element.
 int getElementCount(java.lang.String tagName)
          Returns the number of child elements with the specified tag name of the current element.
 java.util.List<java.lang.String> getInheritedAttribute(java.lang.String name)
          Gets an attribute of the current element of the DOM Document and of all parent DOM elements.
 java.lang.String getTagName()
          Returns the tag name of the current element.
 java.lang.String getText()
          Gets the text of the current element of the DOM Document.
 java.lang.String getText(java.lang.String defaultValue)
          Gets the text of the current element of the DOM Document.
 void openElement(int index)
          Opens the element with the specified index and makes it the current node.
 void openElement(java.lang.String tagName)
          Opens the last element with the specified name and makes it the current node.
 void openElement(java.lang.String tagName, int index)
          Opens the element with the specified name and index and makes it the current node.
 java.lang.Object readObject()
          Reads an object from the current element.
 java.lang.Object readObject(int index)
          Reads an object from the current element.
 

Method Detail

getTagName

java.lang.String getTagName()
Returns the tag name of the current element.


getAttribute

@Nullable
java.lang.String getAttribute(java.lang.String name,
                                       @Nullable
                                       java.lang.String defaultValue)
Gets an attribute of the current element of the DOM Document.


getText

@Nullable
java.lang.String getText()
Gets the text of the current element of the DOM Document.


getText

@Nullable
java.lang.String getText(@Nullable
                                  java.lang.String defaultValue)
Gets the text of the current element of the DOM Document.


getAttribute

int getAttribute(java.lang.String name,
                 int defaultValue)
Gets an attribute of the current element of the DOM Document.


getAttribute

double getAttribute(java.lang.String name,
                    double defaultValue)
Gets an attribute of the current element of the DOM Document.


getAttribute

boolean getAttribute(java.lang.String name,
                     boolean defaultValue)
Gets an attribute of the current element of the DOM Document.


getInheritedAttribute

java.util.List<java.lang.String> getInheritedAttribute(java.lang.String name)
Gets an attribute of the current element of the DOM Document and of all parent DOM elements.


getElementCount

int getElementCount()
Returns the number of child elements of the current element.


getElementCount

int getElementCount(java.lang.String tagName)
Returns the number of child elements with the specified tag name of the current element.


openElement

void openElement(int index)
                 throws java.io.IOException
Opens the element with the specified index and makes it the current node.

Throws:
java.io.IOException

openElement

void openElement(java.lang.String tagName)
                 throws java.io.IOException
Opens the last element with the specified name and makes it the current node.

Throws:
java.io.IOException

openElement

void openElement(java.lang.String tagName,
                 int index)
                 throws java.io.IOException
Opens the element with the specified name and index and makes it the current node.

Throws:
java.io.IOException

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.

readObject

java.lang.Object readObject()
                            throws java.io.IOException
Reads an object from the current element.

Throws:
java.io.IOException

readObject

java.lang.Object readObject(int index)
                            throws java.io.IOException
Reads an object from the current element.

Throws:
java.io.IOException

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