KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > netui > compiler > apt > PageFlowAnnotationProcessorFactory


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.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 JavaDoc;
27 import java.util.Collection JavaDoc;
28 import java.util.Collections JavaDoc;
29 import java.util.HashSet JavaDoc;
30
31
32 public class PageFlowAnnotationProcessorFactory
33         extends BaseAnnotationProcessorFactory
34         implements JpfLanguageConstants
35 {
36     private static final HashSet JavaDoc PAGEFLOW_ANNOTATIONS = new HashSet JavaDoc();
37     private static final HashSet JavaDoc FACES_BACKING_ANNOTATIONS = new HashSet JavaDoc();
38     
39     private static final ArrayList JavaDoc SUPPORTED_ANNOTATION_TYPES = new ArrayList JavaDoc();
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 JavaDoc supportedAnnotationTypes()
83     {
84         return SUPPORTED_ANNOTATION_TYPES;
85     }
86
87     public Collection JavaDoc 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