KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > AptFactory


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /*
25  * ServiceRefApf.java
26  *
27  * Created on June 15, 2005, 8:57 AM
28  *
29  * To change this template, choose Tools | Options and locate the template under
30  * the Source Creation and Management node. Right-click the template and choose
31  * Open. You can then make changes to the template in the Source Editor.
32  */

33
34 package com.sun.enterprise;
35
36 import java.util.Collection JavaDoc;
37 import java.util.Collections JavaDoc;
38 import java.util.Arrays JavaDoc;
39 import java.util.Set JavaDoc;
40 import com.sun.mirror.apt.AnnotationProcessorFactory;
41 import com.sun.mirror.declaration.AnnotationTypeDeclaration;
42 import com.sun.mirror.apt.AnnotationProcessorEnvironment;
43 import com.sun.mirror.apt.AnnotationProcessor;
44
45 import com.sun.enterprise.deployment.backend.DeploymentLogger;
46
47 import com.sun.enterprise.webservice.apt.WebServiceRefAp;
48
49 /**
50  * Factory class for all APT handlers delivered with the application and
51  * available with the asapt command.
52  *
53  * @author Jerome Dochez
54  */

55 public class AptFactory implements AnnotationProcessorFactory {
56     
57     // Process this set of annotations
58
private static final Collection JavaDoc<String JavaDoc> supportedAnnotations
59         = Collections.unmodifiableCollection(Arrays.asList("javax.xml.ws.WebServiceRef"));
60     
61     // No supported options
62
private static final Collection JavaDoc<String JavaDoc> supportedOptions = Collections.emptySet();
63     
64     /** Creates a new instance of ServiceRefApf */
65     public AptFactory() {
66         DeploymentLogger.get().fine("APT found ServiceRefApf");
67     }
68  
69     /**
70      * @return the list of supported annotations
71      */

72     public Collection JavaDoc<String JavaDoc> supportedAnnotationTypes() {
73         return supportedAnnotations;
74     }
75
76     public Collection JavaDoc<String JavaDoc> supportedOptions() {
77         return supportedOptions;
78     }
79
80     public AnnotationProcessor getProcessorFor(
81             Set JavaDoc<AnnotationTypeDeclaration> atds,
82             AnnotationProcessorEnvironment env) {
83         return new WebServiceRefAp(env);
84     }
85 }
86
Popular Tags