KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > java > source > engine > EngineEnvironment


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.source.engine;
21
22 import org.netbeans.api.java.source.query.QueryEnvironment;
23
24 import com.sun.tools.javac.code.Symtab;
25 import com.sun.tools.javac.code.Types;
26 import com.sun.tools.javac.jvm.ClassReader;
27 import com.sun.tools.javac.parser.Keywords;
28 import com.sun.tools.javac.util.Context;
29 import com.sun.tools.javac.util.Name;
30 import java.io.IOException JavaDoc;
31 import javax.tools.JavaFileObject;
32 import org.netbeans.modules.java.source.engine.ASTModel;
33 import org.netbeans.modules.java.source.engine.SourceRewriter;
34
35 public interface EngineEnvironment extends QueryEnvironment {
36
37     /**
38      * Returns the abstract syntax tree model of this environment.
39      *
40      *
41      * @see org.netbeans.modules.java.source.model.ASTModel
42      */

43     ASTModel getModel();
44
45     /**
46      * Returns the javac context of this environment. To avoid
47      * potential caching of the context instance, it is recommended
48      * that the other accessors be used for well-known context
49      * items.
50      */

51     Context getContext();
52
53     /**
54      * Sets or replaces the javac context of this environment.
55      */

56     void setContext(Context context);
57
58     /**
59      * Returns the parser's Keywords table for this environment.
60      */

61     Keywords getKeywords();
62
63     /**
64      * Returns the compiler's name table for this environment.
65      */

66     Name.Table getNameTable();
67
68     /**
69      * Returns the compiler's symbol table for this environment.
70      */

71     Symtab getSymbolTable();
72     
73     /**
74      * Returns the compiler's types table for this environment.
75      */

76     Types getJavacTypes();
77     
78     /**
79      * Retrieves an option in the Options instance for this
80      * environment, or null if no option has been set.
81      */

82     String JavaDoc getOption(String JavaDoc key);
83     
84     /**
85      * Adds or replaces an option in the Options instance for this
86      * environment.
87      */

88     void setOption(String JavaDoc name, String JavaDoc value);
89     
90     /**
91      * Returns the ClassReader for this environment.
92      */

93     ClassReader getClassReader();
94     
95     /**
96      * Returns a source rewriter for the specified source file.
97      */

98     SourceRewriter getSourceRewriter(JavaFileObject sourceFile) throws IOException JavaDoc;
99     
100     /**
101      * Returns the time this model was created, used for checking that source
102      * files haven't changed since.
103      */

104     long whenCreated();
105     
106     /**
107      * Returns the ElementMaker for this environment.
108      * @see org.netbeans.modules.java.source.model.ElementMaker
109      */

110     ElementMaker getElementMaker();
111 }
112
Popular Tags