net.sf.saxon.type

## Interface AtomicType

- All Superinterfaces:
    ItemType, PlainType, SchemaComponent, SchemaType, Serializable, SimpleType
  All Known Implementing Classes:
    BuiltInAtomicType, UserAtomicType

      public interface AtomicType
      extends SimpleType, PlainType

  Interface for atomic types (these are either built-in atomic types or user-defined atomic types). An AtomicType is both an ItemType (a possible type for items in a sequence) and a SchemaType (a possible type for validating and annotating nodes).

- - ### Field Summary

    - ### Fields inherited from interface net.sf.saxon.type.SchemaType

      `DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION, DERIVE_BY_SUBSTITUTION`

    - ### Fields inherited from interface net.sf.saxon.type.SchemaComponent

      `COMPONENT_FUNCTION_TYPE, FIXED_UP, INCOMPLETE, INVALID, UNVALIDATED, VALIDATED, VALIDATING`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `StructuredQName` | `getTypeName()` Get the name of this type as a StructuredQName, unless the type is anonymous, in which case return null
    `boolean` | `isAbstract()` Determine whether the type is abstract, that is, whether it cannot have instances that are not also instances of some concrete subtype
    `boolean` | `isBuiltInType()` Determine whether the atomic type is a built-in type.
    `boolean` | `isOrdered(boolean optimistic)` Determine whether the atomic type is ordered, that is, whether less-than and greater-than comparisons are permitted
    `boolean` | `isPrimitiveType()` Determine whether the atomic type is a primitive type.
    `ValidationFailure` | `validate(AtomicValue primValue, CharSequence lexicalValue, ConversionRules rules)` Validate that a primitive atomic value is a valid instance of a type derived from the same primitive type.

    - ### Methods inherited from interface net.sf.saxon.type.SimpleType

      `getBuiltInBaseType, getTypedValue, getWhitespaceAction, isAtomicType, isExternalType, isListType, isNamespaceSensitive, isUnionType, postprocess, preprocess, validateContent`

    - ### Methods inherited from interface net.sf.saxon.type.SchemaType

      `allowsDerivation, analyzeContentExpression, atomize, checkTypeDerivationIsOK, getBaseType, getBlock, getDerivationMethod, getDescription, getDisplayName, getEQName, getFinalProhibitions, getFingerprint, getName, getNameCode, getSystemId, getTargetNamespace, isAnonymousType, isComplexType, isIdRefType, isIdType, isSameType, isSimpleType`

    - ### Methods inherited from interface net.sf.saxon.type.SchemaComponent

      `getComponentAsFunction, getRedefinitionLevel, getValidationStatus`

    - ### Methods inherited from interface net.sf.saxon.type.PlainType

      `getPlainMemberTypes, isExternalType`

    - ### Methods inherited from interface net.sf.saxon.type.ItemType

      `getAtomizedItemType, getDefaultPriority, getPrimitiveItemType, getPrimitiveType, getSuperType, isAtomicType, isAtomizable, isPlainType, matches, matchesItem, visitNamedSchemaComponents`

- - ### Method Detail

    - #### validate

          ValidationFailure validate(AtomicValue primValue,
                                   CharSequence lexicalValue,
                                   ConversionRules rules)

      Validate that a primitive atomic value is a valid instance of a type derived from the same primitive type.
      Parameters:
        `primValue` - the value in the value space of the primitive type.
        `lexicalValue` - the value in the lexical space. If null, the string value of primValue is used. This value is checked against the pattern facet (if any)
        `rules` -
      Returns:
        null if the value is valid; otherwise, a ValidationFailure object indicating the nature of the error.
      Throws:
        `UnsupportedOperationException` - in the case of an external object type

    - #### isOrdered

          boolean isOrdered(boolean optimistic)

      Determine whether the atomic type is ordered, that is, whether less-than and greater-than comparisons are permitted
      Parameters:
        `optimistic` - if true, the function takes an optimistic view, returning true if ordering comparisons are available for some subtype. This mainly affects xs:duration, where the function returns true if optimistic is true, false if it is false.
      Returns:
        true if ordering operations are permitted

    - #### isAbstract

          boolean isAbstract()

      Determine whether the type is abstract, that is, whether it cannot have instances that are not also instances of some concrete subtype

    - #### isPrimitiveType

          boolean isPrimitiveType()

      Determine whether the atomic type is a primitive type. The primitive types are the 19 primitive types of XML Schema, plus xs:integer, xs:dayTimeDuration and xs:yearMonthDuration; xs:untypedAtomic; and all supertypes of these (xs:anyAtomicType, xs:numeric, ...)
      Returns:
        true if the type is considered primitive under the above rules

    - #### isBuiltInType

          boolean isBuiltInType()

      Determine whether the atomic type is a built-in type. The built-in atomic types are the 41 atomic types defined in XML Schema, plus xs:dayTimeDuration and xs:yearMonthDuration, xs:untypedAtomic, and all supertypes of these (xs:anyAtomicType, xs:numeric, ...)
      Specified by:
        `isBuiltInType` in interface `SimpleType`
      Returns:
        true if this is a built-in type

    - #### getTypeName

          StructuredQName getTypeName()

      Get the name of this type as a StructuredQName, unless the type is anonymous, in which case return null
      Returns:
        the name of the atomic type, or null if the type is anonymous.

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.