org.xins.server
Class Element

java.lang.Object
  extended byorg.xins.server.Element
All Implemented Interfaces:
Cloneable

Deprecated. Deprecated since XINS 1.1.0. Use class org.xins.common.xml.Element instead.

public final class Element
extends Object
implements Cloneable

Simple representation of an XML element.

Since:
XINS 1.0.0
Version:
$Revision: 1.26 $ $Date: 2006/08/28 09:12:32 $
Author:
Ernst de Haan

Constructor Summary
Element(String type)
          Deprecated. Constructs a new Element of the specified type.
 
Method Summary
 void add(Element child)
          Deprecated. Adds the specified element as content for this element.
 void addAttribute(String name, String value)
          Deprecated. Adds an attribute.
 Object clone()
          Deprecated. Clones this object.
 PropertyReader getAttributes()
          Deprecated. Gets the set of attributes.
 List getChildren()
          Deprecated. Returns the children of this element.
 Element getParent()
          Deprecated. Returns the parent element.
 String getText()
          Deprecated. Gets the value of the PCDATA element for this element.
 String getType()
          Deprecated. Returns the type of this element.
 void setText(String pcdata)
          Deprecated. Sets the text content for this element.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Element

public Element(String type)
        throws IllegalArgumentException
Deprecated. 
Constructs a new Element of the specified type.

Parameters:
type - the type of the XML element, cannot be null.
Throws:
IllegalArgumentException - if type == null.
Method Detail

getParent

public Element getParent()
Deprecated. 
Returns the parent element.

Returns:
the parent element, or null if this element currently has no parent.

getType

public String getType()
Deprecated. 
Returns the type of this element.

Returns:
the type of this element, cannot be null.

addAttribute

public void addAttribute(String name,
                         String value)
                  throws IllegalArgumentException
Deprecated. 
Adds an attribute. If the attribute was already set the previous value is replaced by the new one.

Parameters:
name - the name of the attribute, cannot be null.
value - the value of the attribute, cannot be null.
Throws:
IllegalArgumentException - if name == null || value == null.

getAttributes

public PropertyReader getAttributes()
Deprecated. 
Gets the set of attributes.

Returns:
the set of attributes, never null.

setText

public void setText(String pcdata)
             throws IllegalArgumentException
Deprecated. 
Sets the text content for this element. Any previous value set will be erased.

Parameters:
pcdata - the text to add, cannot be null.
Throws:
IllegalArgumentException - if pcdata == null.

add

public void add(Element child)
         throws IllegalArgumentException
Deprecated. 
Adds the specified element as content for this element.

Parameters:
child - the element to add, cannot be null, and child.getParent() must be null.
Throws:
IllegalArgumentException - if child == null || child.getParent() != null.

getChildren

public List getChildren()
Deprecated. 
Returns the children of this element. This returns a list of other elements (as Element objects).

Since the content is lazily initialized, null is returned if there is no content.

Returns:
the List of content items, or null.

getText

public String getText()
Deprecated. 
Gets the value of the PCDATA element for this element.

Returns:
The text content for this element, or null if no text content has been specified.

clone

public Object clone()
Deprecated. 
Clones this object. A new Element instance will be returned with the same type, equivalent child elements, equivalent attributes and the same PCDATA content.

Returns:
a new clone of this object, never null.


See http://www.xins.org/.