public class

Element

extends Object
java.lang.Object
   ↳ android.sax.Element
Known Direct Subclasses

Class Overview

An XML element. Provides access to child elements and hooks to listen for events related to this element.

See Also

Summary

Public Methods
Element getChild(String uri, String localName)
Gets the child element with the given name.
Element getChild(String localName)
Gets the child element with the given name.
Element requireChild(String localName)
Gets the child element with the given name.
Element requireChild(String uri, String localName)
Gets the child element with the given name.
void setElementListener(ElementListener elementListener)
Sets start and end element listeners at the same time.
void setEndElementListener(EndElementListener endElementListener)
Sets a listener for the end of this element.
void setEndTextElementListener(EndTextElementListener endTextElementListener)
Sets a listener for the end of this text element.
void setStartElementListener(StartElementListener startElementListener)
Sets a listener for the start of this element.
void setTextElementListener(TextElementListener elementListener)
Sets start and end text element listeners at the same time.
String toString()
Returns a string containing a concise, human-readable description of this object.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public Element getChild (String uri, String localName)

Gets the child element with the given name.

public Element getChild (String localName)

Gets the child element with the given name. Uses an empty string as the namespace.

public Element requireChild (String localName)

Gets the child element with the given name. Uses an empty string as the namespace. We will throw a SAXException at parsing time if the specified child is missing. This helps you ensure that your listeners are called.

public Element requireChild (String uri, String localName)

Gets the child element with the given name. We will throw a SAXException at parsing time if the specified child is missing. This helps you ensure that your listeners are called.

public void setElementListener (ElementListener elementListener)

Sets start and end element listeners at the same time.

public void setEndElementListener (EndElementListener endElementListener)

Sets a listener for the end of this element.

public void setEndTextElementListener (EndTextElementListener endTextElementListener)

Sets a listener for the end of this text element.

public void setStartElementListener (StartElementListener startElementListener)

Sets a listener for the start of this element.

public void setTextElementListener (TextElementListener elementListener)

Sets start and end text element listeners at the same time.

public String toString ()

Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation simply concatenates the class name, the '@' sign and a hexadecimal representation of the object's hashCode(), that is, it is equivalent to the following expression:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
  • a printable representation of this object.