286N/A/*
286N/A * reserved comment block
286N/A * DO NOT REMOVE OR ALTER!
286N/A */
286N/A/*
286N/A * Copyright 2003,2004 The Apache Software Foundation.
286N/A *
286N/A * Licensed under the Apache License, Version 2.0 (the "License");
286N/A * you may not use this file except in compliance with the License.
286N/A * You may obtain a copy of the License at
286N/A *
286N/A * http://www.apache.org/licenses/LICENSE-2.0
286N/A *
286N/A * Unless required by applicable law or agreed to in writing, software
286N/A * distributed under the License is distributed on an "AS IS" BASIS,
286N/A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
286N/A * See the License for the specific language governing permissions and
286N/A * limitations under the License.
286N/A */
286N/A
286N/Apackage com.sun.org.apache.xerces.internal.xs;
286N/A
286N/A/**
286N/A * This interface represents the Simple Type Definition schema component. This
286N/A * interface provides several query operations for facet components. Users
286N/A * can either retrieve the defined facets as XML Schema components, using
286N/A * the <code>facets</code> and the <code>multiValueFacets</code> attributes;
286N/A * or users can separately query a facet's properties using methods such as
286N/A * <code>getLexicalFacetValue</code>, <code>isFixedFacet</code>, etc.
286N/A */
286N/Apublic interface XSSimpleTypeDefinition extends XSTypeDefinition {
286N/A // Variety definitions
286N/A /**
286N/A * The variety is absent for the anySimpleType definition.
286N/A */
286N/A public static final short VARIETY_ABSENT = 0;
286N/A /**
286N/A * <code>Atomic</code> type.
286N/A */
286N/A public static final short VARIETY_ATOMIC = 1;
286N/A /**
286N/A * <code>List</code> type.
286N/A */
286N/A public static final short VARIETY_LIST = 2;
286N/A /**
286N/A * <code>Union</code> type.
286N/A */
286N/A public static final short VARIETY_UNION = 3;
286N/A
286N/A // Facets
286N/A /**
286N/A * No facets defined.
286N/A */
286N/A public static final short FACET_NONE = 0;
286N/A /**
286N/A * 4.3.1 Length
286N/A */
286N/A public static final short FACET_LENGTH = 1;
286N/A /**
286N/A * 4.3.2 minLength.
286N/A */
286N/A public static final short FACET_MINLENGTH = 2;
286N/A /**
286N/A * 4.3.3 maxLength.
286N/A */
286N/A public static final short FACET_MAXLENGTH = 4;
286N/A /**
286N/A * 4.3.4 pattern.
286N/A */
286N/A public static final short FACET_PATTERN = 8;
286N/A /**
286N/A * 4.3.5 whitespace.
286N/A */
286N/A public static final short FACET_WHITESPACE = 16;
286N/A /**
286N/A * 4.3.7 maxInclusive.
286N/A */
286N/A public static final short FACET_MAXINCLUSIVE = 32;
286N/A /**
286N/A * 4.3.9 maxExclusive.
286N/A */
286N/A public static final short FACET_MAXEXCLUSIVE = 64;
286N/A /**
286N/A * 4.3.9 minExclusive.
286N/A */
286N/A public static final short FACET_MINEXCLUSIVE = 128;
286N/A /**
286N/A * 4.3.10 minInclusive.
286N/A */
286N/A public static final short FACET_MININCLUSIVE = 256;
286N/A /**
286N/A * 4.3.11 totalDigits .
286N/A */
286N/A public static final short FACET_TOTALDIGITS = 512;
286N/A /**
286N/A * 4.3.12 fractionDigits.
286N/A */
286N/A public static final short FACET_FRACTIONDIGITS = 1024;
286N/A /**
286N/A * 4.3.5 enumeration.
286N/A */
286N/A public static final short FACET_ENUMERATION = 2048;
286N/A
286N/A /**
286N/A * A constant defined for the 'ordered' fundamental facet: not ordered.
286N/A */
286N/A public static final short ORDERED_FALSE = 0;
286N/A /**
286N/A * A constant defined for the 'ordered' fundamental facet: partially
286N/A * ordered.
286N/A */
286N/A public static final short ORDERED_PARTIAL = 1;
286N/A /**
286N/A * A constant defined for the 'ordered' fundamental facet: total ordered.
286N/A */
286N/A public static final short ORDERED_TOTAL = 2;
286N/A /**
286N/A * [variety]: one of {atomic, list, union} or absent.
286N/A */
286N/A public short getVariety();
286N/A
286N/A /**
286N/A * If variety is <code>atomic</code> the primitive type definition (a
286N/A * built-in primitive datatype definition or the simple ur-type
286N/A * definition) is available, otherwise <code>null</code>.
286N/A */
286N/A public XSSimpleTypeDefinition getPrimitiveType();
286N/A
286N/A /**
286N/A * Returns the closest built-in type category this type represents or
286N/A * derived from. For example, if this simple type is a built-in derived
286N/A * type integer the <code>INTEGER_DV</code> is returned.
286N/A */
286N/A public short getBuiltInKind();
286N/A
286N/A /**
286N/A * If variety is <code>list</code> the item type definition (an atomic or
286N/A * union simple type definition) is available, otherwise
286N/A * <code>null</code>.
286N/A */
286N/A public XSSimpleTypeDefinition getItemType();
286N/A
286N/A /**
286N/A * If variety is <code>union</code> the list of member type definitions (a
286N/A * non-empty sequence of simple type definitions) is available,
286N/A * otherwise an empty <code>XSObjectList</code>.
286N/A */
286N/A public XSObjectList getMemberTypes();
286N/A
286N/A /**
286N/A * [facets]: all facets defined on this type. The value is a bit
286N/A * combination of FACET_XXX constants of all defined facets.
286N/A */
286N/A public short getDefinedFacets();
286N/A
286N/A /**
286N/A * Convenience method. [Facets]: check whether a facet is defined on this
286N/A * type.
286N/A * @param facetName The name of the facet.
286N/A * @return True if the facet is defined, false otherwise.
286N/A */
286N/A public boolean isDefinedFacet(short facetName);
286N/A
286N/A /**
286N/A * [facets]: all defined facets for this type which are fixed.
286N/A */
286N/A public short getFixedFacets();
286N/A
286N/A /**
286N/A * Convenience method. [Facets]: check whether a facet is defined and
286N/A * fixed on this type.
286N/A * @param facetName The name of the facet.
286N/A * @return True if the facet is fixed, false otherwise.
286N/A */
286N/A public boolean isFixedFacet(short facetName);
286N/A
286N/A /**
286N/A * Convenience method. Returns a value of a single constraining facet for
286N/A * this simple type definition. This method must not be used to retrieve
286N/A * values for <code>enumeration</code> and <code>pattern</code> facets.
286N/A * @param facetName The name of the facet, i.e.
286N/A * <code>FACET_LENGTH, FACET_TOTALDIGITS</code>.
286N/A * To retrieve the value for a pattern or
286N/A * an enumeration, see <code>enumeration</code> and
286N/A * <code>pattern</code>.
286N/A * @return A value of the facet specified in <code>facetName</code> for
286N/A * this simple type definition or <code>null</code>.
286N/A */
286N/A public String getLexicalFacetValue(short facetName);
286N/A
286N/A /**
286N/A * A list of enumeration values if it exists, otherwise an empty
286N/A * <code>StringList</code>.
286N/A */
286N/A public StringList getLexicalEnumeration();
286N/A
286N/A /**
286N/A * A list of pattern values if it exists, otherwise an empty
286N/A * <code>StringList</code>.
286N/A */
286N/A public StringList getLexicalPattern();
286N/A
286N/A /**
286N/A * Fundamental Facet: ordered.
286N/A */
286N/A public short getOrdered();
286N/A
286N/A /**
286N/A * Fundamental Facet: cardinality.
286N/A */
286N/A public boolean getFinite();
286N/A
286N/A /**
286N/A * Fundamental Facet: bounded.
286N/A */
286N/A public boolean getBounded();
286N/A
286N/A /**
286N/A * Fundamental Facet: numeric.
286N/A */
286N/A public boolean getNumeric();
286N/A
286N/A /**
286N/A * A list of constraining facets if it exists, otherwise an empty
286N/A * <code>XSObjectList</code>. Note: This method must not be used to
286N/A * retrieve values for <code>enumeration</code> and <code>pattern</code>
286N/A * facets.
286N/A */
286N/A public XSObjectList getFacets();
286N/A
286N/A /**
286N/A * A list of enumeration and pattern constraining facets if it exists,
286N/A * otherwise an empty <code>XSObjectList</code>.
286N/A */
286N/A public XSObjectList getMultiValueFacets();
286N/A
286N/A /**
286N/A * A sequence of [annotations] or an empty <code>XSObjectList</code>.
286N/A */
286N/A public XSObjectList getAnnotations();
286N/A
286N/A}