org.vectomatic.dom.svg
Class OMAttr

java.lang.Object
  extended by org.vectomatic.dom.svg.OMNode
      extended by org.vectomatic.dom.svg.OMAttr
All Implemented Interfaces:
com.google.gwt.event.shared.HasHandlers

public class OMAttr
extends OMNode

Wrapper class for DOM Attr

Author:
laaglu

Field Summary
 
Fields inherited from class org.vectomatic.dom.svg.OMNode
eventBus, ot
 
Constructor Summary
protected OMAttr(Attr ot)
          Constructor
 
Method Summary
 Attr getAttr()
          Returns the wrapped Attr
 String getName()
          Returns the name of this attribute.
 String getValue()
          On retrieval, the value of the attribute is returned as a string.
 boolean isId()
          Returns whether this attribute is known to be of type ID (i.e.
 void setValue(String value)
          On retrieval, the value of the attribute is returned as a string.
 
Methods inherited from class org.vectomatic.dom.svg.OMNode
addDomHandler, addHandler, appendChild, cleanup, cloneNode, convert, convertList, dispatch, fireEvent, getChildNodes, getEventBus, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNode, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, normalize, removeChild, replaceChild, setNodeValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OMAttr

protected OMAttr(Attr ot)
Constructor

Parameters:
ot - the Attr to wrap.
Method Detail

getAttr

public Attr getAttr()
Returns the wrapped Attr

Returns:
the wrapped Attr

getName

public final String getName()
Returns the name of this attribute. If OMNode.localName is different from null, this attribute is a qualified name.

Returns:
the attribute name

getValue

public final String getValue()
On retrieval, the value of the attribute is returned as a string. Character and general entity references are replaced with their values. See also the method getAttribute on the OMElement interface.
On setting, this creates a OMText node with the unparsed contents of the string, i.e. any characters that an XML processor would recognize as markup are instead treated as literal text. See also the method OMElement.setAttribute().
Some specialized implementations, such as some [SVG 1.1] implementations, may do normalization automatically, even after mutation; in such case, the value on retrieval may differ from the value on setting.

Returns:
the attribute value

setValue

public final void setValue(String value)
On retrieval, the value of the attribute is returned as a string. Character and general entity references are replaced with their values. See also the method getAttribute on the OMElement interface.
On setting, this creates a OMText node with the unparsed contents of the string, i.e. any characters that an XML processor would recognize as markup are instead treated as literal text. See also the method OMElement.setAttribute().
Some specialized implementations, such as some [SVG 1.1] implementations, may do normalization automatically, even after mutation; in such case, the value on retrieval may differ from the value on setting.

Parameters:
value - the attribute value
Throws:
DOMException - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.

isId

public final boolean isId()
Returns whether this attribute is known to be of type ID (i.e. to contain an identifier for its owner element) or not. When it is and its value is unique, the ownerElement of this attribute can be retrieved using the method OMDocument.getElementById . The implementation could use several ways to determine if an attribute node is known to contain an identifier:
If validation occurred while invoking OMDocument.normalizeDocument(), all user-determined ID attributes are reset and all attribute nodes ID information are then reevaluated in accordance to the schema used. As a consequence, if the OMAttr.schemaTypeInfo attribute contains an ID type, isId will always return true.

Since:
DOM Level 3


Copyright © 2012. All Rights Reserved.