001: /*
002: * Portions Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package com.sun.tools.internal.ws.processor.model;
027:
028: import java.util.ArrayList;
029: import java.util.List;
030:
031: import com.sun.tools.internal.ws.processor.model.java.JavaParameter;
032: import com.sun.xml.internal.ws.model.Mode;
033:
034: /**
035: *
036: * @author WS Development Team
037: */
038: public class Parameter extends ModelObject {
039:
040: public Parameter() {
041: }
042:
043: public Parameter(String name) {
044: this .name = name;
045: }
046:
047: public String getName() {
048: return name;
049: }
050:
051: public void setName(String s) {
052: name = s;
053: }
054:
055: public JavaParameter getJavaParameter() {
056: return javaParameter;
057: }
058:
059: public void setJavaParameter(JavaParameter p) {
060: javaParameter = p;
061: }
062:
063: public AbstractType getType() {
064: return type;
065: }
066:
067: public void setType(AbstractType t) {
068: type = t;
069: }
070:
071: public String getTypeName() {
072: return typeName;
073: }
074:
075: public void setTypeName(String t) {
076: typeName = t;
077: }
078:
079: public Block getBlock() {
080: return block;
081: }
082:
083: public void setBlock(Block d) {
084: block = d;
085: }
086:
087: public Parameter getLinkedParameter() {
088: return link;
089: }
090:
091: public void setLinkedParameter(Parameter p) {
092: link = p;
093: }
094:
095: public boolean isEmbedded() {
096: return embedded;
097: }
098:
099: public void setEmbedded(boolean b) {
100: embedded = b;
101: }
102:
103: public void accept(ModelVisitor visitor) throws Exception {
104: visitor.visit(this );
105: }
106:
107: private String name;
108: private JavaParameter javaParameter;
109: private AbstractType type;
110: private Block block;
111: private Parameter link;
112: private boolean embedded;
113: private String typeName;
114: private String customName;
115: private Mode mode;
116:
117: public int getParameterIndex() {
118: return parameterOrderPosition;
119: }
120:
121: public void setParameterIndex(int parameterOrderPosition) {
122: this .parameterOrderPosition = parameterOrderPosition;
123: }
124:
125: public boolean isReturn() {
126: return (parameterOrderPosition == -1);
127: }
128:
129: // 0 is the first parameter, -1 is the return type
130: private int parameterOrderPosition;
131:
132: /**
133: * @return Returns the customName.
134: */
135: public String getCustomName() {
136: return customName;
137: }
138:
139: /**
140: * @param customName The customName to set.
141: */
142: public void setCustomName(String customName) {
143: this .customName = customName;
144: }
145:
146: private List<String> annotations = new ArrayList<String>();
147:
148: /**
149: * @return Returns the annotations.
150: */
151: public List<String> getAnnotations() {
152: return annotations;
153: }
154:
155: /**
156: * @param annotations The annotations to set.
157: */
158: public void setAnnotations(List<String> annotations) {
159: this .annotations = annotations;
160: }
161:
162: public void setMode(Mode mode) {
163: this .mode = mode;
164: }
165:
166: public boolean isIN() {
167: return (mode == Mode.IN);
168: }
169:
170: public boolean isOUT() {
171: return (mode == Mode.OUT);
172: }
173:
174: public boolean isINOUT() {
175: return (mode == Mode.INOUT);
176: }
177:
178: }
|