Class CollatingFunction

All Implemented Interfaces:
Serializable, SourceLocator, Container, Expression, InstructionInfoProvider
Direct Known Subclasses:
Compare, Contains, DeepEqual, DistinctValues, IndexOf, Minimax

public abstract class CollatingFunction extends SystemFunction
Abstract superclass for all functions that take an optional collation argument
See Also:
  • Field Details

    • collation

      protected transient Comparator collation
  • Constructor Details

    • CollatingFunction

      public CollatingFunction()
  • Method Details

    • checkArguments

      public void checkArguments(StaticContext env) throws XPathException
      Description copied from class: SystemFunction
      Method called during static type checking
      Overrides:
      checkArguments in class SystemFunction
      Throws:
      XPathException
    • getAtomicComparer

      protected GenericAtomicComparer getAtomicComparer(int arg, XPathContext context) throws XPathException
      Get a GenericAtomicComparer that can be used to compare values
      Parameters:
      arg - the position of the argument (starting at 0) containing the collation name. If this argument was not supplied, the default collation is used
      context - The dynamic evaluation context.
      Throws:
      XPathException
    • getCollator

      protected Comparator getCollator(int arg, XPathContext context) throws XPathException
      Get a collator suitable for comparing strings. Returns the collator specified in the given function argument if present, otherwise returns the default collator.
      Parameters:
      arg - The argument position (counting from zero) that holds the collation URI if present
      context - The dynamic context
      Returns:
      a Comparator, which will either be a java.text.Collator, or a CodepointCollator
      Throws:
      XPathException