|
XML for Java Compatibility API 2.0.13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.xml.parser.Child | +--com.ibm.xml.parser.Parent | +--com.ibm.xml.parser.TXAttribute
The TXAttribute
class implements the Attr
interface
as defined by the Document Object Model (DOM),
and implements the namespace interface as defined by the W3C.
Attr
Nodes represent an attribute in an Element
object;
in other words, an
attribute name and an attribute object. Typically the allowable values for the
attribute are defined in a document type definition.
The attribute's effective value is determined as follows: if the attribute has been explicitly assigned any value, that value is the attribute's effective value. Otherwise, if there is a declaration for this attribute, and that declaration includes a default value, then that default value is the attribute's effective value. Otherwise, the attribute has no effective value.
In XML, the value of an attribute is represented by a list because the value can be an arbitrarily complex list of entity references.
Attr
,
Namespace
,
Parent
, Serialized FormFields inherited from class com.ibm.xml.parser.Child |
ATTDEF,
ATTLIST,
ELEMENT_DECL,
NAME_ATTDEF,
NAME_ATTLIST,
NAME_CDATA,
NAME_COMMENT,
NAME_DOCFRAGMENT,
NAME_DOCUMENT,
NAME_ELEMENT_DECL,
NAME_PSEUDONODE,
NAME_TEXT,
PSEUDONODE |
Constructor Summary | |
TXAttribute(java.lang.String name,
java.lang.String value)
Constructor. |
Method Summary | |
void |
acceptPost(Visitor visitor)
Implements the accept operation of the visitor design pattern when the end of a TXAttribute Node is recognized when traversing the document object tree. |
void |
acceptPre(Visitor visitor)
Implements the accept operation of the visitor design pattern when the start of a TXAttribute Node is recognized when traversing the document object tree. |
protected void |
checkChildType(org.w3c.dom.Node child)
Check whether child is allowed to be insered in this node or not. |
java.lang.Object |
clone()
Clone this TXAttribute Node using the appropriate factory. |
org.w3c.dom.Node |
cloneNode(boolean deep)
This method is defined by DOM. |
java.lang.String |
createExpandedName()
Returns an expanded name of this attribute. |
boolean |
equals(org.w3c.dom.Node arg,
boolean deep)
|
boolean |
equals(java.lang.Object object)
Returns whether the specified object matches this attribute Node. |
java.lang.String |
getName()
Returns the qualified name of this attribute. |
org.w3c.dom.Node |
getNextSibling()
Returns null. |
java.lang.String |
getNodeName()
This method is defined by DOM. |
short |
getNodeType()
Returns that this object is an Attribute Node. |
java.lang.String |
getNodeValue()
Returns the value of this attribute. |
java.lang.String |
getNSLocalName()
Returns the local name of the Namespace. |
java.lang.String |
getNSName()
Returns the Namespace URI. |
org.w3c.dom.Node |
getOwnerElement()
Reuurns owner element node. |
org.w3c.dom.Node |
getParentNode()
Returns null. |
org.w3c.dom.Node |
getPreviousSibling()
Returns null. |
boolean |
getSpecified()
Returns whether this attribute was explicitly given a value in the original document (=true), or was allowed to default according to the DTD specification. |
int |
getType()
Returns the type of the attribute. |
java.lang.String[] |
getTypedValue()
Returns the type values of the attribute. |
java.lang.String |
getUniversalName()
Deprecated. Use createExpandedName(). |
java.lang.String |
getValue()
Returns the value of this attribute. |
int |
hashCode()
|
protected void |
realInsert(org.w3c.dom.Node child,
int index)
Insert a Node into the specified position. |
org.w3c.dom.Node |
removeChild(org.w3c.dom.Node oldChild)
Removes the child Node indicated by oldChild from this Nodes list of children, and returns it. |
org.w3c.dom.Node |
replaceChild(org.w3c.dom.Node newChild,
org.w3c.dom.Node oldChild)
Replaces the child Node oldChild with newChild in this Node's list of children, and return the oldChild Node. |
void |
setNodeValue(java.lang.String value)
Sets the value of this attribute. |
void |
setSpecified(boolean specified)
Sets whether this attribute was explicitly given a value in the original document (=true), or was allowed to default according to the DTD specification. |
void |
setType(int type,
java.lang.String[] typedValue)
Sets the type and type values of the attribute. |
void |
setValue(java.lang.String value)
Sets the value of this attribute. |
java.lang.String |
toString()
Returns the value of this attribute. |
java.lang.String |
toXMLString()
Returns this Node in XML format, in name="value" format,
and using the default character encoding. |
java.lang.String |
toXMLString(java.lang.String encoding)
Returns this Node in XML format, in name="value" format,
and using the specified character encoding. |
Methods inherited from class com.ibm.xml.parser.Parent |
addElement,
appendChild,
elements,
expandEntityReferences,
getChildNodes,
getChildrenArray,
getFirstChild,
getFirstWithoutReference,
getLastChild,
getLastWithoutReference,
getText,
hasChildNodes,
insert,
insertAfter,
insertBefore,
insertFirst,
insertLast,
processAfterRemove |
Methods inherited from class com.ibm.xml.parser.Child |
clearDigest,
getAttributes,
getDigest,
getFactory,
getNextWithoutReference,
getOwnerDocument,
getParentWithoutReference,
getPreviousWithoutReference,
getUserData,
makeXPointer,
print,
print,
searchAncestors,
searchAncestors,
setFactory,
setUserData,
toXMLString,
toXMLString |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public TXAttribute(java.lang.String name, java.lang.String value)
name
- The name of this attribute.value
- The string value of this attribute.Method Detail |
public java.lang.Object clone()
TXAttribute
Node using the appropriate factory. Note that this
method does not clone Parent or sibling Nodes.
This method is defined by Child
.
TXAttribute
Node.Child.clone()
public org.w3c.dom.Node cloneNode(boolean deep)
This method is defined by DOM.
public boolean equals(org.w3c.dom.Node arg, boolean deep)
public short getNodeType()
This method is defined by DOM.
Attr
Node indicator.public java.lang.String getNodeName()
This method is defined by DOM.
getName()
public java.lang.String getName()
This method is defined by DOM.
public java.lang.String getValue()
This method is defined by DOM.
getTypedValue()
,
setValue(java.lang.String)
,
toString()
public java.lang.String getNodeValue()
This method is defined by DOM.
public java.lang.String toString()
getValue()
,
toXMLString(java.lang.String)
public void setValue(java.lang.String value)
value
- The value of this attribute.getValue()
,
setNodeValue(java.lang.String)
,
getTypedValue()
public void setNodeValue(java.lang.String value)
This method is defined by DOM.
value
- The value of this attribute.getNodeValue()
,
getValue()
,
setValue(java.lang.String)
,
getTypedValue()
protected void realInsert(org.w3c.dom.Node child, int index) throws LibraryException
child
- The Node being inserted. Text
or EntityReference
.index
- 0-based index into the list of children.public org.w3c.dom.Node replaceChild(org.w3c.dom.Node newChild, org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
DOMException
is thrown.
This method is defined by DOM.
newChild
- The child Node to replace with. Text
or EntityReference
.oldChild
- The child Node being replaced.removeChild(org.w3c.dom.Node)
public org.w3c.dom.Node removeChild(org.w3c.dom.Node oldChild) throws org.w3c.dom.DOMException
DOMException
is thrown.
This method is defined by DOM.
oldChild
- The child Node being removed.replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
public boolean getSpecified()
setSpecified(boolean)
public void setSpecified(boolean specified)
specified
- =true if value explicitly defined; otherwise, false.getSpecified()
public java.lang.String getNSLocalName()
This method is defined by Namespace.
Namespace
public java.lang.String getNSName()
This method is defined by Namespace.
Parser.setProcessNamespace(boolean)
,
Namespace
public java.lang.String getUniversalName()
getNSName()+":"+getNSLocalName()
;
otherwise, return getNSLocalName()
.getNSName()
,
getNSLocalName()
,
Parser.setProcessNamespace(boolean)
public java.lang.String createExpandedName()
TXDocument#expandedNameSeparator
.
This method is defined by Namespace.
TXDocument.expandedNameSeparator
,
Parser.setProcessNamespace(boolean)
public int getType()
AttDef
.AttDef
,
setType(int, java.lang.String[])
,
getTypedValue()
public java.lang.String[] getTypedValue()
getTypeValue()[0] = getValue()
when getType() = CDATA, NOTATION, ID, IDREF, ENTITY, NMTOKEN
;
otherwise, multiple values are returned.AttDef
,
setType(int, java.lang.String[])
,
getType()
public void setType(int type, java.lang.String[] typedValue)
type
- The attribute type as defined by AttDef
.typedValue
- getTypeValue()[0] = getValue()
when getType() = CDATA, NOTATION, ID, IDREF, ENTITY, NMTOKEN
;
otherwise, multiple values are returned.AttDef
,
setType(int, java.lang.String[])
,
getType()
,
getTypedValue()
public java.lang.String toXMLString(java.lang.String encoding)
name="value"
format,
and using the specified character encoding.encoding
- Java character encoding to use.name="value"
.Parent.getText()
public java.lang.String toXMLString()
name="value"
format,
and using the default character encoding.name="value"
.Parent.getText()
public boolean equals(java.lang.Object object)
public int hashCode()
public void acceptPre(Visitor visitor) throws java.lang.Exception
visitor
- The implemention of the Visitor operation (toXMLString, digest, ...)Visitor
,
TreeTraversal
,
NonRecursivePreorderTreeTraversal
,
TreeTraversalException
public void acceptPost(Visitor visitor) throws java.lang.Exception
visitor
- The implemention of the Visitor operation (toXMLString, digest, ...)Visitor
,
TreeTraversal
,
NonRecursivePreorderTreeTraversal
,
TreeTraversalException
public org.w3c.dom.Node getOwnerElement()
In this DOM implementation, any attribute node is not shared in more than one element.
public org.w3c.dom.Node getParentNode()
public org.w3c.dom.Node getPreviousSibling()
public org.w3c.dom.Node getNextSibling()
protected void checkChildType(org.w3c.dom.Node child) throws org.w3c.dom.DOMException
|
XML for Java Compatibility API 2.0.13 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |