KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2001-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) 2001, 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.impl.xs.psvi;
59
60 /**
61  * This interface represents the Simple Type Definition schema component.
62  * The interface may be updated or replaced.
63  */

64 public interface XSSimpleTypeDefinition extends XSTypeDefinition {
65     // Variety definitions
66
/**
67      * The variety is absent for the anySimpleType definition.
68      */

69     public static final short VARIETY_ABSENT = 0;
70     /**
71      * <code>Atomic</code> type.
72      */

73     public static final short VARIETY_ATOMIC = 1;
74     /**
75      * <code>List</code> type.
76      */

77     public static final short VARIETY_LIST = 2;
78     /**
79      * <code>Union</code> type.
80      */

81     public static final short VARIETY_UNION = 3;
82
83     // Facets
84
/**
85      * No facets defined.
86      */

87     public static final short FACET_NONE = 0;
88     /**
89      * 4.3.1 Length
90      */

91     public static final short FACET_LENGTH = 1;
92     /**
93      * 4.3.2 minLength.
94      */

95     public static final short FACET_MINLENGTH = 2;
96     /**
97      * 4.3.3 maxLength.
98      */

99     public static final short FACET_MAXLENGTH = 4;
100     /**
101      * 4.3.4 pattern.
102      */

103     public static final short FACET_PATTERN = 8;
104     /**
105      * 4.3.5 whitespace.
106      */

107     public static final short FACET_WHITESPACE = 16;
108     /**
109      * 4.3.7 maxInclusive.
110      */

111     public static final short FACET_MAXINCLUSIVE = 32;
112     /**
113      * 4.3.9 maxExclusive.
114      */

115     public static final short FACET_MAXEXCLUSIVE = 64;
116     /**
117      * 4.3.9 minExclusive.
118      */

119     public static final short FACET_MINEXCLUSIVE = 128;
120     /**
121      * 4.3.10 minInclusive.
122      */

123     public static final short FACET_MININCLUSIVE = 256;
124     /**
125      * 4.3.11 totalDigits .
126      */

127     public static final short FACET_TOTALDIGITS = 512;
128     /**
129      * 4.3.12 fractionDigits.
130      */

131     public static final short FACET_FRACTIONDIGITS = 1024;
132     /**
133      * 4.3.5 enumeration.
134      */

135     public static final short FACET_ENUMERATION = 2048;
136
137     /**
138      * A constant defined for the 'ordered' fundamental facet: Not ordered.
139      */

140     public static final short ORDERED_FALSE = 0;
141     /**
142      * A constant defined for the 'ordered' fundamental facet: partially
143      * ordered.
144      */

145     public static final short ORDERED_PARTIAL = 1;
146     /**
147      * A constant defined for the 'ordered' fundamental facet: total ordered.
148      */

149     public static final short ORDERED_TOTAL = 2;
150     /**
151      * [variety]: one of {atomic, list, union} or absent
152      */

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

160     public XSSimpleTypeDefinition getPrimitiveType();
161
162     /**
163      * If variety is <code>list</code> the item type definition (an atomic or
164      * union simple type definition) is available, otherwise
165      * <code>null</code>.
166      */

167     public XSSimpleTypeDefinition getItemType();
168
169     /**
170      * If variety is <code>union</code> the list of member type definitions (a
171      * non-empty sequence of simple type definitions) is available,
172      * otherwise <code>null</code>.
173      */

174     public XSObjectList getMemberTypes();
175
176     /**
177      * [facets]: get all facets defined on this type. The value is a bit
178      * combination of FACET_XXX constants of all defined facets.
179      */

180     public short getDefinedFacets();
181
182     /**
183      * Convenience method. [Facets]: check whether a facet is defined on this
184      * type.
185      * @param facetName The name of the facet.
186      * @return True if the facet is defined, false otherwise.
187      */

188     public boolean isDefinedFacet(short facetName);
189
190     /**
191      * [facets]: get all facets defined and fixed on this type.
192      */

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

201     public boolean isFixedFacet(short facetName);
202
203     /**
204      * Convenience method. Returns a value of a single constraining facet for
205      * this simple type definition. This method must not be used to retrieve
206      * values for <code>enumeration</code> and <code>pattern</code> facets.
207      * @param facetName The name of the facet, i.e.
208      * <code>FACET_LENGTH, FACET_TOTALDIGITS </code> (see
209      * <code>XSConstants</code>).To retrieve value for pattern or
210      * enumeration, see <code>enumeration</code> and <code>pattern</code>.
211      * @return A value of the facet specified in <code>facetName</code> for
212      * this simple type definition or <code>null</code>.
213      */

214     public String JavaDoc getLexicalFacetValue(short facetName);
215
216     /**
217      * Returns a list of enumeration values.
218      */

219     public StringList getLexicalEnumeration();
220
221     /**
222      * Returns a list of pattern values.
223      */

224     public StringList getLexicalPattern();
225
226     /**
227      * Fundamental Facet: ordered
228      */

229     public short getOrdered();
230
231     /**
232      * Fundamental Facet: cardinality.
233      */

234     public boolean getFinite();
235
236     /**
237      * Fundamental Facet: bounded.
238      */

239     public boolean getBounded();
240
241     /**
242      * Fundamental Facet: numeric.
243      */

244     public boolean getNumeric();
245
246     /**
247      * Optional. A set of [annotation]s.
248      */

249     public XSObjectList getAnnotations();
250     /**
251      * @return list of constraining facets.
252      * This method must not be used to retrieve
253      * values for <code>enumeration</code> and <code>pattern</code> facets.
254      */

255     public XSObjectList getFacets();
256     
257     /**
258      * @return list of enumeration and pattern facets.
259      */

260     public XSObjectList getMultiValueFacets();
261
262 }
263
Popular Tags