Class PlaceHolder

All Implemented Interfaces:
ExportAgent, Locatable, IdentityComparable, Traceable

public class PlaceHolder extends PseudoExpression
A PlaceHolder corresponds to the symbol "?" in a partial function application; it is a PseudoExpression because it can appear in the expression tree in the place of an expression, but is never actually evaluated.

In 4.0, placeholders can be associated with keywords, and the mapping from arguments of the partially-applied function to arguments of the base function is therefore more complex. The PlaceHolder holds an integer indicating a 0-based offset of the placeholder in the argument list of the partially-applied function.

  • Constructor Details

    • PlaceHolder

      public PlaceHolder(int placeHolderSequence)
      Create a placeholder, representing a "?" in a partial function application
      Parameters:
      placeHolderSequence - the 0-based position of this placeholder among all the placeholders in the partial function call
  • Method Details

    • getPlaceHolderSequence

      public int getPlaceHolderSequence()
    • export

      public void export(ExpressionPresenter out) throws XPathException
      Diagnostic print of expression structure. The abstract expression tree is written to the supplied output destination.
      Specified by:
      export in interface ExportAgent
      Specified by:
      export in class Expression
      Parameters:
      out - the expression presenter used to display the structure
      Throws:
      XPathException - if the export fails, for example if an expression is found that won't work in the target environment.
    • copy

      public Expression copy(RebindingMap rebindings)
      Copy an expression. This makes a deep copy.
      Specified by:
      copy in class Expression
      Parameters:
      rebindings - a mutable list of (old binding, new binding) pairs that is used to update the bindings held in any local variable references that are copied.
      Returns:
      the copy of the original expression