KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > services > deployment > metadata > ConfigInfo


1 /*
2 * JBoss, Home of Professional Open Source
3 * Copyright 2005, JBoss Inc., and individual contributors as indicated
4 * by the @authors tag. See the copyright.txt in the distribution for a
5 * full listing of individual contributors.
6 *
7 * This is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as
9 * published by the Free Software Foundation; either version 2.1 of
10 * the License, or (at your option) any later version.
11 *
12 * This software is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this software; if not, write to the Free
19 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
21 */

22 package org.jboss.services.deployment.metadata;
23
24 import java.io.Serializable JavaDoc;
25 import java.util.ArrayList JavaDoc;
26 import java.util.List JavaDoc;
27
28 /**
29  * Simple POJO class to model XML configuration data
30  *
31  * @author <a HREF="mailto:dimitris@jboss.org">Dimitris Andreadis</a>
32  *
33  * @version $Revision: 37459 $
34  */

35 public class ConfigInfo
36    implements Serializable JavaDoc
37 {
38    /** @since 4.0.2 */
39    private static final long serialVersionUID = 3455531161586923775L;
40       
41    // name is used as an id for instances of this class
42
private String JavaDoc name;
43    private String JavaDoc copydir;
44    private String JavaDoc template;
45    private String JavaDoc extension;
46    private String JavaDoc description;
47    
48    private List JavaDoc propertyList = new ArrayList JavaDoc();
49    private List JavaDoc templateList = new ArrayList JavaDoc();
50    
51    // Constructors --------------------------------------------------
52
/**
53     * Default CTOR
54     */

55    public ConfigInfo()
56    {
57       // empty
58
}
59    
60    /**
61     * CTOR
62     * @param name
63     * @param template
64     * @param extension
65     */

66    public ConfigInfo(String JavaDoc name, String JavaDoc copydir,
67                      String JavaDoc template, String JavaDoc extension, String JavaDoc description)
68    {
69       this.name = name;
70       this.copydir = copydir;
71       this.template = template;
72       this.extension = extension;
73       this.description = description;
74    }
75    
76    // Accessors/Modifiers -------------------------------------------
77

78    
79    /**
80     * @return Returns the extension.
81     */

82    public String JavaDoc getExtension()
83    {
84       return extension;
85    }
86    
87    /**
88     * @param extension The extension to set.
89     */

90    public void setExtension(String JavaDoc extension)
91    {
92       this.extension = extension;
93    }
94    
95    /**
96     * @return Returns the name.
97     */

98    public String JavaDoc getName()
99    {
100       return name;
101    }
102    /**
103     * @param name The name to set.
104     */

105    public void setName(String JavaDoc name)
106    {
107       this.name = name;
108    }
109    
110    /**
111     * @return Returns the template.
112     */

113    public String JavaDoc getTemplate()
114    {
115       return template;
116    }
117    
118    /**
119     * @param template The template to set.
120     */

121    public void setTemplate(String JavaDoc template)
122    {
123       this.template = template;
124    }
125    
126    /**
127     * @return Returns the description.
128     */

129    public String JavaDoc getDescription()
130    {
131       return description;
132    }
133    
134    /**
135     * @param description The description to set.
136     */

137    public void setDescription(String JavaDoc description)
138    {
139       this.description = description;
140    }
141
142    /**
143     * @return Returns the copydir.
144     */

145    public String JavaDoc getCopydir()
146    {
147       return copydir;
148    }
149    
150    /**
151     * @param copydir The copydir to set.
152     */

153    public void setCopydir(String JavaDoc copydir)
154    {
155       this.copydir = copydir;
156    }
157    
158    /**
159     * @return Returns the propertyList.
160     */

161    public List JavaDoc getPropertyInfoList()
162    {
163       return propertyList;
164    }
165    
166    /**
167     * @param propertyList The propertyList to set.
168     */

169    public void setPropertyInfoList(List JavaDoc propertyList)
170    {
171       this.propertyList = propertyList;
172    }
173    
174    public void addPropertyInfo(PropertyInfo propertyInfo)
175    {
176       this.propertyList.add(propertyInfo);
177    }
178    
179    /**
180     * @return Returns the templateList.
181     */

182    public List JavaDoc getTemplateInfoList()
183    {
184       return templateList;
185    }
186    
187    /**
188     * @param templateList The templateList to set.
189     */

190    public void setTemplateInfoList(List JavaDoc templateList)
191    {
192       this.templateList = templateList;
193    }
194    
195    public void addTemplateInfo(TemplateInfo templateInfo)
196    {
197       this.templateList.add(templateInfo);
198    }
199    
200    // Object Methods ------------------------------------------------
201

202    public String JavaDoc toString()
203    {
204       StringBuffer JavaDoc sb = new StringBuffer JavaDoc(1024);
205       sb.append('[')
206          .append("name=").append(name)
207          .append(", copydir=").append(copydir)
208          .append(", template=").append(template)
209          .append(", extension=").append(extension)
210          .append(", description=").append(description)
211          .append(", propertyList=").append(propertyList)
212          .append(", templateList=").append(templateList)
213          .append(']');
214       return sb.toString();
215    }
216
217    public boolean equals(Object JavaDoc other)
218    {
219       if(this == other) return true;
220       if(!(other instanceof ConfigInfo)) return false;
221
222       // base equality on name
223
if (name != null && name.equals(((ConfigInfo)other).name))
224          return true;
225       else
226          return false;
227    }
228
229    public int hashCode()
230    {
231       if (name != null)
232          return name.hashCode();
233       else
234          return 0;
235    }
236 }
237
Popular Tags