dk.brics.misc
Class XElement

java.lang.Object
  extended by org.jdom.Content
      extended by org.jdom.Element
          extended by dk.brics.misc.XElement
All Implemented Interfaces:
Serializable, Cloneable, Parent

public class XElement
extends Element

Element extended with origin information.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.jdom.Element
additionalNamespaces, name, namespace
 
Fields inherited from class org.jdom.Content
parent
 
Constructor Summary
XElement(String name, Namespace namespace, Element origin)
          Constructs a new XElement.
XElement(String name, Namespace namespace, Origin origin)
          Constructs a new XElement.
 
Method Summary
 Origin getOrigin()
          Returns origin.
static Origin getOrigin(Element e)
          Returns origin of the given element, if present.
 void setOrigin(Origin origin)
          Sets the origin.
 
Methods inherited from class org.jdom.Element
addContent, addContent, addContent, addContent, addContent, addNamespaceDeclaration, clone, cloneContent, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttribute, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setName, setNamespace, setText, toString
 
Methods inherited from class org.jdom.Content
detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jdom.Parent
getDocument, getParent
 

Constructor Detail

XElement

public XElement(String name,
                Namespace namespace,
                Element origin)
Constructs a new XElement.

Parameters:
name - local name
namespace - namespace
origin - get origin from this element

XElement

public XElement(String name,
                Namespace namespace,
                Origin origin)
Constructs a new XElement.

Parameters:
name - local name
namespace - namespace
origin - (null if not applicable)
Method Detail

getOrigin

public Origin getOrigin()
Returns origin.

Returns:
origin (null if not applicable)

getOrigin

public static Origin getOrigin(Element e)
Returns origin of the given element, if present. An element may contain an attribute named origin from the namespace http://www.brics.dk/xml/origin with a value of the form file:line:column for specifying the origin of the element. If absent, the input URL is used as origin file.

Parameters:
e - element
Returns:
origin, null if not available

setOrigin

public void setOrigin(Origin origin)
Sets the origin.

Parameters:
origin - origin


Copyright © 2005-2010 Anders Møller.