Top Description Methods
org.dom4j

public Interface ElementPath

Known Direct Implementers
org.dom4j.io.ElementStack
Annotations
@SuppressWarnings:unused

This interface is used by ElementHandlerinstances to retrieve information about the current path hierarchy they are to process. It's primary use is to retrieve the current Elementbeing processed.
Author
Dave White
Version
$Revision: 1.6 $

Method Summary

Modifier and TypeMethod and Description
public void
addHandler(String
is the path to be handled
path
,
ElementHandler
is the ElementHandler to be called by the event based processor.
handler
)

Adds the ElementHandler to be called when the specified path is encounted.

public Element

Returns:

the current element
getCurrent
()

DOCUMENT ME!

public Element

Returns:

the element at the specified depth index, 0 = root element
getElement
(int
DOCUMENT ME!
depth
)

DOCUMENT ME!

public String

Returns:

the path as a string
getPath
()

DOCUMENT ME!

public void
removeHandler(String
is the path to remove the ElementHandler for.
path
)

Removes the ElementHandler from the event based processor, for the specified path.

public int

Returns:

the number of elements in the path
size
()

DOCUMENT ME!

Method Detail

addHandlerback to summary
public void addHandler(String path, ElementHandler handler)

Adds the ElementHandler to be called when the specified path is encounted. The path can be either an absolute path (i.e. prefixed with "/") or a relative path (i.e. assummed to be a child of the current path as retrieved by getPath .

Parameters
path:String

is the path to be handled

handler:ElementHandler

is the ElementHandler to be called by the event based processor.

getCurrentback to summary
public Element getCurrent()

DOCUMENT ME!

Returns:Element

the current element

getElementback to summary
public Element getElement(int depth)

DOCUMENT ME!

Parameters
depth:int

DOCUMENT ME!

Returns:Element

the element at the specified depth index, 0 = root element

getPathback to summary
public String getPath()

DOCUMENT ME!

Returns:String

the path as a string

removeHandlerback to summary
public void removeHandler(String path)

Removes the ElementHandler from the event based processor, for the specified path. The path can be either an absolute path (i.e. prefixed with "/") or a relative path (i.e. assummed to be a child of the current path as retrieved by getPath .

Parameters
path:String

is the path to remove the ElementHandler for.

sizeback to summary
public int size()

DOCUMENT ME!

Returns:int

the number of elements in the path