KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > ParserEngine


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.java;
21
22 import java.io.IOException JavaDoc;
23
24 import org.openide.filesystems.FileObject;
25 import org.netbeans.modules.java.parser.ParseObjectRequest;
26
27 /** Simple interface to a parser engine
28  * The engine should process passed source file(s) and give out enough information
29  * to produce Java Hierarchy classes for the source. The engine should not only
30  * parse, but resolve identifiers as well; doing that, it is free to open other
31  * source files.
32  * @author sdedic
33  * @version
34  */

35 public interface ParserEngine {
36     /** Registers a new request with the parser engine.
37         When a request is registered, it can be processed at any time. The engine
38         can carry this task during processing of other requests.
39      * @param r Request to be registered
40      * @param fo FileObject that the request should be bound to. The request will
41      * be processed if the parser/compiler touches `fo' during other processing.
42     */

43     public void register(ParseObjectRequest r, FileObject fo);
44
45     /**
46      * Unregisters a request filed for the given FileObject.
47      */

48     public void unregister(FileObject fo);
49
50     /** Determines if a parse request is already registered with the engine.
51     */

52     public boolean isRegistered(ParseObjectRequest r);
53
54     /** Clears all requests in the parser engine.
55     */

56     public void unregisterAll();
57
58     /** Process the request immediately. The method returns after the request is
59         completed (either successfully or with some errors).
60         If request was already completed, it is processed again yielding fresh
61         results.
62     */

63     public void process(ParseObjectRequest r) throws IOException JavaDoc;
64 }
65
Popular Tags