Class Component

All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, InstructionInfo, Locator

public class Component extends SystemFunction
This class supports the get_X_from_Y functions defined in XPath 2.0
See Also:
  • Field Details

  • Constructor Details

    • Component

      public Component()
  • Method Details

    • simplify

      public Expression simplify(ExpressionVisitor visitor) throws XPathException
      Description copied from class: FunctionCall
      Simplify the function call. Default method is to simplify each of the supplied arguments and evaluate the function if all are now known.
      Overrides:
      simplify in class FunctionCall
      Parameters:
      visitor - an expression visitor
      Returns:
      the simplified expression
      Throws:
      XPathException - if an error is discovered during expression rewriting
    • setDetails

      public void setDetails(StandardFunction.Entry entry)
      Set the details of this type of function
      Overrides:
      setDetails in class SystemFunction
      Parameters:
      entry - information giving details of the function signature
    • getIntegerBounds

      public IntegerValue[] getIntegerBounds()
      For an expression that returns an integer or a sequence of integers, get a lower and upper bound on the values of the integers that may be returned, from static analysis. The default implementation returns null, meaning "unknown" or "not applicable". Other implementations return an array of two IntegerValue objects, representing the lower and upper bounds respectively. The values UNBOUNDED_LOWER and UNBOUNDED_UPPER are used by convention to indicate that the value may be arbitrarily large. The values MAX_STRING_LENGTH and MAX_SEQUENCE_LENGTH are used to indicate values limited by the size of a string or the size of a sequence.
      Overrides:
      getIntegerBounds in class Expression
      Returns:
      the lower and upper bounds of integer values in the result, or null to indicate unknown or not applicable.
    • getRequiredComponent

      public int getRequiredComponent()
      Get the required component
    • getRequiredComponentAsString

      public String getRequiredComponentAsString()
      Get the required component name as a string
    • evaluateItem

      public Item evaluateItem(XPathContext context) throws XPathException
      Evaluate the expression
      Overrides:
      evaluateItem in class Expression
      Parameters:
      context - The context in which the expression is to be evaluated
      Returns:
      the node or atomic value that results from evaluating the expression; or null to indicate that the result is an empty sequence
      Throws:
      XPathException - if any dynamic error occurs evaluating the expression
    • copy

      public Expression copy()
      Copy an expression. This makes a deep copy.
      Overrides:
      copy in class SystemFunction
      Returns:
      the copy of the original expression