KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > arooa > handlers > SkipLevelHandler


1 package org.oddjob.arooa.handlers;
2
3 import org.oddjob.arooa.ArooaHandler;
4 import org.oddjob.arooa.ArooaContext;
5 import org.xml.sax.Attributes JavaDoc;
6 import org.xml.sax.SAXParseException JavaDoc;
7
8 /**
9  * Skips an element level. For instance when a component has the
10  * method <code>addComponentChild</code>.
11  * <p>
12  * The new component is in a nested element like this:
13  * <pre>
14  * &lt;comp1&gt;
15  * &lt;foo&gt;
16  * &lt;comp2/&gt;
17  * &lt;/foo&gt;
18  * &lt;/comp1&gt;
19  * <pre>
20  * This is the handler that handles the foo element.
21  *
22  * @see ArooaHandler.
23  * @author Rob Gordon.
24  */

25 public class SkipLevelHandler extends ArooaHandler {
26
27     private final ArooaHandler nextHandler;
28     
29     /**
30      * Constructor.
31      *
32      * @param handler The handler to use for the next level element.
33      */

34     public SkipLevelHandler(ArooaHandler handler) {
35         this.nextHandler = handler;
36     }
37     
38
39     public ArooaHandler onStartChild(String JavaDoc uri, String JavaDoc name, String JavaDoc qname,
40             Attributes JavaDoc attrs,
41             ArooaContext context)
42     throws SAXParseException JavaDoc {
43         return nextHandler;
44     }
45     
46 }
47
48  
Popular Tags