001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019:
020: package org.apache.axis2.jaxws.description.builder;
021:
022: import java.lang.annotation.Annotation;
023:
024: public class WebServiceAnnot implements javax.jws.WebService {
025:
026: private String name = "";
027: private String targetNamespace = "";
028: private String serviceName = "";
029: private String wsdlLocation = "";
030: private String endpointInterface = "";
031: private String portName = "";
032:
033: /** A WebServiceAnnot cannot be instantiated. */
034: private WebServiceAnnot() {
035:
036: }
037:
038: private WebServiceAnnot(String name, String targetNamespace,
039: String serviceName, String wsdlLocation,
040: String endpointInterface, String portName) {
041: this .name = name;
042: this .targetNamespace = targetNamespace;
043: this .serviceName = serviceName;
044: this .wsdlLocation = wsdlLocation;
045: this .endpointInterface = endpointInterface;
046: this .portName = portName;
047: }
048:
049: public static WebServiceAnnot createWebServiceAnnotImpl() {
050: return new WebServiceAnnot();
051: }
052:
053: public static WebServiceAnnot createWebServiceAnnotImpl(
054: String name, String targetNamespace, String serviceName,
055: String wsdlLocation, String endpointInterface,
056: String portName) {
057: return new WebServiceAnnot(name, targetNamespace, serviceName,
058: wsdlLocation, endpointInterface, portName);
059: }
060:
061: public String name() {
062: return this .name;
063: }
064:
065: public String targetNamespace() {
066: return this .targetNamespace;
067: }
068:
069: public String serviceName() {
070: return this .serviceName;
071: }
072:
073: public String wsdlLocation() {
074: return this .wsdlLocation;
075: }
076:
077: public String endpointInterface() {
078: return this .endpointInterface;
079: }
080:
081: public String portName() {
082: return this .portName;
083: }
084:
085: public Class<Annotation> annotationType() {
086: return Annotation.class;
087: }
088:
089: //Setters
090:
091: /** @param endpointInterface The endpointInterface to set. */
092: public void setEndpointInterface(String endpointInterface) {
093: this .endpointInterface = endpointInterface;
094: }
095:
096: /** @param name The name to set. */
097: public void setName(String name) {
098: this .name = name;
099: }
100:
101: /** @param portName The portName to set. */
102: public void setPortName(String portName) {
103: this .portName = portName;
104: }
105:
106: /** @param serviceName The serviceName to set. */
107: public void setServiceName(String serviceName) {
108: this .serviceName = serviceName;
109: }
110:
111: /** @param targetNamespace The targetNamespace to set. */
112: public void setTargetNamespace(String targetNamespace) {
113: this .targetNamespace = targetNamespace;
114: }
115:
116: /** @param wsdlLocation The wsdlLocation to set. */
117: public void setWsdlLocation(String wsdlLocation) {
118: this .wsdlLocation = wsdlLocation;
119: }
120:
121: /**
122: * Convenience method for unit testing. We will print all of the
123: * data members here.
124: */
125: public String toString() {
126: StringBuffer sb = new StringBuffer();
127: String newLine = "\n";
128: sb.append(newLine);
129: sb.append("@WebService.name= " + name);
130: sb.append(newLine);
131: sb.append("@WebService.serviceName= " + serviceName);
132: sb.append(newLine);
133: sb
134: .append("@WebService.endpointInterface= "
135: + endpointInterface);
136: sb.append(newLine);
137: sb.append("@WebService.targetNamespace= " + targetNamespace);
138: sb.append(newLine);
139: sb.append("@WebService.wsdlLocation= " + wsdlLocation);
140: sb.append(newLine);
141: sb.append("@WebService.portName= " + portName);
142: sb.append(newLine);
143: return sb.toString();
144: }
145: }
|