View Javadoc

1   package org.codehaus.xfire.annotations;
2   
3   /***
4    * Represents an common representation of a web service annotation. Specifies that the given method is exposed as a Web
5    * Service operation, making it part of the Web ServiceÕs public contract. A WebMethod annotation is required for each
6    * method that is published by the Web Service.
7    *
8    * @author Arjen Poutsma
9    */
10  public class WebServiceAnnotation
11  {
12      private String endpointInterface = "";
13      private String name = "";
14      private String serviceName = "";
15      private String targetNamespace = "";
16  
17      /***
18       * Returns the name of the Web Service. Used as the name of the wsdl:portType when mapped to WSDL 1.1.  Defaults to
19       * the simple name of the Java class or interface.
20       *
21       * @return the name of the Web Service.
22       */
23      public String getName()
24      {
25          return name;
26      }
27  
28      /***
29       * Sets the name of the Web Service. Used as the name of the wsdl:portType when mapped to WSDL 1.1.  Defaults to the
30       * simple name of the Java class or interface.
31       *
32       * @param name The new name of the Web Service.
33       */
34      public void setName(String name)
35      {
36          this.name = name;
37      }
38  
39      /***
40       * Returns the complete name of the service endpoint interface defining the serviceÕs abstract Web Service
41       * contract.
42       *
43       * @return the name of the service endpoint interface.
44       */
45      public String getEndpointInterface()
46      {
47          return endpointInterface;
48      }
49  
50      /***
51       * Sets the complete name of the service endpoint interface defining the serviceÕs abstract Web Service contract.
52       *
53       * @param endpointInterface the new name of the service endpoint interface.
54       */
55      public void setEndpointInterface(String endpointInterface)
56      {
57          this.endpointInterface = endpointInterface;
58      }
59  
60      /***
61       * Returns the service name of the Web Service. Used as the name of the wsdl:service when mapped to WSDL 1.1.  Not
62       * allowed on interfaces. Defaults to the simple name of the Java class + ÒService".
63       *
64       * @return the service name of the Web Service.
65       */
66      public String getServiceName()
67      {
68          return serviceName;
69      }
70  
71      /***
72       * Sets the service name of the Web Service. Used as the name of the wsdl:service when mapped to WSDL 1.1.  Not
73       * allowed on interfaces. Defaults to the simple name of the Java class + ÒService".
74       *
75       * @param serviceName the new service name of the Web Service.
76       */
77      public void setServiceName(String serviceName)
78      {
79          this.serviceName = serviceName;
80      }
81  
82      /***
83       * Returns the XML namespace used for the WSDL and XML elements generated from this Web Service.
84       *
85       * @return the XML namespace used.
86       */
87      public String getTargetNamespace()
88      {
89          return targetNamespace;
90      }
91  
92      /***
93       * Sets the XML namespace used for the WSDL and XML elements generated from this Web Service.
94       *
95       * @param targetNamespace the new XML namespace used.
96       */
97      public void setTargetNamespace(String targetNamespace)
98      {
99          this.targetNamespace = targetNamespace;
100     }
101 
102     /***
103      * Returns a String representation of this <code>WebServiceAnnotation</code> attribute.
104      *
105      * @return a string representation.
106      */
107     public String toString()
108     {
109         return "WebServiceAnnotation{" +
110                 "endpointInterface='" + endpointInterface + "'" +
111                 ", name='" + name + "'" +
112                 ", serviceName='" + serviceName + "'" +
113                 ", targetNamespace='" + targetNamespace + "'" +
114                 "}";
115     }
116 }