KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > controls > runtime > generator > apt > ControlSecondaryAnnotationProcessorFactory


1 package org.apache.beehive.controls.runtime.generator.apt;
2
3 /*
4  * Copyright 2004 The Apache Software Foundation
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * $Header:$
19  */

20
21 import java.util.Arrays JavaDoc;
22 import java.util.ArrayList JavaDoc;
23 import java.util.Collection JavaDoc;
24 import java.util.Collections JavaDoc;
25 import java.util.Set JavaDoc;
26
27 import com.sun.mirror.apt.AnnotationProcessor;
28 import com.sun.mirror.apt.AnnotationProcessorFactory;
29 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
30 import com.sun.mirror.declaration.AnnotationTypeDeclaration;
31
32 public class ControlSecondaryAnnotationProcessorFactory implements AnnotationProcessorFactory
33 {
34     private static final Collection JavaDoc<String JavaDoc> _supportedAnnotations =
35             Collections.unmodifiableCollection(
36                 Arrays.asList(new String JavaDoc[] {
37                     java.lang.annotation.Target JavaDoc.class.getName(),
38                     java.lang.annotation.Retention JavaDoc.class.getName(),
39                     org.apache.beehive.controls.api.bean.ExternalPropertySets.class.getName(),
40                     org.apache.beehive.controls.api.bean.ControlReferences.class.getName(),
41                     org.apache.beehive.controls.api.bean.Threading.class.getName(),
42                     org.apache.beehive.controls.api.context.Context.class.getName(),
43                     org.apache.beehive.controls.api.events.Client.class.getName(),
44                     org.apache.beehive.controls.api.events.EventHandler.class.getName(),
45                     org.apache.beehive.controls.api.events.EventSet.class.getName(),
46                     org.apache.beehive.controls.api.packaging.BeanInfo.class.getName(),
47                     org.apache.beehive.controls.api.packaging.EventSetInfo.class.getName(),
48                     org.apache.beehive.controls.api.packaging.FeatureAttribute.class.getName(),
49                     org.apache.beehive.controls.api.packaging.FeatureInfo.class.getName(),
50                     org.apache.beehive.controls.api.packaging.ManifestAttribute.class.getName(),
51                     org.apache.beehive.controls.api.packaging.ManifestAttributes.class.getName(),
52                     org.apache.beehive.controls.api.packaging.PropertyInfo.class.getName(),
53                     org.apache.beehive.controls.api.packaging.PropertyInfo.class.getName(),
54                     org.apache.beehive.controls.api.packaging.PropertyInfo.class.getName(),
55                     org.apache.beehive.controls.api.packaging.PropertyInfo.class.getName(),
56                     org.apache.beehive.controls.api.properties.BaseProperties.class.getName(),
57                     org.apache.beehive.controls.api.versioning.Version.class.getName(),
58                     org.apache.beehive.controls.api.versioning.VersionRequired.class.getName(),
59                     org.apache.beehive.controls.api.versioning.VersionSupported.class.getName()
60                     }));
61
62     private static final Collection JavaDoc<String JavaDoc> _supportedOptions =
63             Collections.unmodifiableCollection(
64                 Arrays.asList(new String JavaDoc[] {
65                     "-AcontrolGenerator", // sets CodeGenerator class
66
}));
67
68     public Collection JavaDoc<String JavaDoc> supportedOptions()
69     {
70         return _supportedOptions;
71     }
72
73     public Collection JavaDoc<String JavaDoc> supportedAnnotationTypes()
74     {
75         return _supportedAnnotations;
76     }
77
78     public AnnotationProcessor getProcessorFor(Set JavaDoc<AnnotationTypeDeclaration> atds,
79                                                AnnotationProcessorEnvironment env)
80     {
81         return new ControlSecondaryAnnotationProcessor(atds, env);
82     }
83 }
84
Popular Tags