Interface FunctionItemType

All Superinterfaces:
ItemType
All Known Subinterfaces:
RecordType
All Known Implementing Classes:
AnyFunctionType, AnyFunctionTypeWithAssertions, ArrayItemType, MapType, RecordTest, SelfReferenceRecordTest, SpecificFunctionType

public interface FunctionItemType extends ItemType
An ItemType representing the type of a function item (subclasses are used for maps and arrays)
  • Method Details

    • getGenre

      default Genre getGenre()
      Determine the Genre (top-level classification) of this type
      Specified by:
      getGenre in interface ItemType
      Returns:
      the Genre to which this type belongs, specifically Genre.FUNCTION
    • getArgumentTypes

      SequenceType[] getArgumentTypes()
      Get the argument types of the function
      Returns:
      the argument types, as an array of SequenceTypes; or null if this is the generic function type function(*)
    • getResultType

      SequenceType getResultType()
      Get the result type of the function
      Returns:
      the result type, as a SequenceType
    • relationship

      Affinity relationship(FunctionItemType other, TypeHierarchy th)
      Determine the relationship of one function item type to another. This method is only concerned with the type signatures of the two function item types, and not with their annotation assertions.
      Parameters:
      other - the other function item type
      th - the type hierarchy cache
      Returns:
      for example Affinity.SUBSUMES, Affinity.SAME_TYPE
    • getAnnotationAssertions

      AnnotationList getAnnotationAssertions()
      Get the list of Annotation Assertions associated with this function item type
      Returns:
      the list of annotation assertions
    • makeFunctionSequenceCoercer

      Expression makeFunctionSequenceCoercer(Expression exp, Supplier<RoleDiagnostic> role, boolean allow40) throws XPathException
      Create an expression whose effect is to apply function coercion to coerce a function to this function type
      Parameters:
      exp - the expression that delivers the supplied sequence of function items (the ones in need of coercion)
      role - information for use in diagnostics
      allow40 - true if 4.0 coercions are allowed, such as reducing the arity of the function
      Returns:
      the coerced function, a function that calls the original function after checking the parameters
      Throws:
      XPathException - if an error is detected
    • isMapType

      boolean isMapType()
      Ask whether this function item type is a map type. In this case function coercion (to the map type) will never succeed.
      Returns:
      true if this FunctionItemType is a map type
    • isArrayType

      boolean isArrayType()
      Ask whether this function item type is an array type. In this case function coercion (to the array type) will never succeed.
      Returns:
      true if this FunctionItemType is an array type