org.dom4j

Interface ElementPath

public interface ElementPath

This interface is used by {@link ElementHandler}instances to retrieve information about the current path hierarchy they are to process. It's primary use is to retrieve the current {@link Element}being processed.

Version: $Revision: 1.6 $

Author: Dave White

Method Summary
voidaddHandler(String path, ElementHandler handler)
Adds the ElementHandler to be called when the specified path is encounted.
ElementgetCurrent()
DOCUMENT ME!
ElementgetElement(int depth)
DOCUMENT ME!
StringgetPath()
DOCUMENT ME!
voidremoveHandler(String path)
Removes the ElementHandler from the event based processor, for the specified path.
intsize()
DOCUMENT ME!

Method Detail

addHandler

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 is the path to be handled handler is the ElementHandler to be called by the event based processor.

getCurrent

public Element getCurrent()
DOCUMENT ME!

Returns: the current element

getElement

public Element getElement(int depth)
DOCUMENT ME!

Parameters: depth DOCUMENT ME!

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

getPath

public String getPath()
DOCUMENT ME!

Returns: the path as a string

removeHandler

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 is the path to remove the ElementHandler for.

size

public int size()
DOCUMENT ME!

Returns: the number of elements in the path

Copyright B) 2005 MetaStuff Ltd. All Rights Reserved. Hosted by

SourceForge