public void generate( ClassDeclaration publicClass )
throws FatalCompileTimeException
{
try {
AnnotationInstance facesBackingAnnotation = CompilerUtils.getAnnotation( publicClass, FACES_BACKING_TAG_NAME );
assert facesBackingAnnotation != null; // checker should enforce this
AnnotationToXML atx = new AnnotationToXML( publicClass );
// Add the class-level @Jpf.FacesBacking annotation.
atx.include( publicClass, facesBackingAnnotation );
// For each method, add the @Jpf.CommandHandler annotation.
MethodDeclaration[] methods = CompilerUtils.getClassMethods( publicClass, COMMAND_HANDLER_TAG_NAME );
for ( int i = 0; i < methods.length; i++ )
{
MethodDeclaration method = methods[i];
AnnotationInstance commandHandlerAnn = CompilerUtils.getAnnotation( method, COMMAND_HANDLER_TAG_NAME );
atx.include( method, commandHandlerAnn );
}
// Add @Jpf.SharedFlowField, @Jpf.PageFlowField, @Control.
FlowControllerGenerator.includeFieldAnnotations( atx, publicClass, PAGE_FLOW_FIELD_TAG_NAME );