KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > axi > datatype > CustomDatatype


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 package org.netbeans.modules.xml.axi.datatype;
21
22 import java.util.List JavaDoc;
23 import org.netbeans.modules.xml.schema.model.Whitespace;
24
25 /**
26  *
27  * @author Ayub Khan
28  */

29 public class CustomDatatype extends Datatype {
30     
31     private String JavaDoc name;
32     private Datatype base;
33     
34     /** Creates a new instance of CustomDatatype */
35     public CustomDatatype(String JavaDoc name) {
36         this.name = name;
37     }
38     
39     /** Creates a new instance of CustomDatatype */
40     public CustomDatatype(String JavaDoc name, Datatype baseType) {
41         this.name = name;
42         this.base = baseType;
43     }
44     
45     public String JavaDoc getName() {
46         return name;
47     }
48     
49     public void setName(String JavaDoc name) {
50         this.name = name;
51     }
52     
53     public Datatype getBase() {
54         return base;
55     }
56     
57     public void setBase(Datatype baseType) {
58         this.base = baseType;
59     }
60     
61     public Datatype.Kind getKind() {
62         return getBase().getKind();
63     }
64     
65     public List JavaDoc<Datatype.Facet> getApplicableFacets() {
66         return getBase().getApplicableFacets();
67     }
68     
69     public boolean hasFacets() {
70         return getBase().hasFacets();
71     }
72     
73     public boolean isList() {
74         return getBase().isList();
75     }
76     
77     public void setIsList(boolean b) {
78         getBase().setIsList(b);
79     }
80     
81     /*
82      * returns pattern value (this corresponds to the value of pattern facet in schema)
83      *
84      * @return pattern
85      */

86     public List JavaDoc<? extends String JavaDoc> getPatterns() {
87         return getBase().getPatterns();
88     }
89     
90     /*
91      * returns enumeration values (this corresponds to the values of enumeration facets in schema)
92      *
93      * @return enumeration
94      */

95     public List JavaDoc<? extends Object JavaDoc> getEnumerations() {
96         return getBase().getEnumerations();
97     }
98     
99     /*
100      * returns whitespace value (this corresponds to the value of whitespace facet in schema)
101      *
102      * @return whitespaces
103      */

104     public List JavaDoc<Whitespace.Treatment> getWhiteSpaces() {
105         return getBase().getWhiteSpaces();
106     }
107     
108     /*
109      * returns total digits value (this corresponds to the value of totalDigits facet in schema)
110      *
111      * @return totalDigits
112      */

113     public List JavaDoc<? extends Number JavaDoc> getTotalDigits() {
114         return getBase().getTotalDigits();
115     }
116     
117     /*
118      * returns fraction digits value (this corresponds to the value of fractionDigits facet in schema)
119      *
120      * @return fractionDigits
121      */

122     public List JavaDoc<? extends Number JavaDoc> getFractionDigits() {
123         return getBase().getFractionDigits();
124     }
125     
126     /*
127      * returns maximum Inclusive value (this corresponds to the value of maxInclusive facet in schema)
128      *
129      * @return maxInclusive
130      */

131     public List JavaDoc<? extends Object JavaDoc> getMaxInclusives() {
132         return getBase().getMaxInclusives();
133     }
134     
135     /*
136      * returns maximum Exclusive value (this corresponds to the value of maxExclusive facet in schema)
137      *
138      * @return maxExclusive
139      */

140     public List JavaDoc<? extends Object JavaDoc> getMaxExclusives() {
141         return getBase().getMaxExclusives();
142     }
143     
144     /*
145      * returns minimum Inclusive value (this corresponds to the value of minInclusive facet in schema)
146      *
147      * @return minInclusive
148      */

149     public List JavaDoc<? extends Object JavaDoc> getMinInclusives() {
150         return getBase().getMinInclusives();
151     }
152     
153     /*
154      * returns minExclusive value (this corresponds to the value of minExclusive facet in schema)
155      *
156      * @return minExclusive
157      */

158     public List JavaDoc<? extends Object JavaDoc> getMinExclusives() {
159         return getBase().getMinExclusives();
160     }
161     
162     /*
163      * returns length (this corresponds to the value of length facet in schema)
164      *
165      * @return length
166      */

167     public List JavaDoc<? extends Number JavaDoc> getLengths() {
168         return getBase().getLengths();
169     }
170     
171     /*
172      * returns minimum length value (this corresponds to the value of minlength facet in schema)
173      *
174      * @return minLength
175      */

176     public List JavaDoc<? extends Number JavaDoc> getMinLengths() {
177         return getBase().getMinLengths();
178     }
179     
180     /*
181      * returns maximum length value (this corresponds to the value of maxlength facet in schema)
182      *
183      * @return maxLength
184      */

185     public List JavaDoc<? extends Number JavaDoc> getMaxLengths() {
186         return getBase().getMaxLengths();
187     }
188     
189     /*
190      * set pattern value (this corresponds to the value of pattern facet in schema)
191      *
192      * @param pattern
193      */

194     public void addPattern(String JavaDoc pattern) {
195         getBase().addPattern(pattern);
196     }
197     
198     /*
199      * set enumeration values (this corresponds to the values of enumeration facets in schema)
200      *
201      * @param enumeration
202      */

203     public void addEnumeration(Object JavaDoc enumeration) {
204         getBase().addEnumeration(enumeration);
205     }
206     
207     /*
208      * set whitespace value (this corresponds to the value of whitespace facet in schema)
209      *
210      * @param whitespace
211      */

212     public void addWhitespace(Whitespace.Treatment whitespace) {
213         getBase().addWhitespace(whitespace);
214     }
215     
216     /*
217      * set total digits value (this corresponds to the value of totalDigits facet in schema)
218      *
219      * @param totalDigits
220      */

221     public void addTotalDigits(int totalDigits ) {
222         getBase().addTotalDigits(totalDigits);
223     }
224     
225     /*
226      * set fraction digits value (this corresponds to the value of fractionDigits facet in schema)
227      *
228      * @param fractionDigits
229      */

230     public void addFractionDigits(int fractionDigits) {
231         getBase().addFractionDigits(fractionDigits);
232     }
233     
234     /*
235      * set maximum Inclusive value (this corresponds to the value of maxInclusive facet in schema)
236      *
237      * @param maxInclusive
238      */

239     public void addMaxInclusive(Object JavaDoc maxInclusive) {
240         getBase().addMaxInclusive(maxInclusive);
241     }
242     
243     /*
244      * set maximum Exclusive value (this corresponds to the value of maxExclusive facet in schema)
245      *
246      * @param maxExclusive
247      */

248     public void addMaxExclusive(Object JavaDoc maxExclusive) {
249         getBase().addMaxExclusive(maxExclusive);
250     }
251     
252     /*
253      * set minimum Inclusive value (this corresponds to the value of minInclusive facet in schema)
254      *
255      * @param minInclusive
256      */

257     public void addMinInclusive(Object JavaDoc minInclusive) {
258         getBase().addMinInclusive(minInclusive);
259     }
260     
261     /*
262      * set minExclusive value (this corresponds to the value of minExclusive facet in schema)
263      *
264      * @param minExclusive
265      */

266     public void addMinExclusive(Object JavaDoc minExclusive) {
267         getBase().addMinExclusive(minExclusive);
268     }
269     
270     /*
271      * set length (this corresponds to the value of length facet in schema)
272      *
273      * @param length
274      */

275     public void addLength(int length) {
276         getBase().addLength(length);
277     }
278     
279     /*
280      * set minimum length value (this corresponds to the value of minlength facet in schema)
281      *
282      * @param minLength
283      */

284     public void addMinLength(int minLength) {
285         getBase().addMinLength(minLength);
286     }
287     
288     /*
289      * set maximum length value (this corresponds to the value of maxlength facet in schema)
290      *
291      * @param maxLength
292      */

293     public void addMaxLength(int maxLength) {
294         getBase().addMaxLength(maxLength);
295     }
296     
297     public String JavaDoc toString() {
298         return getName();
299     }
300 }
301
Popular Tags