All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.xml.parser.TXElement

java.lang.Object
   |
   +----com.ibm.xml.parser.Child
           |
           +----com.ibm.xml.parser.Parent
                   |
                   +----com.ibm.xml.parser.TXElement

public class TXElement
extends Parent
implements Element

Constructor Index

 o TXElement(String)
Make new Element instance.
 o TXElement(String, String, String)
Make new Element instance.

Method Index

 o clone()
Clone this object and children.
 o cloneWithoutChildren()
Clone this object without children.
 o elementAt(int)
Return a child at specified position.
 o getAttribute(String)
Return value of specified attribute name.
 o getAttributeArray()
Return array of Attribute.
 o getAttributeInstance(String)
Return an attribute instance.
 o getAttributes()
[DOM]
 o getLanguage()
Return language ID (value of xml:lang attribute).
 o getName()
Return a name of this element.
 o getNameSpace()
Return namespace.
 o getNodeType()
[DOM] Return Node.NodeType.ELEMENT
 o getQName()
Return qualified name.
 o getTagName()
[DOM] Return a name of this element.
 o getText()
Make a string consisted of all child text.
 o getUserData()
Return user data.
 o isEmpty()
Return if this element is empty.
 o isPreserveSpace()
Return if parser preserves spaces of texts and print() preserves spaces.
 o print(PrintWriter, int)
Print to Writer.
 o print(PrintWriter, String, int)
Print to Writer.
 o ripen()
Called by DefaultElementFactory.
 o searchAncestors(String)
Search ancestors for an element.
 o searchChildren(String)
Search children for an element.
 o searchChildrenAll(String)
Search children for elements.
 o setAttribute(Attribute)
[DOM] Set an attribute.
 o setAttribute(String, String)
Add an attribute.
 o setAttribute(TXAttribute)
Add an attribute.
 o setAttributes(AttributeList)
[DOM]
 o setPreserveSpace(boolean)
Set if parser preserves spaces of texts and print() preserves spaces.
 o setTagName(String)
[DOM]
 o setUserData(Object)
Set user data.
 o size()
Return number of children.
 o toString()
Make a string representation of this instance.

Constructors

 o TXElement
 public TXElement(String name)
Make new Element instance.

 o TXElement
 public TXElement(String qname,
                  String ns,
                  String n)
Make new Element instance.

Methods

 o getNodeType
 public int getNodeType()
[DOM] Return Node.NodeType.ELEMENT

Overrides:
getNodeType in class Child
 o setTagName
 public void setTagName(String tagName)
[DOM]

 o getTagName
 public String getTagName()
[DOM] Return a name of this element.

 o getName
 public String getName()
Return a name of this element.

 o setAttributes
 public void setAttributes(AttributeList attributes)
[DOM]

 o getAttributes
 public AttributeList getAttributes()
[DOM]

 o setAttribute
 public void setAttribute(Attribute newAttr)
[DOM] Set an attribute.

 o getQName
 public String getQName()
Return qualified name. This is the same of getName() when the Element has no namespace.

 o getNameSpace
 public String getNameSpace()
Return namespace.

Returns:
null when the element has no namespace.
 o isEmpty
 public boolean isEmpty()
Return if this element is empty. `Empty' means that the element has no child.

 o elementAt
 public Child elementAt(int i)
Return a child at specified position.

 o size
 public int size()
Return number of children.

 o setPreserveSpace
 public void setPreserveSpace(boolean f)
Set if parser preserves spaces of texts and print() preserves spaces.

 o isPreserveSpace
 public boolean isPreserveSpace()
Return if parser preserves spaces of texts and print() preserves spaces.

 o clone
 public synchronized Object clone()
Clone this object and children.

Overrides:
clone in class Child
 o cloneWithoutChildren
 public synchronized TXElement cloneWithoutChildren()
Clone this object without children.

 o getAttributeArray
 public TXAttribute[] getAttributeArray()
Return array of Attribute.

 o getAttribute
 public String getAttribute(String key)
Return value of specified attribute name.

Parameters:
key - qualified name
Returns:
null if the element doesn't have specified attribute.
 o getAttributeInstance
 public Attribute getAttributeInstance(String key)
Return an attribute instance.

Parameters:
key - qualified name
Returns:
null if the element doesn't have specified attribute.
 o setAttribute
 public void setAttribute(String key,
                          String value)
Add an attribute. This method doesn't support namespace.

 o setAttribute
 public void setAttribute(TXAttribute a)
Add an attribute.

 o getText
 public String getText()
Make a string consisted of all child text.

Returns:
"" if isEmpty() is true
Overrides:
getText in class Child
 o toString
 public String toString()
Make a string representation of this instance. `<name att="value">...</name>'.

Overrides:
toString in class Object
 o print
 public void print(PrintWriter pw,
                   int indent)
Print to Writer.

Overrides:
print in class Child
 o print
 public void print(PrintWriter pw,
                   String enc,
                   int indent)
Print to Writer.

Overrides:
print in class Child
 o searchAncestors
 public TXElement searchAncestors(String ename)
Search ancestors for an element.

 o searchChildren
 public TXElement searchChildren(String ename)
Search children for an element. Do not search grandchildren.

Returns:
first found element, null when not found
 o searchChildrenAll
 public TXElement[] searchChildrenAll(String ename)
Search children for elements. Do not search grandchildren.

Returns:
all matched elements, never null
 o getLanguage
 public String getLanguage()
Return language ID (value of xml:lang attribute). This method is not equivalent to getAttribute("xml:lang"). This method looks up parents of this element when this element has no language ID.

Returns:
null when this element and all of its parents have no language ID.
 o setUserData
 public void setUserData(Object o)
Set user data. The parser doesn't touch this value.

 o getUserData
 public Object getUserData()
Return user data.

 o ripen
 public void ripen()
Called by DefaultElementFactory.


All Packages  Class Hierarchy  This Package  Previous  Next  Index