The Element Class

package org.jdom;

public class Element implements Serializable, Cloneable {

    protected           String        name;
    protected transient Namespace     namespace;
    protected           Object        parent;
    protected           AttributeList attributes;
    protected transient List          additionalNamespaces
    protected           List          content;

    protected Element()
    public    Element(String name, Namespace namespace)
    public    Element(String name)
    public    Element(String name, String uri)
    public    Element(String name, String prefix, String uri)

    public String     getName()
    public Namespace  getNamespace()
    public Namespace  getNamespace(String prefix)
    public String     getNamespacePrefix()
    public String     getNamespaceURI()
    public String     getQualifiedName()
    public Element    getParent()
    
    protected Element setParent(Element parent)
    public    boolean isRootElement()
    protected Element setIsRootElement(boolean isRootElement)
    public    Element setChildren(List children)
    protected Element setDocument(Document document)
    public    Element setName(String name)
    public    Element setNamespace(Namespace namespace)
    public    Element setText(String text)

    public String    getText() 
    public String    getTextTrim() 
    public String    getTextNormalize() 
    
    public String    getChildText(String name) 
    public String    getChildTextTrim(String name) 
    public String    getChildTextNormalize(String name) 
    public String    getChildText(String name, Namespace ns) 
    public String    getChildTextTrim(String name, Namespace ns) 
    public String    getChildTextNormalize(String name, Namespace ns) 

    public List      getChildren() 
    public Element   setChildren(List children) 
    public List      getChildren(String name) 
    public List      getChildren(String name, Namespace ns) 
    public Element   getChild(String name, Namespace ns) 
    public Element   getChild(String name) 
    public boolean   removeChild(String name) 
    public boolean   removeChild(String name, Namespace ns) 
    public boolean   removeChildren(String name)
    public boolean   removeChildren(String name, Namespace ns) 
    public boolean   removeChildren() 
    
    public List      getContent()
    public List      getContent(Filter filter)
    public Element   setContent(List newContent)
    public Element   addContent(String text)
    public Element   addContent(Text text)
    public Element   addContent(Element element) 
    public Element   addContent(ProcessingInstruction pi) 
    public Element   addContent(EntityRef entity) 
    public Element   addContent(Comment comment) 
    public Element   addContent(CDATA cdata) 
    public boolean   removeContent(Element element) 
    public boolean   removeContent(CDATA cdata) 
    public boolean   removeContent(ProcessingInstruction pi) 
    public boolean   removeContent(EntityRef entity) 
    public boolean   removeContent(Comment comment) 
    
    public Element   detach()

    public List      getAttributes() 
    public Attribute getAttribute(String name) 
    public Attribute getAttribute(String name, Namespace ns) 
    public String    getAttributeValue(String name) 
    public String    getAttributeValue(String name, Namespace ns) 
    public Element   setAttribute(Attribute attribute) 
    public Element   setAttributes(List attributes) 
    public boolean   removeAttribute(String name) 
    public boolean   removeAttribute(String name, Namespace ns) 

    public void addNamespaceDeclaration(Namespace additionalNamespace)
    public void removeNamespaceDeclaration(Namespace additionalNamespace)
    public List getAdditionalNamespaces()
    
    ///////////////////////////////////////
    // Basic Utility Methods
    /////////////////////////////////////// 
    public final String  toString()
    public final boolean equals(Object ob)
    public final int     hashCode()
    public final Object  clone()
    
}

Previous | Next | Top | Cafe con Leche

Copyright 2000-2003 Elliotte Rusty Harold
elharo@metalab.unc.edu
Last Modified April 19, 2002