KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > finalist > jag > skelet > ModuleData


1 /* Copyright (C) 2003 Finalist IT Group
2  *
3  * This file is part of JAG - the Java J2EE Application Generator
4  *
5  * JAG is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * JAG is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  * You should have received a copy of the GNU General Public License
14  * along with JAG; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  */

17
18 package com.finalist.jag.skelet;
19
20
21 import java.util.*;
22
23
24 /**
25  * Class ModuleData
26  *
27  *
28  * @author Wendel D. de Witte
29  * @version %I%, %G%
30  */

31 public class ModuleData {
32
33    /** Field COLLECTION */
34    private static final short COLLECTION = 1;
35
36    /** Field STRING */
37    private static final short STRING = 2;
38
39    /** Field name */
40    private String JavaDoc name;
41
42    /** Field value */
43    private Object JavaDoc value;
44
45    /** Field valueType */
46    private short valueType;
47
48
49    /**
50     * Constructor ModuleData
51     *
52     *
53     * @param name
54     * @param value
55     *
56     */

57    public ModuleData(String JavaDoc name, String JavaDoc value) {
58       setName(name);
59       setValue(value);
60    }
61
62
63    /**
64     * Constructor ModuleData
65     *
66     *
67     * @param name
68     * @param value
69     *
70     */

71    public ModuleData(String JavaDoc name, Collection value) {
72       setName(name);
73       setValue(value);
74    }
75
76
77    /**
78     * Method getName
79     *
80     *
81     * @return
82     *
83     */

84    public String JavaDoc getName() {
85       return (this.name);
86    }
87
88
89    /**
90     * Method setName
91     *
92     *
93     * @param name
94     *
95     */

96    public void setName(String JavaDoc name) {
97       this.name = name;
98    }
99
100
101    /**
102     * Method getValue
103     *
104     *
105     * @return
106     *
107     */

108    public Object JavaDoc getValue() {
109       return (this.value);
110    }
111
112
113    /**
114     * Method setValue
115     *
116     *
117     * @param value
118     *
119     */

120    public void setValue(String JavaDoc value) {
121       this.valueType = STRING;
122       this.value = value;
123    }
124
125
126    /**
127     * Method setValue
128     *
129     *
130     * @param value
131     *
132     */

133    public void setValue(Collection value) {
134       this.valueType = COLLECTION;
135       this.value = value;
136    }
137
138
139    /**
140     * Method isValueCollection
141     *
142     *
143     * @return
144     *
145     */

146    public boolean isValueCollection() {
147       return this.valueType == COLLECTION;
148    }
149
150
151    /**
152     * Method isValueString
153     *
154     *
155     * @return
156     *
157     */

158    public boolean isValueString() {
159       return this.valueType == STRING;
160    }
161 }
Popular Tags