com.nwoods.jgo
Interface DomElement

All Superinterfaces:
DomNode
All Known Implementing Classes:
DefaultElement

public interface DomElement
extends DomNode

An interface similar to org.w3c.dom.Element used for SVG XML serialization.

This interface allows the com.nwoods.jgo package to provide methods that manipulate org.w3c.dom.Element objects while not requiring the org.w3c.dom.Element class to be present in order to build com.nwoods.jgo.


Method Summary
 java.lang.String getAttribute(java.lang.String name)
          Retrieves an attribute value by name.
 java.lang.String getLocalName()
          Get the local name of the element.
 java.lang.String getNamespaceURI()
          Get the NamespaceURI of the element.
 java.lang.String getPrefix()
          Get the prefix of the element.
 java.lang.String getSubAttribute(java.lang.String attribute, java.lang.String subAttribute)
          Parses the attribute to return the value following "attribute:" and preceding either ";" or the end of the string.
 java.lang.String getTagName()
          Get the tag name of the element.
 void setAttribute(java.lang.String name, java.lang.String value)
          Adds a new attribute.
 
Methods inherited from interface com.nwoods.jgo.DomNode
appendChild, elementCast, getFirstChild, getFirstChildElement, getFirstChildText, getNextSibling, getNextSiblingElement, getNextSiblingJGoClassElement, getNextSiblingText, getParentNode, isElement
 

Method Detail

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
Adds a new attribute. If an attribute with that name is already present in the element, its value is changed to be that of the value parameter. This value is a simple string; it is not parsed as it is being set. So any markup (such as syntax to be recognized as an entity reference) is treated as literal text, and needs to be appropriately escaped by the implementation when it is written out.

Parameters:
name - the name of the attribute to create or alter.
value - the value to set in string form

getAttribute

public java.lang.String getAttribute(java.lang.String name)
Retrieves an attribute value by name.

Parameters:
name - of the attribute to retrieve.
Returns:
the attribute value as a string, or the empty string if that attribute does not have a specified or default value

getSubAttribute

public java.lang.String getSubAttribute(java.lang.String attribute,
                                        java.lang.String subAttribute)
Parses the attribute to return the value following "attribute:" and preceding either ";" or the end of the string.

Parameters:
attribute - the attribute string to parse.
subAttribute - the subattribute whose value is to be returned.
Returns:
the subattributre value as a string, or the empty string if that subattribute does not have a specified value

getTagName

public java.lang.String getTagName()
Get the tag name of the element.

Returns:
the tag name of the element.

getLocalName

public java.lang.String getLocalName()
Get the local name of the element. The local name of the element is the element name minus any namespace previx or URI.

Returns:
the local name of the element.

getNamespaceURI

public java.lang.String getNamespaceURI()
Get the NamespaceURI of the element.

Returns:
the namespace URI of the element.

getPrefix

public java.lang.String getPrefix()
Get the prefix of the element. The prefix is the namespace prefix which precedes the colon in an element name.

Returns:
the tag name of the element or null if no prefix.