KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > finalist > jag > taglib > AttributeDef


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.taglib;
19
20
21 import java.util.Collection JavaDoc;
22
23
24 /**
25  * Class AttributeDef
26  *
27  *
28  * @author Wendel D. de Witte
29  * @version %I%, %G%
30  */

31 public class AttributeDef {
32
33    /** Field name */
34    private String JavaDoc name = null;
35
36    /** Field required */
37    private boolean required = false;
38
39
40    /**
41     * Constructor AttributeDef
42     *
43     *
44     */

45    public AttributeDef() {
46    }
47
48
49    /**
50     * Constructor AttributeDef
51     *
52     *
53     * @param n
54     *
55     */

56    public AttributeDef(AttributeDef n) {
57       this.name = n.name;
58       this.required = n.required;
59    }
60
61
62    /**
63     * Method setName
64     *
65     *
66     * @param name
67     *
68     */

69    public void setName(String JavaDoc name) {
70       this.name = name;
71    }
72
73
74    /**
75     * Method setRequired
76     *
77     *
78     * @param required
79     *
80     */

81    public void setRequired(boolean required) {
82       this.required = required;
83    }
84
85
86    /**
87     * Method setRequired
88     *
89     *
90     * @param required
91     *
92     */

93    public void setRequired(String JavaDoc required) {
94
95       this.required = !((required == null)
96          || required.equalsIgnoreCase("false")
97          || required.equalsIgnoreCase("0"));
98    }
99
100
101    /**
102     * Method getName
103     *
104     *
105     * @return
106     *
107     */

108    public String JavaDoc getName() {
109       return (this.name);
110    }
111
112
113    /**
114     * Method getRequired
115     *
116     *
117     * @return
118     *
119     */

120    public boolean getRequired() {
121       return (this.required);
122    }
123
124
125    /**
126     * Method toString
127     *
128     *
129     * @return
130     *
131     */

132    public String JavaDoc toString() {
133       StringBuffer JavaDoc toString = new StringBuffer JavaDoc();
134       toString.append("\name : ");
135       toString.append(name);
136       toString.append("\required : ");
137       toString.append(required);
138
139       return new String JavaDoc(toString);
140    }
141 }
Popular Tags