Interface XSSimpleType

All Superinterfaces:
XSObject, XSSimpleTypeDefinition, XSTypeDefinition
All Known Implementing Classes:
XSSimpleTypeDecl, XSSimpleTypeDelegate

public interface XSSimpleType extends XSSimpleTypeDefinition
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. @xerces.internal
Version:
$Id: XSSimpleType.java 446751 2006-09-15 21:54:06Z mrglavas $
Author:
Sandy Gao, IBM
  • Field Details

  • Method Details

    • getPrimitiveKind

      short getPrimitiveKind()
      return an ID representing the built-in primitive base type. REVISIT: This method is (currently) for internal use only. the constants returned from this method are not finalized yet. the names and values might change in the further.
      Returns:
      an ID representing the built-in primitive base type
    • validate

      Object validate(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
      Throws:
      InvalidDatatypeValueException
    • validate

      Object validate(Object content, ValidationContext context, ValidatedInfo validatedInfo) throws InvalidDatatypeValueException
      validate a given string value, represented by content.toString(). note that if content is a StringBuffer, for performance reasons, it's possible that the content of the string buffer is modified.
      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
      Throws:
      InvalidDatatypeValueException
    • validate

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

      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
      presentFacet - bit combination value of the costraining facet constants which are present.
      fixedFacet - bit combination value of the costraining facet constants which are fixed.
      context - the validation context
      Throws:
      InvalidDatatypeFacetException - exception for invalid facet values.
    • isEqual

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

      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.
    • getWhitespace

      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