1 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 ; 24 import java.util.Map ; 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 check( ClassDeclaration jclass ) 41 throws FatalCompileTimeException 42 { 43 setRuntimeVersionChecker( new RuntimeVersionChecker() ); 44 return onCheck( jclass ); 45 } 46 47 public abstract Map 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 |