1 package com.ibatis.common.xml; 2 3 import org.w3c.dom.Node; 4 5 /** 6 * A nodelet is a sort of callback or event handler that can be registered 7 * to handle an XPath event registered with the NodeParser. 8 */ 9 public interface Nodelet { 10 11 /** 12 * For a registered XPath, the NodeletParser will call the Nodelet's 13 * process method for processing. 14 * 15 * @param node The node represents any XML node that can be registered under 16 * an XPath supported by the NodeletParser. Possible nodes are: 17 * <ul> 18 * <li>Text - Use node.getNodeValue() for the text value. 19 * <li>Attribute - Use node.getNodeValue() for the attribute value. 20 * <li>Element - This is the most flexible type. You can get the node 21 * content and iterate over the node's child nodes if neccessary. This is 22 * useful where a single XPath registration cannot describe the complex 23 * structure for a given XML stanza. 24 * </ul> 25 * 26 */ 27 void process (Node node) throws Exception; 28 29 } 30