Interface SimpleType

    • Method Detail

      • isAtomicType

        boolean isAtomicType()
        Test whether this Simple Type is an atomic type
        Specified by:
        isAtomicType in interface SchemaType
        Returns:
        true if this is an atomic type
      • isListType

        boolean isListType()
        Test whether this Simple Type is a list type
        Returns:
        true if this is a list type
      • isUnionType

        boolean isUnionType()
        Test whether this Simple Type is a union type
        Returns:
        true if this is a union type
      • isExternalType

        boolean isExternalType()
        Return true if this is an external object type, that is, a Saxon-defined type for external Java or .NET objects
      • getCommonAtomicType

        AtomicType getCommonAtomicType()
        Get the most specific possible atomic type that all items in this SimpleType belong to
        Returns:
        the lowest common supertype of all member types
      • getBuiltInBaseType

        SchemaType getBuiltInBaseType()
        Get the built-in type from which this type is derived by restriction
        Returns:
        the built-in type from which this type is derived by restriction. This will not necessarily be a primitive type.
      • getTypedValue

        SequenceIterator getTypedValue​(java.lang.CharSequence value,
                                       NamespaceResolver resolver,
                                       NameChecker nameChecker)
                                throws ValidationException
        Get the typed value corresponding to a given string value, assuming it is valid against this type
        Parameters:
        value - the string value
        resolver - a namespace resolver used to resolve any namespace prefixes appearing in the content of values. Can supply null, in which case any namespace-sensitive content will be rejected.
        nameChecker - a NameChecker used in the case of types that are defined in terms of the XML NCName syntax: this is used to check conformance to XML 1.0 or XML 1.1 naming rules, as appropriate
        Returns:
        an iterator over the atomic sequence comprising the typed value. The objects returned by this SequenceIterator will all be of type AtomicValue
        Throws:
        ValidationException - if the supplied value is not in the lexical space of the data type
      • validateContent

        ValidationException validateContent​(java.lang.CharSequence value,
                                            NamespaceResolver nsResolver,
                                            NameChecker nameChecker)
        Check whether a given input string is valid according to this SimpleType
        Parameters:
        value - the input string to be checked
        nsResolver - a namespace resolver used to resolve namespace prefixes if the type is namespace sensitive. The value supplied may be null; in this case any namespace-sensitive content will throw an UnsupportedOperationException.
        nameChecker -
        Returns:
        null if validation succeeds; return a ValidationException describing the validation failure if validation fails. Note that the exception is returned rather than being thrown.
        Throws:
        java.lang.UnsupportedOperationException - if the type is namespace-sensitive and no namespace resolver is supplied
      • isNamespaceSensitive

        boolean isNamespaceSensitive()
        Test whether this type is namespace sensitive, that is, if a namespace context is needed to translate between the lexical space and the value space. This is true for types derived from, or containing, QNames and NOTATIONs
        Returns:
        true if the type is namespace-sensitive