KickJava   Java API By Example, From Geeks To Geeks.

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


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 ControlClientAnnotationProcessorFactory implements AnnotationProcessorFactory
33 {
34     private static final Collection JavaDoc<String JavaDoc> _supportedAnnotations =
35             Collections.unmodifiableCollection(
36                 Arrays.asList(new String JavaDoc[] {
37                         org.apache.beehive.controls.api.bean.Control.class.getName(),
38                         org.apache.beehive.controls.api.bean.ControlReferences.class.getName()
39                     }));
40
41     private static final Collection JavaDoc<String JavaDoc> _supportedOptions =
42             Collections.unmodifiableCollection(
43                 Arrays.asList( new String JavaDoc[0] ) );
44
45     public Collection JavaDoc<String JavaDoc> supportedOptions()
46     {
47         return _supportedOptions;
48     }
49
50     public Collection JavaDoc<String JavaDoc> supportedAnnotationTypes()
51     {
52         return _supportedAnnotations;
53     }
54
55     public AnnotationProcessor getProcessorFor(Set JavaDoc<AnnotationTypeDeclaration> atds,
56                                                AnnotationProcessorEnvironment env)
57     {
58         return new ControlClientAnnotationProcessor(atds, env);
59     }
60 }
61
Popular Tags