org.apache.xerces.impl.dv
Interface XSSimpleType

All Superinterfaces:
XSTypeDecl
All Known Subinterfaces:
XSAtomicSimpleType, XSListSimpleType, XSUnionSimpleType

public interface XSSimpleType
extends XSTypeDecl

This interface XSSimpleType represents the simple type definition of schema component and defines methods to query the information contained. Any simple type (atomic, list or union) will implement this interface. It inherits from XSTypeDecl.

Version:
$Id: XSSimpleType.java,v 1.7 2002/01/29 01:15:11 lehors Exp $
Author:
Sandy Gao, IBM

Field Summary
static short CARDINALITY_COUNTABLY_INFINITE
          countably infinite cardinality
static short CARDINALITY_FINITE
          finite cardinality
static short FACET_ENUMERATION
          the enumeration facet
static short FACET_FRACTIONDIGITS
          the fractionDigits facet
static short FACET_LENGTH
          the length facet
static short FACET_MAXEXCLUSIVE
          the maxExclusive facet
static short FACET_MAXINCLUSIVE
          the maxInclusive facet
static short FACET_MAXLENGTH
          the maxLength facet
static short FACET_MINEXCLUSIVE
          the minExclusive facet
static short FACET_MININCLUSIVE
          the minInclusive facet
static short FACET_MINLENGTH
          the minLength facet
static short FACET_PATTERN
          the pattern facet
static short FACET_TOTALDIGITS
          the totalDigits facet
static short FACET_WHITESPACE
          the whiteSpace facet
static short ORDERED_FALSE
          not ordered
static short ORDERED_PARTIAL
          partically ordered
static short ORDERED_TOTAL
          totally ordered
static short VARIETY_ABSENT
          the absent variety, for anySimpleType
static short VARIETY_ATOMIC
          the atomic variety
static short VARIETY_LIST
          the list variety
static short VARIETY_UNION
          the union variety
static short WS_COLLAPSE
          collapse the white spaces
static short WS_PRESERVE
          preserve the white spaces
static short WS_REPLACE
          replace the white spaces
 
Fields inherited from interface org.apache.xerces.impl.xs.XSTypeDecl
COMPLEX_TYPE, SIMPLE_TYPE
 
Method Summary
 void applyFacets(XSFacets facets, short presentFacet, short fixedFacet, ValidationContext context)
          If this type is created from restriction, then some facets can be applied to the simple type.
 short getCardinalityFacet()
          Return the value of the "cardinality" fundamental facet.
 short getDefinedFacets()
          bit combination of the constants defined in this simple type.
 short getOrderedFacet()
          Return the value of the "ordered" fundamental facet.
 short getVariety()
          Get the variety of the simple type: atomic, list or union.
 short getWhitespace()
          Return the whitespace corresponding to this datatype.
 boolean isBounded()
          Return the value of the "bounded" fundamental facet.
 boolean isEqual(java.lang.Object value1, java.lang.Object value2)
          Check whether two actual values are equal.
 boolean isIDType()
          Check whether this type is or is derived from ID.
 boolean isNumeric()
          Return the value of the "numeric" fundamental facet.
 java.lang.Object validate(java.lang.String content, ValidationContext context, ValidatedInfo validatedInfo)
          validate a given string against this simple type.
 void validate(ValidationContext context, ValidatedInfo validatedInfo)
          validate an actual value against this simple type.
 
Methods inherited from interface org.apache.xerces.impl.xs.XSTypeDecl
getBaseType, getFinalSet, getTargetNamespace, getTypeName, getXSType, isAnonymous
 

Field Detail

FACET_LENGTH

public static final short FACET_LENGTH
the length facet

FACET_MINLENGTH

public static final short FACET_MINLENGTH
the minLength facet

FACET_MAXLENGTH

public static final short FACET_MAXLENGTH
the maxLength facet

FACET_PATTERN

public static final short FACET_PATTERN
the pattern facet

FACET_ENUMERATION

public static final short FACET_ENUMERATION
the enumeration facet

FACET_WHITESPACE

public static final short FACET_WHITESPACE
the whiteSpace facet

FACET_MAXINCLUSIVE

public static final short FACET_MAXINCLUSIVE
the maxInclusive facet

FACET_MAXEXCLUSIVE

public static final short FACET_MAXEXCLUSIVE
the maxExclusive facet

FACET_MINEXCLUSIVE

public static final short FACET_MINEXCLUSIVE
the minExclusive facet

FACET_MININCLUSIVE

public static final short FACET_MININCLUSIVE
the minInclusive facet

FACET_TOTALDIGITS

public static final short FACET_TOTALDIGITS
the totalDigits facet

FACET_FRACTIONDIGITS

public static final short FACET_FRACTIONDIGITS
the fractionDigits facet

VARIETY_ABSENT

public static final short VARIETY_ABSENT
the absent variety, for anySimpleType

VARIETY_ATOMIC

public static final short VARIETY_ATOMIC
the atomic variety

VARIETY_LIST

public static final short VARIETY_LIST
the list variety

VARIETY_UNION

public static final short VARIETY_UNION
the union variety

WS_PRESERVE

public static final short WS_PRESERVE
preserve the white spaces

WS_REPLACE

public static final short WS_REPLACE
replace the white spaces

WS_COLLAPSE

public static final short WS_COLLAPSE
collapse the white spaces

ORDERED_FALSE

public static final short ORDERED_FALSE
not ordered

ORDERED_PARTIAL

public static final short ORDERED_PARTIAL
partically ordered

ORDERED_TOTAL

public static final short ORDERED_TOTAL
totally ordered

CARDINALITY_FINITE

public static final short CARDINALITY_FINITE
finite cardinality

CARDINALITY_COUNTABLY_INFINITE

public static final short CARDINALITY_COUNTABLY_INFINITE
countably infinite cardinality
Method Detail

validate

public java.lang.Object validate(java.lang.String content,
                                 ValidationContext context,
                                 ValidatedInfo validatedInfo)
                          throws InvalidDatatypeValueException
validate a given string against this simple type.
Parameters:
content - the string value that needs to be validated
context - the validation context
validatedInfo - used to store validation result
Returns:
the actual value (QName, Boolean) of the string value

validate

public void validate(ValidationContext context,
                     ValidatedInfo validatedInfo)
              throws InvalidDatatypeValueException
validate an actual value against this simple type.
Parameters:
value - the actual value that needs to be validated
context - the validation context
validatedInfo - used to provide the actual value and member types
Throws:
InvalidDatatypeValueException - exception for invalid values.

applyFacets

public void applyFacets(XSFacets facets,
                        short presentFacet,
                        short fixedFacet,
                        ValidationContext context)
                 throws InvalidDatatypeFacetException
If this type is created from restriction, then some facets can be applied to the simple type. XSFacets is used to pass the value of different facets.
Parameters:
facets - the value of all the facets
presentFacets - bit combination value of the costraining facet constants which are present.
fixedFacets - bit combination value of the costraining facet constants which are fixed.
ValidationContext - the validation context
Throws:
InvalidDatatypeFacetException - exception for invalid facet values.

getVariety

public short getVariety()
Get the variety of the simple type: atomic, list or union.
Returns:
a constant corresponding to the variety, as defined above.

isEqual

public boolean isEqual(java.lang.Object value1,
                       java.lang.Object value2)
Check whether two actual values are equal.
Parameters:
value1 - the first value
Returns:
true if the two value are equal

getDefinedFacets

public short getDefinedFacets()
bit combination of the constants defined in this simple type.
Returns:
the bit combination of the constants corresponding to the constraining facets, as defined above.

isIDType

public boolean isIDType()
Check whether this type is or is derived from ID. REVISIT: this method makes ID special, which is not a good design. but since ID is not a primitive, there doesn't seem to be a clean way of doing it except to define special method like this.
Returns:
whether this simple type is or is derived from ID.

getOrderedFacet

public short getOrderedFacet()
Return the value of the "ordered" fundamental facet.
Returns:
a constant corresponding to the "ordered" facet.

isBounded

public boolean isBounded()
Return the value of the "bounded" fundamental facet.
Returns:
whether the this type is bounded.

isNumeric

public boolean isNumeric()
Return the value of the "numeric" fundamental facet.
Returns:
whether the this type is numeric.

getCardinalityFacet

public short getCardinalityFacet()
Return the value of the "cardinality" fundamental facet.
Returns:
a constant corresponding to the "cardinality" facet.

getWhitespace

public short getWhitespace()
                    throws DatatypeException
Return the whitespace corresponding to this datatype.
Returns:
valid values are WS_PRESERVE, WS_REPLACE, WS_COLLAPSE.
Throws:
DatatypeException - union datatypes don't have whitespace facet associated with them


Copyright © 1999-2002 Apache XML Project. All Rights Reserved.