Interface XSSimpleType

    • Method Detail

      • 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​(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
      • 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