View Javadoc

1   package org.codehaus.xfire.annotations;
2   
3   import java.lang.reflect.Method;
4   
5   import org.codehaus.xfire.annotations.soap.SOAPBindingAnnotation;
6   
7   /***
8    * Defines the contract for accessing annotations at runtime. This is a facade,  which can accommodate any annotations
9    * API such as Commons Attributes,  backport175, Java 5, or any other annotations implementation.
10   *
11   * @author Arjen Poutsma
12   */
13  public interface WebAnnotations
14  {
15      /***
16       * Tests whether the given class has the {@link org.codehaus.xfire.annotations.WebServiceAnnotation} annotation.
17       *
18       * @param aClass the class.
19       * @return <code>true</code> if present; <code>false</code> otherwise.
20       */
21      boolean hasWebServiceAnnotation(Class aClass);
22  
23      /***
24       * Gets the {@link org.codehaus.xfire.annotations.WebServiceAnnotation} annotation from the given class, if found.
25       *
26       * @param aClass the class.
27       * @return the annotation; or <code>null</code> if it could not be found.
28       */
29      WebServiceAnnotation getWebServiceAnnotation(Class aClass);
30  
31      /***
32       * Tests whether the given method has the {@link org.codehaus.xfire.annotations.WebMethodAnnotation} annotation.
33       *
34       * @param method the method.
35       * @return <code>true</code> if present; <code>false</code> otherwise.
36       */
37      boolean hasWebMethodAnnotation(Method method);
38  
39      /***
40       * Gets the {@link org.codehaus.xfire.annotations.WebServiceAnnotation} annotation from the given class, if found.
41       *
42       * @param method the method.
43       * @return the annotation; or <code>null</code> if it could not be found.
44       */
45      WebMethodAnnotation getWebMethodAnnotation(Method method);
46  
47      /***
48       * Tests whether the given method has the {@link org.codehaus.xfire.annotations.WebResultAnnotation} annotation.
49       *
50       * @param method the method.
51       * @return <code>true</code> if present; <code>false</code> otherwise.
52       */
53      boolean hasWebResultAnnotation(Method method);
54  
55      /***
56       * Gets the {@link org.codehaus.xfire.annotations.WebResultAnnotation} annotation from the given method, if found.
57       *
58       * @param method the method.
59       * @return the annotation; or <code>null</code> if it could not be found.
60       */
61      WebResultAnnotation getWebResultAnnotation(Method method);
62  
63      /***
64       * Tests whether the indicated parameter of the given method has the {@link WebResultAnnotation} annotation.
65       *
66       * @param method    the method.
67       * @param parameter the index of the parameter in the method's parameter list.
68       * @return <code>true> if present; <code>false</code> otherwise.
69       */
70      boolean hasWebParamAnnotation(Method method, int parameter);
71  
72      /***
73       * Gets the {@link WebParamAnnotation} annotation from the indicated parameter of the given method, if found.
74       *
75       * @param method    the method.
76       * @param parameter the parameter index.
77       * @return the annotation; or <code>null</code> if it could not be found.
78       */
79      WebParamAnnotation getWebParamAnnotation(Method method, int parameter);
80  
81      /***
82       * Tests whether the given method has the one way annotation.
83       *
84       * @param method the method.
85       * @return <code>true</code> if present; <code>false</code> otherwise.
86       */
87      boolean hasOnewayAnnotation(Method method);
88  
89      /***
90       * Tests whether the given class has the {@link SOAPBindingAnnotation} annotation.
91       *
92       * @param aClass the class.
93       * @return <code>true> if present; <code>false</code> otherwise.
94       */
95      boolean hasSOAPBindingAnnotation(Class aClass);
96  
97      /***
98       * Gets the {@link SOAPBindingAnnotation} annotation from the given class, if found.
99       *
100      * @param aClass the class.
101      * @return the annotation; or <code>null</code> if it could not be found.
102      */
103     SOAPBindingAnnotation getSOAPBindingAnnotation(Class aClass);
104 
105     /***
106      * Tests whether the given class has the {@link HandlerChainAnnotation} annotation.
107      *
108      * @param aClass the class.
109      * @return <code>true> if present; <code>false</code> otherwise.
110      */
111     boolean hasHandlerChainAnnotation(Class aClass);
112 
113     /***
114      * Gets the {@link HandlerChainAnnotation} annotation from the given class, if found.
115      *
116      * @param aClass the class.
117      * @return the annotation; or <code>null</code> if it could not be found.
118      */
119     HandlerChainAnnotation getHandlerChainAnnotation(Class aClass);
120 
121 }