org.dom4j
Interface ElementPath


public interface ElementPath

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

Version:
$Revision: 1.4 $
Author:
Dave White

Method Summary
 void addHandler(java.lang.String path, ElementHandler handler)
          Adds the ElementHandler to be called when the specified path is encounted.
 Element getCurrent()
           
 Element getElement(int depth)
           
 java.lang.String getPath()
           
 void removeHandler(java.lang.String path)
          Removes the ElementHandler from the event based processor, for the specified path.
 int size()
           
 

Method Detail

size

public int size()
Returns:
the number of elements in the path

getElement

public Element getElement(int depth)
Returns:
the element at the specified depth index, 0 = root element

getPath

public java.lang.String getPath()
Returns:
the path as a string

getCurrent

public Element getCurrent()
Returns:
the current element

addHandler

public void addHandler(java.lang.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.

removeHandler

public void removeHandler(java.lang.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.


Copyright © 2004 MetaStuff Ltd. All Rights Reserved. Hosted by

SourceForge Logo