dk.brics.xact
Class Element

java.lang.Object
  extended by dk.brics.xact.Node
      extended by dk.brics.xact.XML
          extended by dk.brics.xact.TempNode
              extended by dk.brics.xact.Element
All Implemented Interfaces:
ToXMLable

public class Element
extends TempNode

Element node.


Constructor Summary
Element(String localname)
          Constructs a new empty element node.
Element(String localname, Origin origin)
          Constructs a new empty element node.
Element(String namespace, String localname)
          Constructs a new empty element node.
Element(String namespace, String localname, AttrNode firstattribute, XML firstchild, NamespaceDecl firstnsdecl, XML nextsibling, Origin origin)
          Constructs a new element node.
Element(String namespace, String localname, Origin origin)
          Constructs a new empty element node.
 
Method Summary
 Element copy(AttrNode firstattribute, XML firstchild, XML nextsibling)
          Returns a copy of this node with the given attributes, children, and next sibling.
 Element copy(XML nextsibling)
          Returns a copy of this node with the given next sibling.
 String getAttribute(String localname)
          Returns the value of the attribute of the given name, or null if not present.
 String getAttribute(String namespace, String localname)
          Returns the value of the attribute of the given name, or null if not present.
 String getExpandedName()
          Returns the expanded name.
 AttrNode getFirstAttr()
          Returns the first attribute-like node.
 Attribute getFirstAttribute()
          Returns the first attribute node.
 XML getFirstChild()
          Returns the first child node.
 NamespaceDecl getFirstNamespaceDecl()
          Returns the first namespace declaration node.
 String getLocalName()
          Returns the local name.
 String getNamespace()
          Returns the namespace URI.
 String toString()
          Returns a description of this node.
 
Methods inherited from class dk.brics.xact.TempNode
getNextSibling
 
Methods inherited from class dk.brics.xact.XML
analyze, append, appendContent, appendContent, byteLength, close, concat, concat, gapify, gapify, get, getElement, getElementByID, getElements, getFirstElement, getNamespaceMap, getNumber, getNumber, getString, getString, getStrings, getThreadNamespaceMap, has, insertAfter, insertBefore, loadXMLSchema, loadXMLSchema, parseDocument, parseDocument, parseDocument, parseDocument, parseTemplate, parseTemplate, parseTemplate, parseTemplate, parseTemplateResource, parseTemplateResource, plug, plugList, plugWrap, prepend, prependContent, prependContent, remove, set, set, set, set, setContent, setContent, toDocument, toDocument, toDocument, toDocument, toTemplate, toTemplate, toTemplate, toXML, toXML, validate, visitBy, visitBy
 
Methods inherited from class dk.brics.xact.Node
asAttribute, asComment, asElement, asNamespaceDecl, asProcessingInstruction, asText, getOrigin, isAttribute, isComment, isElement, isNamespaceDecl, isProcessingInstruction, isText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Element

public Element(String localname)
Constructs a new empty element node.


Element

public Element(String localname,
               Origin origin)
Constructs a new empty element node.


Element

public Element(String namespace,
               String localname)
Constructs a new empty element node.


Element

public Element(String namespace,
               String localname,
               AttrNode firstattribute,
               XML firstchild,
               NamespaceDecl firstnsdecl,
               XML nextsibling,
               Origin origin)
Constructs a new element node.


Element

public Element(String namespace,
               String localname,
               Origin origin)
Constructs a new empty element node.

Method Detail

copy

public Element copy(AttrNode firstattribute,
                    XML firstchild,
                    XML nextsibling)
Returns a copy of this node with the given attributes, children, and next sibling.


copy

public Element copy(XML nextsibling)
Returns a copy of this node with the given next sibling.

Specified by:
copy in class TempNode

getAttribute

public String getAttribute(String localname)
Returns the value of the attribute of the given name, or null if not present.

Overrides:
getAttribute in class XML
See Also:
XML.get(String), XML.getAttribute(String, String)

getAttribute

public String getAttribute(String namespace,
                           String localname)
Returns the value of the attribute of the given name, or null if not present.

Overrides:
getAttribute in class XML
See Also:
XML.get(String), XML.getAttribute(String)

getExpandedName

public String getExpandedName()
Returns the expanded name.


getFirstAttr

public AttrNode getFirstAttr()
Returns the first attribute-like node.


getFirstAttribute

public Attribute getFirstAttribute()
Returns the first attribute node.


getFirstChild

public XML getFirstChild()
Returns the first child node.


getFirstNamespaceDecl

public NamespaceDecl getFirstNamespaceDecl()
Returns the first namespace declaration node.


getLocalName

public String getLocalName()
Returns the local name.


getNamespace

public String getNamespace()
Returns the namespace URI.


toString

public String toString()
Description copied from class: Node
Returns a description of this node.

Specified by:
toString in class Node


Copyright © 2005-2011 Aarhus University.