KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > wsm > processor > apt > WsmAnnotationProcessorFactory


1 package org.apache.beehive.wsm.processor.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.Collection JavaDoc;
23 import java.util.Collections JavaDoc;
24 import java.util.Set JavaDoc;
25
26 import com.sun.mirror.apt.AnnotationProcessor;
27 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
28 import com.sun.mirror.apt.AnnotationProcessorFactory;
29 import com.sun.mirror.declaration.AnnotationTypeDeclaration;
30
31 public class WsmAnnotationProcessorFactory implements AnnotationProcessorFactory {
32     private static final Collection JavaDoc<String JavaDoc> supportedAnnotations =
33             Collections.unmodifiableCollection(Arrays.asList(new String JavaDoc[]{
34                 "javax.jws.WebService",
35                 "javax.jws.WebMethod",
36                 "javax.jws.WebParam",
37                 "javax.jws.Oneway",
38                 "javax.jws.WebResult",
39                 "javax.jws.HandlerChain",
40                 "javax.jws.soap.InitParam",
41                 "javax.jws.soap.SOAPBinding",
42                 "javax.jws.soap.SOAPMessageHandler",
43                 "javax.jws.soap.SOAPMessageHandlers"
44             }));
45
46     private static final Collection JavaDoc<String JavaDoc> supportedOptions = Collections.emptySet();
47
48     public Collection JavaDoc<String JavaDoc> supportedAnnotationTypes() {
49         return supportedAnnotations;
50     }
51
52     public Collection JavaDoc<String JavaDoc> supportedOptions() {
53         return supportedOptions;
54     }
55
56     public AnnotationProcessor getProcessorFor(Set JavaDoc<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) {
57         return new WsmAnnotationProcessor(atds, env);
58     }
59 }
60
Popular Tags