001: /* Copyright (C) 2003 Finalist IT Group
002: *
003: * This file is part of JAG - the Java J2EE Application Generator
004: *
005: * JAG is free software; you can redistribute it and/or modify
006: * it under the terms of the GNU General Public License as published by
007: * the Free Software Foundation; either version 2 of the License, or
008: * (at your option) any later version.
009: * JAG is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012: * GNU General Public License for more details.
013: * You should have received a copy of the GNU General Public License
014: * along with JAG; if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
016: */
017:
018: package com.finalist.jag.skelet;
019:
020: import java.util.*;
021:
022: /**
023: * Class ModuleData
024: *
025: *
026: * @author Wendel D. de Witte
027: * @version %I%, %G%
028: */
029: public class ModuleData {
030:
031: /** Field COLLECTION */
032: private static final short COLLECTION = 1;
033:
034: /** Field STRING */
035: private static final short STRING = 2;
036:
037: /** Field name */
038: private String name;
039:
040: /** Field value */
041: private Object value;
042:
043: /** Field valueType */
044: private short valueType;
045:
046: /**
047: * Constructor ModuleData
048: *
049: *
050: * @param name
051: * @param value
052: *
053: */
054: public ModuleData(String name, String value) {
055: setName(name);
056: setValue(value);
057: }
058:
059: /**
060: * Constructor ModuleData
061: *
062: *
063: * @param name
064: * @param value
065: *
066: */
067: public ModuleData(String name, Collection value) {
068: setName(name);
069: setValue(value);
070: }
071:
072: /**
073: * Method getName
074: *
075: *
076: * @return
077: *
078: */
079: public String getName() {
080: return (this .name);
081: }
082:
083: /**
084: * Method setName
085: *
086: *
087: * @param name
088: *
089: */
090: public void setName(String name) {
091: this .name = name;
092: }
093:
094: /**
095: * Method getValue
096: *
097: *
098: * @return
099: *
100: */
101: public Object getValue() {
102: return (this .value);
103: }
104:
105: /**
106: * Method setValue
107: *
108: *
109: * @param value
110: *
111: */
112: public void setValue(String value) {
113: this .valueType = STRING;
114: this .value = value;
115: }
116:
117: /**
118: * Method setValue
119: *
120: *
121: * @param value
122: *
123: */
124: public void setValue(Collection value) {
125: this .valueType = COLLECTION;
126: this .value = value;
127: }
128:
129: /**
130: * Method isValueCollection
131: *
132: *
133: * @return
134: *
135: */
136: public boolean isValueCollection() {
137: return this .valueType == COLLECTION;
138: }
139:
140: /**
141: * Method isValueString
142: *
143: *
144: * @return
145: *
146: */
147: public boolean isValueString() {
148: return this.valueType == STRING;
149: }
150: }
|