01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.axis2.jaxws.description.builder;
21:
22: import java.lang.annotation.Annotation;
23:
24: public class WebMethodAnnot implements javax.jws.WebMethod {
25:
26: private String operationName = "";
27: private String action = "";
28: private boolean exclude = false;
29:
30: /** A WebMethodAnnot cannot be instantiated. */
31: private WebMethodAnnot() {
32:
33: }
34:
35: public static WebMethodAnnot createWebMethodAnnotImpl() {
36: return new WebMethodAnnot();
37: }
38:
39: public String operationName() {
40: return this .operationName;
41: }
42:
43: public String action() {
44: return this .action;
45: }
46:
47: public boolean exclude() {
48: return this .exclude;
49: }
50:
51: /** @param action The action to set. */
52: public void setAction(String action) {
53: this .action = action;
54: }
55:
56: /** @param exclude The exclude to set. */
57: public void setExclude(boolean exclude) {
58: this .exclude = exclude;
59: }
60:
61: /** @param operationName The operationName to set. */
62: public void setOperationName(String operationName) {
63: this .operationName = operationName;
64: }
65:
66: //hmm, should we really do this
67: public Class<Annotation> annotationType() {
68: return Annotation.class;
69: }
70:
71: /**
72: * Convenience method for unit testing. We will print all of the
73: * data members here.
74: */
75: public String toString() {
76: StringBuffer sb = new StringBuffer();
77: String newLine = "\n";
78: sb.append(newLine);
79: sb.append("@WebMethod.operationName= " + operationName);
80: sb.append(newLine);
81: sb.append("@WebMethod.action= " + action);
82: sb.append(newLine);
83: sb.append("@WebMethod.exclude = ");
84: if (exclude) {
85: sb.append("true");
86: } else {
87: sb.append("false");
88: }
89: sb.append(newLine);
90: return sb.toString();
91: }
92:
93: }
|