001: /*
002: * The contents of this file are subject to the terms of the Common Development
003: * and Distribution License (the License). You may not use this file except in
004: * compliance with the License.
005: *
006: * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
007: * or http://www.netbeans.org/cddl.txt.
008: *
009: * When distributing Covered Code, include this CDDL Header Notice in each file
010: * and include the License file at http://www.netbeans.org/cddl.txt.
011: * If applicable, add the following below the CDDL Header, with the fields
012: * enclosed by brackets [] replaced by your own identifying information:
013: * "Portions Copyrighted [year] [name of copyright owner]"
014: *
015: * The Original Software is NetBeans. The Initial Developer of the Original
016: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
017: * Microsystems, Inc. All Rights Reserved.
018: */
019:
020: package org.netbeans.modules.soa.mapper.basicmapper.methoid;
021:
022: import org.netbeans.modules.soa.mapper.common.basicmapper.literal.ILiteralUpdater;
023: import org.netbeans.modules.soa.mapper.common.basicmapper.methoid.IField;
024:
025: /**
026: * <p>
027: *
028: * Title: BasicMethoidField </p> <p>
029: *
030: * Description: BasicMethoidField implements IMethoidField providing the
031: * infomoration of a methoid field. </p> <p>
032: *
033: * Copyright: Copyright (c) 2002 </p> <p>
034: *
035: * Company: </p>
036: *
037: * @author Un Seng Leong
038: * @created December 26, 2002
039: * @version 1.0
040: */
041: public class BasicField implements IField {
042:
043: /**
044: * field data object
045: */
046: private Object mData;
047:
048: /**
049: * flag indicates input field
050: */
051: private boolean mIsInput;
052:
053: /**
054: * flag indicates output field
055: */
056: private boolean mIsOutput;
057:
058: /**
059: * the field name
060: */
061: private String mName;
062:
063: /**
064: * the tool tip text
065: */
066: private String mToolTip;
067:
068: /**
069: * the field type
070: */
071: private String mType;
072:
073: /**
074: * whether the field can represent/connect to a literal
075: */
076: private ILiteralUpdater mLiteralUpdater;
077:
078: /**
079: * Constructor a methoid field with all the specified basic field
080: * information.
081: *
082: * @param name the name of this field.
083: * @param type the tyoe of this field.
084: * @param tooltip the tooltip text of this field
085: * @param data the data object of this field
086: * @param isInput flag indicates if this is an input field
087: * @param isOutput flag indicates if this is an output field
088: * @param literalFieldInfo optional literal info
089: */
090: public BasicField(String name, String type, String tooltip,
091: Object data, boolean isInput, boolean isOutput,
092: ILiteralUpdater literalUpdater) {
093: mName = name;
094: mType = type;
095: mToolTip = tooltip;
096: mData = data;
097: mIsInput = isInput;
098: mIsOutput = isOutput;
099: mLiteralUpdater = literalUpdater;
100: }
101:
102: /**
103: * Return the methoid field in another object repersentation.
104: *
105: * @return the methoid field in another object repersentation.
106: */
107: public Object getData() {
108: return mData;
109: }
110:
111: /**
112: * Return the name of this methoid field.
113: *
114: * @return the name of this methoid field.
115: */
116: public String getName() {
117: return mName;
118: }
119:
120: /**
121: * Return the tooltip text of this methoid field.
122: *
123: * @return the tooltip text of this methoid field.
124: */
125: public String getToolTipText() {
126: return mToolTip;
127: }
128:
129: /**
130: * Return the type of this methoid field.
131: *
132: * @return the type of this methoid field.
133: */
134: public String getType() {
135: return mType;
136: }
137:
138: /**
139: * Return true if this methoid field is a input field, false otherwise.
140: *
141: * @return true if this methoid field is a input field, false otherwise.
142: */
143: public boolean isInput() {
144: return mIsInput;
145: }
146:
147: /**
148: * Return true if this methoid field is a output field, false otherwise.
149: *
150: * @return true if this methoid field is a output field, false otherwise.
151: */
152: public boolean isOutput() {
153: return mIsOutput;
154: }
155:
156: /**
157: * Set the name of this methoid field.
158: *
159: * @param name the name of this methoid field.
160: */
161: public void setName(String name) {
162: String oldName = mName;
163: mName = name;
164: }
165:
166: /**
167: * Set the tooptip text of this methoid field.
168: *
169: * @param tooltip the tooptip text of this methoid field.
170: */
171: public void setToolTipText(String tooltip) {
172: String oldToolTip = mToolTip;
173: mToolTip = tooltip;
174: }
175:
176: /**
177: * Set the type of this methoid field.
178: *
179: * @param type the type of this methoid field.
180: */
181: public void setType(String type) {
182: String oldType = mType;
183: mType = type;
184: }
185:
186: public void setInput(boolean value) {
187: mIsInput = value;
188: }
189:
190: public void setOutput(boolean value) {
191: mIsOutput = value;
192: }
193:
194: public void setData(Object data) {
195: mData = data;
196: }
197:
198: public ILiteralUpdater getLiteralUpdater() {
199: return mLiteralUpdater;
200: }
201:
202: public void setLiteralUpdater(ILiteralUpdater literalUpdater) {
203: mLiteralUpdater = literalUpdater;
204: }
205: }
|