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 WebParamAnnot implements javax.jws.WebParam {
025:
026: private String name;
027: private String targetNamespace;
028: private Mode mode = Mode.IN;
029: private boolean header;
030: private String partName;
031:
032: /** A WebParamAnnot cannot be instantiated. */
033: private WebParamAnnot() {
034:
035: }
036:
037: public static WebParamAnnot createWebParamAnnotImpl() {
038: return new WebParamAnnot();
039: }
040:
041: /**
042: * Get the 'name'
043: *
044: * @return String
045: */
046: public String name() {
047: return this .name;
048: }
049:
050: public String targetNamespace() {
051: return this .targetNamespace;
052: }
053:
054: public Mode mode() {
055: return this .mode;
056: }
057:
058: public boolean header() {
059: return this .header;
060: }
061:
062: public String partName() {
063: return this .partName;
064: }
065:
066: /** @param name The name to set. */
067: public void setName(String name) {
068: this .name = name;
069: }
070:
071: /** @param targetNamespace The targetNamespace to set. */
072: public void setTargetNamespace(String targetNamespace) {
073: this .targetNamespace = targetNamespace;
074: }
075:
076: /** @param mode The mode to set. */
077: public void setMode(Mode mode) {
078: this .mode = mode;
079: }
080:
081: /** @param header The header to set. */
082: public void setHeader(boolean header) {
083: this .header = header;
084: }
085:
086: /** @param partName The partName to set. */
087: public void setPartName(String partName) {
088: this .partName = partName;
089: }
090:
091: public Class<Annotation> annotationType() {
092: return Annotation.class;
093: }
094:
095: /**
096: * Convenience method for unit testing. We will print all of the
097: * data members here.
098: */
099: public String toString() {
100: StringBuffer sb = new StringBuffer();
101: String newLine = "\n";
102: sb.append(newLine);
103: sb.append("@WebParam.name= " + name);
104: sb.append(newLine);
105: sb.append("@WebParam.partName= " + partName);
106: sb.append(newLine);
107: sb.append("@WebParam.mode = " + mode.toString());
108: sb.append(newLine);
109: sb.append("@WebParam.targetNamespace= " + targetNamespace);
110: sb.append(newLine);
111: sb.append("@WebParam.header= ");
112: if (header) {
113: sb.append("true");
114: } else {
115: sb.append("false");
116: }
117: sb.append(newLine);
118: return sb.toString();
119: }
120:
121: }
|