Package org.apache.axis2.jsr181
Class JSR181Helper
java.lang.Object
org.apache.axis2.jsr181.JSR181Helper
Helper class to work with JSR 181 annotations. This class should be used to retrieve JSR 181
annotations. It avoids the direct dependency on the API, i.e. it avoids
NoClassDefFoundError exceptions if the JAR is not in the classpath. This is useful
because these annotations are completely optional in Axis2.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract WebMethodAnnotationgetWebMethodAnnotation(Method method) Get the WebMethod annotation for a given method.abstract WebParamAnnotationgetWebParamAnnotation(Annotation[] annotations) Get the WebParam annotation from a set of annotations.abstract WebResultAnnotationgetWebResultAnnotation(Method method) Get the WebResult annotation for a given method.abstract WebServiceAnnotationgetWebServiceAnnotation(Class<?> clazz) Get the WebService annotation for a given class.
-
Field Details
-
INSTANCE
The instance of this helper class. If the JSR 181 API is not available in the classpath, this will be an implementation that always returnsnull.
-
-
Constructor Details
-
JSR181Helper
public JSR181Helper()
-
-
Method Details
-
getWebServiceAnnotation
Get the WebService annotation for a given class.- Parameters:
clazz- the class- Returns:
- the WebService annotation, or
nullif there is no such annotation
-
getWebMethodAnnotation
Get the WebMethod annotation for a given method.- Parameters:
method- the method- Returns:
- the WebMethod annotation, or
nullif there is no such annotation
-
getWebParamAnnotation
Get the WebParam annotation from a set of annotations. This method is typically used in conjunction withMethod.getParameterAnnotations().- Parameters:
annotations- an array of annotations- Returns:
- the WebParam annotation, or
nullif the array didn't contain a WebParam annotation
-
getWebResultAnnotation
Get the WebResult annotation for a given method.- Parameters:
method- the method- Returns:
- the WebResult annotation, or
nullif there is no such annotation
-