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. package com.sun.org.apache.xerces.internal.impl.xs.psvi;
  58. /**
  59. * This interface represents the Simple Type Definition schema component.
  60. * The interface may be updated or replaced.
  61. */
  62. public interface XSSimpleTypeDefinition extends XSTypeDefinition {
  63. // Variety definitions
  64. /**
  65. * The variety is absent for the anySimpleType definition.
  66. */
  67. public static final short VARIETY_ABSENT = 0;
  68. /**
  69. * <code>Atomic</code> type.
  70. */
  71. public static final short VARIETY_ATOMIC = 1;
  72. /**
  73. * <code>List</code> type.
  74. */
  75. public static final short VARIETY_LIST = 2;
  76. /**
  77. * <code>Union</code> type.
  78. */
  79. public static final short VARIETY_UNION = 3;
  80. // Facets
  81. /**
  82. * No facets defined.
  83. */
  84. public static final short FACET_NONE = 0;
  85. /**
  86. * 4.3.1 Length
  87. */
  88. public static final short FACET_LENGTH = 1;
  89. /**
  90. * 4.3.2 minLength.
  91. */
  92. public static final short FACET_MINLENGTH = 2;
  93. /**
  94. * 4.3.3 maxLength.
  95. */
  96. public static final short FACET_MAXLENGTH = 4;
  97. /**
  98. * 4.3.4 pattern.
  99. */
  100. public static final short FACET_PATTERN = 8;
  101. /**
  102. * 4.3.5 whitespace.
  103. */
  104. public static final short FACET_WHITESPACE = 16;
  105. /**
  106. * 4.3.7 maxInclusive.
  107. */
  108. public static final short FACET_MAXINCLUSIVE = 32;
  109. /**
  110. * 4.3.9 maxExclusive.
  111. */
  112. public static final short FACET_MAXEXCLUSIVE = 64;
  113. /**
  114. * 4.3.9 minExclusive.
  115. */
  116. public static final short FACET_MINEXCLUSIVE = 128;
  117. /**
  118. * 4.3.10 minInclusive.
  119. */
  120. public static final short FACET_MININCLUSIVE = 256;
  121. /**
  122. * 4.3.11 totalDigits .
  123. */
  124. public static final short FACET_TOTALDIGITS = 512;
  125. /**
  126. * 4.3.12 fractionDigits.
  127. */
  128. public static final short FACET_FRACTIONDIGITS = 1024;
  129. /**
  130. * 4.3.5 enumeration.
  131. */
  132. public static final short FACET_ENUMERATION = 2048;
  133. /**
  134. * A constant defined for the 'ordered' fundamental facet: Not ordered.
  135. */
  136. public static final short ORDERED_FALSE = 0;
  137. /**
  138. * A constant defined for the 'ordered' fundamental facet: partially
  139. * ordered.
  140. */
  141. public static final short ORDERED_PARTIAL = 1;
  142. /**
  143. * A constant defined for the 'ordered' fundamental facet: total ordered.
  144. */
  145. public static final short ORDERED_TOTAL = 2;
  146. /**
  147. * [variety]: one of {atomic, list, union} or absent
  148. */
  149. public short getVariety();
  150. /**
  151. * If variety is <code>atomic</code> the primitive type definition (a
  152. * built-in primitive datatype definition or the simple ur-type
  153. * definition) is available, otherwise <code>null</code>.
  154. */
  155. public XSSimpleTypeDefinition getPrimitiveType();
  156. /**
  157. * If variety is <code>list</code> the item type definition (an atomic or
  158. * union simple type definition) is available, otherwise
  159. * <code>null</code>.
  160. */
  161. public XSSimpleTypeDefinition getItemType();
  162. /**
  163. * If variety is <code>union</code> the list of member type definitions (a
  164. * non-empty sequence of simple type definitions) is available,
  165. * otherwise <code>null</code>.
  166. */
  167. public XSObjectList getMemberTypes();
  168. /**
  169. * [facets]: get all facets defined on this type. The value is a bit
  170. * combination of FACET_XXX constants of all defined facets.
  171. */
  172. public short getDefinedFacets();
  173. /**
  174. * Convenience method. [Facets]: check whether a facet is defined on this
  175. * type.
  176. * @param facetName The name of the facet.
  177. * @return True if the facet is defined, false otherwise.
  178. */
  179. public boolean isDefinedFacet(short facetName);
  180. /**
  181. * [facets]: get all facets defined and fixed on this type.
  182. */
  183. public short getFixedFacets();
  184. /**
  185. * Convenience method. [Facets]: check whether a facet is defined and
  186. * fixed on this type.
  187. * @param facetName The name of the facet.
  188. * @return True if the facet is fixed, false otherwise.
  189. */
  190. public boolean isFixedFacet(short facetName);
  191. /**
  192. * Convenience method. Returns a value of a single constraining facet for
  193. * this simple type definition. This method must not be used to retrieve
  194. * values for <code>enumeration</code> and <code>pattern</code> facets.
  195. * @param facetName The name of the facet, i.e.
  196. * <code>FACET_LENGTH, FACET_TOTALDIGITS </code> (see
  197. * <code>XSConstants</code>).To retrieve value for pattern or
  198. * enumeration, see <code>enumeration</code> and <code>pattern</code>.
  199. * @return A value of the facet specified in <code>facetName</code> for
  200. * this simple type definition or <code>null</code>.
  201. */
  202. public String getLexicalFacetValue(short facetName);
  203. /**
  204. * Returns a list of enumeration values.
  205. */
  206. public StringList getLexicalEnumeration();
  207. /**
  208. * Returns a list of pattern values.
  209. */
  210. public StringList getLexicalPattern();
  211. /**
  212. * Fundamental Facet: ordered
  213. */
  214. public short getOrdered();
  215. /**
  216. * Fundamental Facet: cardinality.
  217. */
  218. public boolean getFinite();
  219. /**
  220. * Fundamental Facet: bounded.
  221. */
  222. public boolean getBounded();
  223. /**
  224. * Fundamental Facet: numeric.
  225. */
  226. public boolean getNumeric();
  227. /**
  228. * Optional. A set of [annotation]s.
  229. */
  230. public XSObjectList getAnnotations();
  231. /**
  232. * @return list of constraining facets.
  233. * This method must not be used to retrieve
  234. * values for <code>enumeration</code> and <code>pattern</code> facets.
  235. */
  236. public XSObjectList getFacets();
  237. /**
  238. * @return list of enumeration and pattern facets.
  239. */
  240. public XSObjectList getMultiValueFacets();
  241. }