Class StringJoin

All Implemented Interfaces:
Callable, PushableFunction, FunctionItem, GroundedValue, Item, Sequence

public class StringJoin extends FoldingFunction implements PushableFunction
fn:string-join(string* $sequence, string $separator)
  • Constructor Details

    • StringJoin

      public StringJoin()
  • Method Details

    • setReturnEmptyIfEmpty

      public void setReturnEmptyIfEmpty(boolean option)
      Indicate that when the input sequence (first argument) is empty, the function should return an empty sequence rather than an empty string
      Parameters:
      option - true if an empty sequence should be returned when the input is an empty sequence.
    • isReturnEmptyIfEmpty

      public boolean isReturnEmptyIfEmpty()
    • getCardinality

      public int getCardinality(Expression[] arguments)
      Determine the cardinality of the function.
      Overrides:
      getCardinality in class SystemFunction
      Parameters:
      arguments - the actual arguments supplied
      Returns:
      the most precise available cardinality that the function will return
    • equals

      public boolean equals(Object o)
      Determine whether two expressions are equivalent
      Overrides:
      equals in class SystemFunction
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class SystemFunction
    • makeOptimizedFunctionCall

      public Expression makeOptimizedFunctionCall(ExpressionVisitor visitor, ContextItemStaticInfo contextInfo, Expression... arguments) throws XPathException
      Allow the function to create an optimized call based on the values of the actual arguments
      Overrides:
      makeOptimizedFunctionCall in class SystemFunction
      Parameters:
      visitor - the expression visitor
      contextInfo - information about the context item
      arguments - the supplied arguments to the function call
      Returns:
      either a function call on this function, or an expression that delivers the same result, or null indicating that no optimization has taken place
      Throws:
      XPathException - if an error is detected
    • getFold

      public Fold getFold(XPathContext context, Sequence... additionalArguments) throws XPathException
      Description copied from class: FoldingFunction
      Create the Fold object which actually performs the evaluation. Must be implemented in every subclass.
      Specified by:
      getFold in class FoldingFunction
      Parameters:
      context - the dynamic evaluation context
      additionalArguments - the values of all arguments other than the first.
      Returns:
      the Fold object used to compute the function
      Throws:
      XPathException - if a dynamic error occurs
    • process

      public void process(Outputter destination, XPathContext context, Sequence[] arguments) throws XPathException
      Description copied from interface: PushableFunction
      Evaluate the function in "push" mode
      Specified by:
      process in interface PushableFunction
      Parameters:
      destination - the destination for the function result
      context - the dynamic evaluation context
      arguments - the supplied arguments to the function
      Throws:
      XPathException - if a dynamic error occurs during the evaluation