|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectelectric.xml.Node
electric.xml.Attribute
Attribute represents an XML attribute. Once constructed, you can change its value but not its name. When you add an Attribute to an Element, the attribute's name is automatically resolved. If you add/remove an Attribute that declares a namespace, the Element's namespaces are automatically updated.
Field Summary |
Fields inherited from class electric.xml.Node |
list, next, prev |
Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
Fields inherited from interface electric.xml.IXMLConstants |
ATTLIST_START, ATTLIST_STOP, CDATA, CDATA_START, CDATA_STOP, CLOSE_TAG, COLON, COMMENT_START, COMMENT_STOP, DOCTYPE_START, DOCTYPE_STOP, ELEMENTDECL_START, ELEMENTDECL_STOP, ENCODING, ENTITYDECL_START, ENTITYDECL_STOP, ID, ID_CASE, INSTRUCTION_START, INSTRUCTION_STOP, NEGATIVE_INFINITY, NOT_A_NUMBER, NOTATIONDECL_START, NOTATIONDECL_STOP, NULL, OPEN_TAG, POSITIVE_INFINITY, PUBLIC, SPECIALS, STANDALONE, SUBSTITUTES, SYSTEM, UNDEFINED, VERSION, XML, XML_NAMESPACE, XMLDECL_START, XMLDECL_STOP, XMLNS, XMLNS_NAMESPACE |
Fields inherited from interface electric.xml.IDOMConstants |
CDATA_SECTION_NAME, COMMENT_NAME, CORE, DOCUMENT_FRAGMENT_NAME, DOCUMENT_NAME, HIERARCHY_REQUEST_ERR, TEXT_NAME |
Constructor Summary | |
Attribute()
|
|
Attribute(Attribute attribute)
Construct a copy of the specified attribute. |
|
Attribute(java.lang.String name,
java.lang.String value)
Construct an Attribute with the specified name and value. |
|
Attribute(java.lang.String prefix,
java.lang.String name,
java.lang.String value)
Construct an Attribute with the specified namespace prefix, name and value. |
Method Summary | |
java.lang.Object |
clone()
Return a clone of this Attribute. |
org.w3c.dom.Node |
cloneNode(boolean deep)
Return a clone of this attribute. |
boolean |
equals(java.lang.Object object)
Return true if the object is an Attribute with the same name and value as myself. |
Element |
getElement()
Return the element that I'm an attribute of. |
java.lang.String |
getLocalName()
Return my local name. |
java.lang.String |
getName()
Return my name. |
java.lang.String |
getNamespace()
Return my namespace, or null if there is none. |
java.lang.String |
getNamespaceURI()
Return the namespace URI of this node, or null if it is unspecified. |
java.lang.String |
getNodeName()
Return the name of this attribute. |
short |
getNodeType()
Return ATTRIBUTE_NODE. |
java.lang.String |
getNodeValue()
Return the value of this attribute. |
org.w3c.dom.Document |
getOwnerDocument()
Return the Element node this attribute is attached to or null if this attribute is not in use. |
org.w3c.dom.Element |
getOwnerElement()
Return the Element node this attribute is attached to or null if this attribute is not in use. |
java.lang.String |
getPrefix()
Return my prefix, or null if there is none. |
java.lang.String |
getQName()
Return my qualified name. |
static char |
getQuoteCharacter()
|
boolean |
getRaw()
Return my raw mode. |
boolean |
getSpecified()
If this attribute was explicitly given a value in the original document, this is true; otherwise, it is false |
java.lang.String |
getValue()
Return my value. |
int |
hashCode()
Return my hash code. |
boolean |
hasName(java.lang.String namespace,
java.lang.String name)
Return true if my namespace and name match the specified values. |
void |
initialize()
|
void |
initialize(java.lang.String prefix,
java.lang.String name,
java.lang.String value)
|
boolean |
isNamespace()
Return true if I am a namespace declaration. |
void |
read(NodeReader reader)
|
void |
setNodeValue(java.lang.String nodeValue)
Set the value of this attribute. |
void |
setPrefix(java.lang.String prefix)
Set the namespace prefix of this attribute. |
static void |
setQuoteCharacter(char quoteCharacter)
|
void |
setRaw(boolean flag)
Set my raw mode. |
void |
setValue(java.lang.String value)
Set my value. |
int |
size()
|
java.lang.String |
toString()
Return my description. |
void |
write(NodeWriter writer)
Write myself to the specified writer. |
Methods inherited from class electric.xml.Node |
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNextSiblingNode, getNode, getNode, getNodes, getParentNode, getPreviousSibling, getPreviousSiblingNode, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, remove, removeChild, replaceChild, setNextSiblingNode, setPreviousSiblingNode |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
appendChild, getAttributes, getChildNodes, getFirstChild, getLastChild, getNextSibling, getParentNode, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild |
Constructor Detail |
public Attribute()
public Attribute(java.lang.String name, java.lang.String value)
name
- The name.value
- The value.public Attribute(java.lang.String prefix, java.lang.String name, java.lang.String value)
prefix
- The namespace prefix.name
- The name.value
- The value.public Attribute(Attribute attribute)
attribute
- The Attribute to copy.Method Detail |
public boolean equals(java.lang.Object object)
object
- The object to compare.public int hashCode()
public java.lang.String toString()
public java.lang.Object clone()
public java.lang.String getLocalName()
getLocalName
in interface org.w3c.dom.Node
getLocalName
in class Node
public java.lang.String getName()
getName
in interface INamed
public java.lang.String getQName()
public java.lang.String getPrefix()
getPrefix
in interface org.w3c.dom.Node
getPrefix
in class Node
public java.lang.String getNamespace()
getNamespace
in interface IQNamed
public boolean isNamespace()
public boolean hasName(java.lang.String namespace, java.lang.String name)
namespace
- The namespace.name
- The name.public java.lang.String getValue()
getValue
in interface org.w3c.dom.Attr
public void setValue(java.lang.String value)
setValue
in interface org.w3c.dom.Attr
value
- The new value.public void initialize(java.lang.String prefix, java.lang.String name, java.lang.String value)
prefix
- name
- value
- public void initialize()
public Element getElement()
public void setRaw(boolean flag)
flag
- The new raw value.public boolean getRaw()
public int size()
size
in class Node
public void read(NodeReader reader) throws java.io.IOException, NamespaceException
read
in class Node
reader
-
java.io.IOException
NamespaceException
public void write(NodeWriter writer) throws java.io.IOException
write
in class Node
writer
- The nodeWriter.
java.io.IOException
- If an I/O exception occurs.public short getNodeType()
getNodeType
in interface org.w3c.dom.Node
getNodeType
in class Node
public java.lang.String getNodeName()
getNodeName
in interface org.w3c.dom.Node
getNodeName
in class Node
public java.lang.String getNodeValue()
getNodeValue
in interface org.w3c.dom.Node
getNodeValue
in class Node
public void setNodeValue(java.lang.String nodeValue)
setNodeValue
in interface org.w3c.dom.Node
setNodeValue
in class Node
nodeValue
- The new value.public void setPrefix(java.lang.String prefix)
setPrefix
in interface org.w3c.dom.Node
setPrefix
in class Node
prefix
- The new namespace prefix.public org.w3c.dom.Node cloneNode(boolean deep)
cloneNode
in interface org.w3c.dom.Node
cloneNode
in class Node
deep
- If true, return a deep clone.public org.w3c.dom.Document getOwnerDocument()
getOwnerDocument
in interface org.w3c.dom.Node
getOwnerDocument
in class Node
public java.lang.String getNamespaceURI()
getNamespaceURI
in interface org.w3c.dom.Node
getNamespaceURI
in class Node
public org.w3c.dom.Element getOwnerElement()
getOwnerElement
in interface org.w3c.dom.Attr
public boolean getSpecified()
getSpecified
in interface org.w3c.dom.Attr
public static char getQuoteCharacter()
public static void setQuoteCharacter(char quoteCharacter)
quoteCharacter
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |