KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > help > internal > dynamic > ProcessorHandler


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.help.internal.dynamic;
12
13 import org.eclipse.help.internal.UAElement;
14
15 /*
16  * A handler that is notified when the document processor visits a node,
17  * allowing it to process the node and return a result.
18  */

19 public abstract class ProcessorHandler {
20     
21     public static final short UNHANDLED = 0;
22     public static final short HANDLED_CONTINUE = 1;
23     public static final short HANDLED_SKIP = 2;
24     
25     private DocumentProcessor processor;
26     
27     /*
28      * Will be called for every node visited by the processor,
29      * except those requested to be skipped.
30      */

31     public abstract short handle(UAElement element, String JavaDoc id);
32
33     /*
34      * Returns the processor that is calling this handler.
35      */

36     public DocumentProcessor getProcessor() {
37         return processor;
38     }
39
40     /*
41      * Sets the processor that is calling this handler. This should only
42      * be called by the processor.
43      */

44     public void setProcessor(DocumentProcessor processor) {
45         this.processor = processor;
46     }
47 }
48
Popular Tags