KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > org > apache > xerces > internal > xs > XSSimpleTypeDefinition


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2003 The Apache Software Foundation. All rights
6  * reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Xerces" and "Apache Software Foundation" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache",
33  * nor may "Apache" appear in their name, without prior written
34  * permission of the Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of the Apache Software Foundation and was
52  * originally based on software copyright (c) 2003, International
53  * Business Machines, Inc., http://www.apache.org. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  */

57
58 package com.sun.org.apache.xerces.internal.xs;
59
60 /**
61  * This interface represents the Simple Type Definition schema component. This
62  * interface provides several query operations for facet components. Users
63  * can either retrieve the defined facets as XML Schema components, using
64  * the <code>facets</code> and the <code>multiValueFacets</code> attributes;
65  * or users can separately query a facet's properties using methods such as
66  * <code>getLexicalFacetValue</code>, <code>isFixedFacet</code>, etc.
67  */

68 public interface XSSimpleTypeDefinition extends XSTypeDefinition {
69     // Variety definitions
70
/**
71      * The variety is absent for the anySimpleType definition.
72      */

73     public static final short VARIETY_ABSENT = 0;
74     /**
75      * <code>Atomic</code> type.
76      */

77     public static final short VARIETY_ATOMIC = 1;
78     /**
79      * <code>List</code> type.
80      */

81     public static final short VARIETY_LIST = 2;
82     /**
83      * <code>Union</code> type.
84      */

85     public static final short VARIETY_UNION = 3;
86
87     // Facets
88
/**
89      * No facets defined.
90      */

91     public static final short FACET_NONE = 0;
92     /**
93      * 4.3.1 Length
94      */

95     public static final short FACET_LENGTH = 1;
96     /**
97      * 4.3.2 minLength.
98      */

99     public static final short FACET_MINLENGTH = 2;
100     /**
101      * 4.3.3 maxLength.
102      */

103     public static final short FACET_MAXLENGTH = 4;
104     /**
105      * 4.3.4 pattern.
106      */

107     public static final short FACET_PATTERN = 8;
108     /**
109      * 4.3.5 whitespace.
110      */

111     public static final short FACET_WHITESPACE = 16;
112     /**
113      * 4.3.7 maxInclusive.
114      */

115     public static final short FACET_MAXINCLUSIVE = 32;
116     /**
117      * 4.3.9 maxExclusive.
118      */

119     public static final short FACET_MAXEXCLUSIVE = 64;
120     /**
121      * 4.3.9 minExclusive.
122      */

123     public static final short FACET_MINEXCLUSIVE = 128;
124     /**
125      * 4.3.10 minInclusive.
126      */

127     public static final short FACET_MININCLUSIVE = 256;
128     /**
129      * 4.3.11 totalDigits .
130      */

131     public static final short FACET_TOTALDIGITS = 512;
132     /**
133      * 4.3.12 fractionDigits.
134      */

135     public static final short FACET_FRACTIONDIGITS = 1024;
136     /**
137      * 4.3.5 enumeration.
138      */

139     public static final short FACET_ENUMERATION = 2048;
140
141     /**
142      * A constant defined for the 'ordered' fundamental facet: not ordered.
143      */

144     public static final short ORDERED_FALSE = 0;
145     /**
146      * A constant defined for the 'ordered' fundamental facet: partially
147      * ordered.
148      */

149     public static final short ORDERED_PARTIAL = 1;
150     /**
151      * A constant defined for the 'ordered' fundamental facet: total ordered.
152      */

153     public static final short ORDERED_TOTAL = 2;
154     /**
155      * [variety]: one of {atomic, list, union} or absent.
156      */

157     public short getVariety();
158
159     /**
160      * If variety is <code>atomic</code> the primitive type definition (a
161      * built-in primitive datatype definition or the simple ur-type
162      * definition) is available, otherwise <code>null</code>.
163      */

164     public XSSimpleTypeDefinition getPrimitiveType();
165
166     /**
167      * Returns the closest built-in type category this type represents or
168      * derived from. For example, if this simple type is a built-in derived
169      * type integer the <code>INTEGER_DV</code> is returned.
170      */

171     public short getBuiltInKind();
172
173     /**
174      * If variety is <code>list</code> the item type definition (an atomic or
175      * union simple type definition) is available, otherwise
176      * <code>null</code>.
177      */

178     public XSSimpleTypeDefinition getItemType();
179
180     /**
181      * If variety is <code>union</code> the list of member type definitions (a
182      * non-empty sequence of simple type definitions) is available,
183      * otherwise an empty <code>XSObjectList</code>.
184      */

185     public XSObjectList getMemberTypes();
186
187     /**
188      * [facets]: all facets defined on this type. The value is a bit
189      * combination of FACET_XXX constants of all defined facets.
190      */

191     public short getDefinedFacets();
192
193     /**
194      * Convenience method. [Facets]: check whether a facet is defined on this
195      * type.
196      * @param facetName The name of the facet.
197      * @return True if the facet is defined, false otherwise.
198      */

199     public boolean isDefinedFacet(short facetName);
200
201     /**
202      * [facets]: all defined facets for this type which are fixed.
203      */

204     public short getFixedFacets();
205
206     /**
207      * Convenience method. [Facets]: check whether a facet is defined and
208      * fixed on this type.
209      * @param facetName The name of the facet.
210      * @return True if the facet is fixed, false otherwise.
211      */

212     public boolean isFixedFacet(short facetName);
213
214     /**
215      * Convenience method. Returns a value of a single constraining facet for
216      * this simple type definition. This method must not be used to retrieve
217      * values for <code>enumeration</code> and <code>pattern</code> facets.
218      * @param facetName The name of the facet, i.e.
219      * <code>FACET_LENGTH, FACET_TOTALDIGITS </code> (see
220      * <code>XSConstants</code>). To retrieve the value for a pattern or
221      * an enumeration, see <code>enumeration</code> and
222      * <code>pattern</code>.
223      * @return A value of the facet specified in <code>facetName</code> for
224      * this simple type definition or <code>null</code>.
225      */

226     public String JavaDoc getLexicalFacetValue(short facetName);
227
228     /**
229      * A list of enumeration values if it exists, otherwise an empty
230      * <code>StringList</code>.
231      */

232     public StringList getLexicalEnumeration();
233
234     /**
235      * A list of pattern values if it exists, otherwise an empty
236      * <code>StringList</code>.
237      */

238     public StringList getLexicalPattern();
239
240     /**
241      * Fundamental Facet: ordered.
242      */

243     public short getOrdered();
244
245     /**
246      * Fundamental Facet: cardinality.
247      */

248     public boolean getFinite();
249
250     /**
251      * Fundamental Facet: bounded.
252      */

253     public boolean getBounded();
254
255     /**
256      * Fundamental Facet: numeric.
257      */

258     public boolean getNumeric();
259
260     /**
261      * A list of constraining facets if it exists, otherwise an empty
262      * <code>XSObjectList</code>. Note: This method must not be used to
263      * retrieve values for <code>enumeration</code> and <code>pattern</code>
264      * facets.
265      */

266     public XSObjectList getFacets();
267
268     /**
269      * A list of enumeration and pattern constraining facets if it exists,
270      * otherwise an empty <code>XSObjectList</code>.
271      */

272     public XSObjectList getMultiValueFacets();
273
274     /**
275      * [annotations]: a set of annotations for this simple type component if
276      * it exists, otherwise an empty <code>XSObjectList</code>.
277      */

278     public XSObjectList getAnnotations();
279
280 }
281
Popular Tags