Class GlobalVariableReference

All Implemented Interfaces:
BindingReference, ComponentInvocation, ExportAgent, Locatable, IdentityComparable, Traceable

public class GlobalVariableReference extends VariableReference implements ComponentInvocation
A reference to a global variable
  • Constructor Details Link icon

    • GlobalVariableReference Link icon

      public GlobalVariableReference(StructuredQName name)
    • GlobalVariableReference Link icon

      public GlobalVariableReference(GlobalVariable var)
  • Method Details Link icon

    • copy Link icon

      public Expression copy(RebindingMap rebindings)
      Description copied from class: VariableReference
      Create a clone copy of this VariableReference
      Specified by:
      copy in class VariableReference
      Parameters:
      rebindings - variables that need to switch to new bindings
      Returns:
      the cloned copy
    • setBindingSlot Link icon

      public void setBindingSlot(int slot)
      Set the binding slot to be used. This is the offset within the binding vector of the containing component where the actual target component is to be found. The target template is not held directly in the invocation instruction/expression itself because it can be overridden in a using package.
      Specified by:
      setBindingSlot in interface ComponentInvocation
      Parameters:
      slot - the offset in the binding vector of the containing package where the target component can be found.
    • getBindingSlot Link icon

      public int getBindingSlot()
      Get the binding slot to be used. This is the offset within the binding vector of the containing component where the actual target component is to be found.
      Specified by:
      getBindingSlot in interface ComponentInvocation
      Returns:
      the offset in the binding vector of the containing package where the target component can be found.
    • getSymbolicName Link icon

      public SymbolicName getSymbolicName()
      Get the symbolic name of the component that this invocation references
      Specified by:
      getSymbolicName in interface ComponentInvocation
      Returns:
      the symbolic name of the target component
    • setTarget Link icon

      public void setTarget(Component target)
    • getTarget Link icon

      public Component getTarget()
    • getFixedTarget Link icon

      public Component getFixedTarget()
      Description copied from interface: ComponentInvocation
      Get the target component if this is known in advance, that is, if the target component is private or final, or in some other cases such as xsl:original. Otherwise, return null.
      Specified by:
      getFixedTarget in interface ComponentInvocation
      Returns:
      the bound component if the binding has been fixed
    • evaluateVariable Link icon

      public GroundedValue evaluateVariable(XPathContext c) throws XPathException
      Evaluate this variable
      Overrides:
      evaluateVariable in class VariableReference
      Parameters:
      c - the XPath dynamic context
      Returns:
      the value of the variable
      Throws:
      XPathException - if any error occurs
    • export Link icon

      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
      Overrides:
      export in class VariableReference
      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.
    • getPreconditions Link icon

      public Set<Expression> getPreconditions()
    • getExpressionName Link icon

      public String getExpressionName()
      Get a name identifying the kind of expression, in terms meaningful to a user.
      Overrides:
      getExpressionName in class VariableReference
      Returns:
      a name identifying the kind of expression, in terms meaningful to a user. The name will always be in the form of a lexical XML QName, and should match the name used in export() output displaying the expression.
    • getElaborator Link icon

      public Elaborator getElaborator()
      Make an elaborator for this expression
      Overrides:
      getElaborator in class Expression
      Returns:
      a suitable elaborator