|
BEA Systems, Inc. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--weblogic.apache.xerces.dom.NodeImpl | +--weblogic.apache.xerces.dom.ParentNode | +--weblogic.apache.xerces.dom.AttrImpl
Attribute represents an XML-style attribute of an Element. Typically, the allowable values are controlled by its declaration in the Document Type Definition (DTD) governing this kind of document.
If the attribute has not been explicitly assigned a value, but has been declared in the DTD, it will exist and have that default. Only if neither the document nor the DTD specifies a value will the Attribute really be considered absent and have no value; in that case, querying the attribute will return null.
Attributes may have multiple children that contain their data. (XML allows attributes to contain entity references, and tokenized attribute types such as NMTOKENS may have a child for each token.) For convenience, the Attribute object's getValue() method returns the string version of the attribute's value.
Attributes are not children of the Elements they belong to, in the usual sense, and have no valid Parent reference. However, the spec says they _do_ belong to a specific Element, and an INUSE exception is to be thrown if the user attempts to explicitly share them between elements.
Note that Elements do not permit attributes to appear to be shared (see the INUSE exception), so this object's mutability is officially not an issue.
Note: The ownerNode attribute is used to store the Element the Attr node is associated with. Attr nodes do not have parent nodes. Besides, the getOwnerElement() method can be used to get the element node this attribute is associated with.
AttrImpl does not support Namespaces. AttrNSImpl, which inherits from it, does.
This class is based on an implementation from the Apache XML Project. In future releases the XML parser, XSLT processor, and associated classes will likely be updated to be based on a later version of the Apache implementations. Since Apache does not guarantee backwards compatibility between versions of their software, we cannot guarantee backwards compatibility of any of the classes contained in the weblogic.apache package or sub-packages.
AttrNSImpl
, Serialized FormField Summary | |
protected java.lang.String |
name
Attribute name. |
Fields inherited from class weblogic.apache.xerces.dom.ParentNode |
firstChild,
nodeListIndex,
nodeListLength,
nodeListNode,
ownerDocument |
Fields inherited from class weblogic.apache.xerces.dom.NodeImpl |
ELEMENT_DEFINITION_NODE,
FIRSTCHILD,
flags,
IGNORABLEWS,
MUTATION_AGGREGATE,
MUTATION_ALL,
MUTATION_LOCAL,
MUTATION_NONE,
MUTATIONEVENTS,
OWNED,
ownerNode,
READONLY,
SETVALUE,
SPECIFIED,
SYNCCHILDREN,
SYNCDATA |
Constructor Summary | |
protected |
AttrImpl()
|
protected |
AttrImpl(DocumentImpl ownerDocument,
java.lang.String name)
Attribute has no public constructor. |
Method Summary | |
org.w3c.dom.Node |
cloneNode(boolean deep)
|
org.w3c.dom.Element |
getElement()
Deprecated. Previous working draft of DOM Level 2. New method is getOwnerElement(). |
java.lang.String |
getName()
In Attributes, NodeName is considered a synonym for the attribute's Name |
java.lang.String |
getNodeName()
Returns the attribute name |
short |
getNodeType()
A short integer indicating what type of node this is. |
java.lang.String |
getNodeValue()
In Attribute objects, NodeValue is considered a synonym for Value. |
org.w3c.dom.Element |
getOwnerElement()
Returns the element node that this attribute is associated with, or null if the attribute has not been added to an element. |
boolean |
getSpecified()
The "specified" flag is true if and only if this attribute's value was explicitly specified in the original document. |
java.lang.String |
getValue()
The "string value" of an Attribute is its text representation, which in turn is a concatenation of the string values of its children. |
void |
normalize()
|
void |
setNodeValue(java.lang.String value)
Implicit in the rerouting of getNodeValue to getValue is the need to redefine setNodeValue, for symmetry's sake. |
void |
setSpecified(boolean arg)
NON-DOM, for use by parser |
void |
setValue(java.lang.String value)
The DOM doesn't clearly define what setValue(null) means. |
java.lang.String |
toString()
NON-DOM method for debugging convenience |
Methods inherited from class weblogic.apache.xerces.dom.ParentNode |
getChildNodes,
getFirstChild,
getLastChild,
getLength,
getOwnerDocument,
hasChildNodes,
insertBefore,
item,
removeChild,
replaceChild,
setReadOnly,
synchronizeChildren,
synchronizeChildren |
Methods inherited from class weblogic.apache.xerces.dom.NodeImpl |
addEventListener,
appendChild,
changed,
changes,
dispatchEvent,
getAttributes,
getLocalName,
getNamespaceURI,
getNextSibling,
getParentNode,
getPrefix,
getPreviousSibling,
getReadOnly,
getUserData,
hasAttributes,
removeEventListener,
setPrefix,
setUserData,
supports,
synchronizeData |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected java.lang.String name
Constructor Detail |
protected AttrImpl(DocumentImpl ownerDocument, java.lang.String name)
protected AttrImpl()
Method Detail |
public org.w3c.dom.Node cloneNode(boolean deep)
public short getNodeType()
public java.lang.String getNodeName()
public void setNodeValue(java.lang.String value) throws org.w3c.dom.DOMException
public java.lang.String getNodeValue()
getValue()
public java.lang.String getName()
public void setValue(java.lang.String value)
public java.lang.String getValue()
public boolean getSpecified()
public org.w3c.dom.Element getElement()
getOwnerElement()
public org.w3c.dom.Element getOwnerElement()
public void normalize()
public void setSpecified(boolean arg)
public java.lang.String toString()
|
Documentation is available at http://download.oracle.com/docs/cd/E13222_01/wls/docs60 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |