1 18 package org.apache.beehive.netui.compiler.apt; 19 20 import org.apache.beehive.netui.compiler.JpfLanguageConstants; 21 import org.apache.beehive.netui.compiler.processor.PageFlowAnnotationProcessor; 22 import org.apache.beehive.netui.compiler.typesystem.declaration.AnnotationTypeDeclaration; 23 import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessor; 24 import org.apache.beehive.netui.compiler.typesystem.env.AnnotationProcessorEnvironment; 25 26 import java.util.ArrayList ; 27 import java.util.Collection ; 28 import java.util.Collections ; 29 import java.util.HashSet ; 30 31 32 public class PageFlowAnnotationProcessorFactory 33 extends BaseAnnotationProcessorFactory 34 implements JpfLanguageConstants 35 { 36 private static final HashSet PAGEFLOW_ANNOTATIONS = new HashSet (); 37 private static final HashSet FACES_BACKING_ANNOTATIONS = new HashSet (); 38 39 private static final ArrayList SUPPORTED_ANNOTATION_TYPES = new ArrayList (); 40 41 static 42 { 43 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + ACTION_TAG_NAME ); 44 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + ACTION_OUTPUT_TAG_NAME ); 45 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + CATCH_TAG_NAME ); 46 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + CONDITIONAL_FORWARD_TAG_NAME ); 47 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + CONTROLLER_TAG_NAME ); 48 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + EXCEPTION_HANDLER_TAG_NAME ); 49 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + FORM_BEAN_TAG_NAME ); 50 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + FORWARD_TAG_NAME ); 51 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + MESSAGE_ARG_TAG_NAME ); 52 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + MESSAGE_BUNDLE_TAG_NAME ); 53 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + SIMPLE_ACTION_TAG_NAME ); 54 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATABLE_BEAN_TAG_NAME ); 55 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATABLE_PROPERTY_TAG_NAME ); 56 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_CREDIT_CARD_TAG_NAME ); 57 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_CUSTOM_RULE_TAG_NAME ); 58 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_CUSTOM_VARIABLE_TAG_NAME ); 59 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_DATE_TAG_NAME ); 60 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_EMAIL_TAG_NAME ); 61 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_MASK_TAG_NAME ); 62 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_MAX_LENGTH_TAG_NAME ); 63 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_MIN_LENGTH_TAG_NAME ); 64 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_RANGE_TAG_NAME ); 65 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_REQUIRED_TAG_NAME ); 66 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_TYPE_TAG_NAME ); 67 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATE_VALID_WHEN_TAG_NAME ); 68 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VALIDATION_LOCALE_RULES_TAG_NAME ); 69 PAGEFLOW_ANNOTATIONS.add( ANNOTATION_QUALIFIER + VIEW_PROPERTIES_TAG_NAME ); 70 71 FACES_BACKING_ANNOTATIONS.add( ANNOTATION_QUALIFIER + COMMAND_HANDLER_TAG_NAME ); 72 FACES_BACKING_ANNOTATIONS.add( ANNOTATION_QUALIFIER + FACES_BACKING_TAG_NAME ); 73 FACES_BACKING_ANNOTATIONS.add( ANNOTATION_QUALIFIER + PAGE_FLOW_FIELD_TAG_NAME ); 74 FACES_BACKING_ANNOTATIONS.add( ANNOTATION_QUALIFIER + RAISE_ACTION_TAG_NAME ); 75 76 SUPPORTED_ANNOTATION_TYPES.addAll( PAGEFLOW_ANNOTATIONS ); 77 SUPPORTED_ANNOTATION_TYPES.addAll( FACES_BACKING_ANNOTATIONS ); 78 SUPPORTED_ANNOTATION_TYPES.add( ANNOTATION_QUALIFIER + SHARED_FLOW_FIELD_TAG_NAME ); 79 SUPPORTED_ANNOTATION_TYPES.add( ANNOTATION_QUALIFIER + SHARED_FLOW_REF_TAG_NAME ); 80 } 81 82 public Collection supportedAnnotationTypes() 83 { 84 return SUPPORTED_ANNOTATION_TYPES; 85 } 86 87 public Collection supportedOptions() 88 { 89 return Collections.EMPTY_LIST; 90 } 91 92 public AnnotationProcessor getProcessorFor( AnnotationTypeDeclaration[] atds, AnnotationProcessorEnvironment env ) 93 { 94 return new PageFlowAnnotationProcessor( atds, env ); 95 } 96 } 97 | Popular Tags |