KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > compiler > BaseChecker


1 /*
2  * Copyright 2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  * $Header:$
17  */

18 package org.apache.beehive.netui.compiler;
19
20 import org.apache.beehive.netui.compiler.typesystem.declaration.ClassDeclaration;
21 import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment;
22
23 import java.io.File JavaDoc;
24 import java.util.Map JavaDoc;
25
26 public abstract class BaseChecker
27 {
28     private AnnotationProcessorEnvironment _env;
29     private Diagnostics _diagnostics;
30     private RuntimeVersionChecker _runtimeVersionChecker;
31     private SourceFileInfo _sourceFileInfo;
32
33     protected BaseChecker( AnnotationProcessorEnvironment env, SourceFileInfo sourceFileInfo, Diagnostics diagnostics )
34     {
35         _env = env;
36         _diagnostics = diagnostics;
37         _sourceFileInfo = sourceFileInfo;
38     }
39     
40     public Map JavaDoc check( ClassDeclaration jclass )
41             throws FatalCompileTimeException
42     {
43         setRuntimeVersionChecker( new RuntimeVersionChecker() );
44         return onCheck( jclass );
45     }
46     
47     public abstract Map JavaDoc onCheck( ClassDeclaration jclass )
48         throws FatalCompileTimeException;
49     
50     protected AnnotationProcessorEnvironment getEnv()
51     {
52         return _env;
53     }
54
55     protected Diagnostics getDiagnostics()
56     {
57         return _diagnostics;
58     }
59
60     protected RuntimeVersionChecker getRuntimeVersionChecker()
61     {
62         return _runtimeVersionChecker;
63     }
64
65     protected void setRuntimeVersionChecker( RuntimeVersionChecker runtimeVersionChecker )
66     {
67         _runtimeVersionChecker = runtimeVersionChecker;
68     }
69
70     protected SourceFileInfo getSourceFileInfo()
71     {
72         return _sourceFileInfo;
73     }
74 }
75
Popular Tags