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.declaration.AnnotationInstance; 22 import org.apache.beehive.netui.compiler.typesystem.declaration.MethodDeclaration; 23 import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; 24 25 import java.io.File ; 26 27 public class FacesBackingGenerator 28 extends BaseGenerator 29 implements JpfLanguageConstants 30 { 31 public FacesBackingGenerator( AnnotationProcessorEnvironment env, SourceFileInfo sourceFileInfo, Diagnostics diagnostics ) 32 { 33 super( env, sourceFileInfo, diagnostics ); 34 } 35 36 public void generate( ClassDeclaration publicClass ) 37 throws FatalCompileTimeException 38 { 39 File sourceFile = CompilerUtils.getSourceFile( publicClass, true ); 40 AnnotationInstance facesBackingAnnotation = CompilerUtils.getAnnotation( publicClass, FACES_BACKING_TAG_NAME ); 41 assert facesBackingAnnotation != null; AnnotationToXML atx = new AnnotationToXML( publicClass ); 43 44 atx.include( publicClass, facesBackingAnnotation ); 46 47 MethodDeclaration[] methods = CompilerUtils.getClassMethods( publicClass, COMMAND_HANDLER_TAG_NAME ); 49 for ( int i = 0; i < methods.length; i++ ) 50 { 51 MethodDeclaration method = methods[i]; 52 AnnotationInstance commandHandlerAnn = CompilerUtils.getAnnotation( method, COMMAND_HANDLER_TAG_NAME ); 53 atx.include( method, commandHandlerAnn ); 54 } 55 56 FlowControllerGenerator.includeFieldAnnotations( atx, publicClass, PAGE_FLOW_FIELD_TAG_NAME ); 58 59 atx.writeXml( CompilerUtils.getWebBuildRoot( getEnv() ), getDiagnostics() ); 61 } 62 } 63 | Popular Tags |