KickJava   Java API By Example, From Geeks To Geeks.

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


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 JagSkeletConfig
26  *
27  *
28  * @author Wendel D. de Witte
29  * @version %I%, %G%
30  */

31 public class JagSkeletConfig {
32
33    /** Field author */
34    private String JavaDoc author;
35
36    /** Field version */
37    private String JavaDoc version;
38
39    /** Field company */
40    private String JavaDoc company;
41
42    /** Field templates */
43    private Collection templates = new HashSet();
44
45
46    /**
47     * Method setAuthor
48     *
49     *
50     * @param author
51     *
52     */

53    public void setAuthor(String JavaDoc author) {
54       this.author = author;
55    }
56
57
58    /**
59     * Method setVersion
60     *
61     *
62     * @param version
63     *
64     */

65    public void setVersion(String JavaDoc version) {
66       this.version = version;
67    }
68
69
70    /**
71     * Method setCompany
72     *
73     *
74     * @param company
75     *
76     */

77    public void setCompany(String JavaDoc company) {
78       this.company = company;
79    }
80
81
82    /**
83     * Method addTemplateUrl
84     *
85     *
86     * @param template
87     *
88     */

89    public void addTemplateUrl(String JavaDoc template) {
90       this.templates.add(template);
91    }
92
93
94    /**
95     * Method addTemplateUrl
96     *
97     *
98     * @param templates
99     *
100     */

101    public void addTemplateUrl(Collection templates) {
102
103       if (templates == null) {
104          return;
105       }
106
107       Iterator iterator = templates.iterator();
108
109       while (iterator.hasNext()) {
110          addTemplateUrl((String JavaDoc) iterator.next());
111       }
112    }
113
114
115    /**
116     * Method getAuthor
117     *
118     *
119     * @return
120     *
121     */

122    public String JavaDoc getAuthor() {
123       return (this.author);
124    }
125
126
127    /**
128     * Method getVersion
129     *
130     *
131     * @return
132     *
133     */

134    public String JavaDoc getVersion() {
135       return (this.version);
136    }
137
138
139    /**
140     * Method getCompany
141     *
142     *
143     * @return
144     *
145     */

146    public String JavaDoc getCompany() {
147       return (this.company);
148    }
149
150
151    /**
152     * Method getTemplatesUrls
153     *
154     *
155     * @return
156     *
157     */

158    public String JavaDoc[] getTemplatesUrls() {
159       return (String JavaDoc[]) templates.toArray(new String JavaDoc[templates.size()]);
160    }
161
162
163    /**
164     * Method toString
165     *
166     *
167     * @return
168     *
169     */

170    public String JavaDoc toString() {
171       StringBuffer JavaDoc toString = new StringBuffer JavaDoc();
172       toString.append("\nauthor : ");
173       toString.append(author);
174       toString.append("\nversion : ");
175       toString.append(version);
176       toString.append("\ncompany : ");
177       toString.append(company);
178       toString.append("\ncity : ");
179       toString.append(templates);
180       toString.append("\ntemplates : ");
181
182       return new String JavaDoc(toString);
183    }
184 }
Popular Tags