Class Actor

java.lang.Object
net.sf.saxon.expr.instruct.Actor
All Implemented Interfaces:
SourceLocator, ExpressionOwner, Location, Locator
Direct Known Subclasses:
Accumulator, AttributeSet, GlobalVariable, KeyDefinition, Mode, NamedTemplate, UserFunction

public abstract class Actor extends Object implements ExpressionOwner, Location
This object represents the compiled form of a user-written function, template, attribute-set, etc (the source can be either an XSLT stylesheet function or an XQuery function).

It is assumed that type-checking, of both the arguments and the results, has been handled at compile time. That is, the expression supplied as the body of the function must be wrapped in code to check or convert the result to the required type, and calls on the function must be wrapped at compile time to check or convert the supplied arguments.

  • Field Details

  • Constructor Details

    • Actor

      public Actor()
  • Method Details

    • getSymbolicName

      public abstract SymbolicName getSymbolicName()
      Get the symbolic name of the component
      Returns:
      the symbolic name
    • getComponentName

      public StructuredQName getComponentName()
      Get the name of the component as a QName
      Returns:
      the component's name
    • getTracingTag

      public String getTracingTag()
      Get a string used to identify this kind of component when used in tracing output
      Returns:
      a diagnostic string used to identify the component when tracing
    • setPackageData

      public void setPackageData(PackageData packageData)
      Set basic data about the unit of compilation (XQuery module, XSLT package) to which this procedure belongs
      Parameters:
      packageData - information about the containing package
    • getPackageData

      public PackageData getPackageData()
      Get basic data about the unit of compilation (XQuery module, XSLT package) to which this container belongs
      Returns:
      the package information
    • makeDeclaringComponent

      public Component makeDeclaringComponent(Visibility visibility, StylesheetPackage declaringPackage)
    • obtainDeclaringComponent

      public Component obtainDeclaringComponent(StyleElement declaration)
      Return the declaring component, creating it if it does not already exist.
      Parameters:
      declaration - The source element in the stylesheet corresponding to the component
      Returns:
      the component corresponding to this declaration.
    • getDeclaringComponent

      public Component getDeclaringComponent()
    • setDeclaringComponent

      public void setDeclaringComponent(Component comp)
    • allocateAllBindingSlots

      public void allocateAllBindingSlots(StylesheetPackage pack)
      Allocate slot numbers to all the external component references in this component
      Parameters:
      pack - the containing package
    • allocateBindingSlotsRecursive

      public static void allocateBindingSlotsRecursive(StylesheetPackage pack, Actor p, Expression exp, List<ComponentBinding> bindings)
    • setBody

      public void setBody(Expression body)
    • getBody

      public final Expression getBody()
    • getChildExpression

      public final Expression getChildExpression()
      Specified by:
      getChildExpression in interface ExpressionOwner
    • setStackFrameMap

      public void setStackFrameMap(SlotManager map)
    • getStackFrameMap

      public SlotManager getStackFrameMap()
    • setLineNumber

      public void setLineNumber(int lineNumber)
    • setColumnNumber

      public void setColumnNumber(int col)
    • setSystemId

      public void setSystemId(String systemId)
    • getLocation

      public Location getLocation()
    • getLineNumber

      public int getLineNumber()
      Description copied from interface: Location
      Get the line number. This line number is relative to the external entity identified by the system identifier. Line numbers start at 1. The value may be an approximation; SAX parsers only provide line number information at the level of element nodes.
      Specified by:
      getLineNumber in interface Location
      Specified by:
      getLineNumber in interface Locator
      Specified by:
      getLineNumber in interface SourceLocator
      Returns:
      the line number, or -1 if the information is not available.
    • getSystemId

      public String getSystemId()
      Description copied from interface: Location
      Get the system ID. This should be the system identifier of an XML external entity; if a stylesheet module comprises multiple external entities, the distinction should be retained. This means, for example, that an instruction in a stylesheet can have a different system identifier from its parent instruction. However, SAX parsers only provide location information at the element level, so when part of an XPath expression is in a different external entity from other parts of the same expression, this distinction is lost.

      The system identifier of a node is in general not the same as its base URI. The base URI is affected by xml:base attributes; the system identifier is not.

      Specified by:
      getSystemId in interface Location
      Specified by:
      getSystemId in interface Locator
      Specified by:
      getSystemId in interface SourceLocator
      Returns:
      the system ID, or null if the information is not available.
    • getColumnNumber

      public int getColumnNumber()
      Description copied from interface: Location
      Get the column number. This column number is relative to the line identified by the line number. Column numbers start at 1.
      Specified by:
      getColumnNumber in interface Location
      Specified by:
      getColumnNumber in interface Locator
      Specified by:
      getColumnNumber in interface SourceLocator
      Returns:
      the column number, or -1 if the information is not available.
    • getPublicId

      public String getPublicId()
      Description copied from interface: Location
      Get the Public ID
      Specified by:
      getPublicId in interface Location
      Specified by:
      getPublicId in interface Locator
      Specified by:
      getPublicId in interface SourceLocator
      Returns:
      usually null
    • saveLocation

      public Location saveLocation()
      Description copied from interface: Location
      Get an immutable copy of this Location object. By default Location objects may be mutable, so they should not be saved for later use. The result of this operation holds the same location information, but in an immutable form.
      Specified by:
      saveLocation in interface Location
      Returns:
      an immutable copy (which may be the original object, if it is already immutable)
    • setRetainedStaticContext

      public void setRetainedStaticContext(RetainedStaticContext rsc)
    • getRetainedStaticContext

      public RetainedStaticContext getRetainedStaticContext()
    • getProperty

      public Object getProperty(String name)
    • setDeclaredVisibility

      public void setDeclaredVisibility(Visibility visibility)
      Set the visibility of the component as defined using its actual @visibility attribute
      Parameters:
      visibility - the actual declared visibility; null if the visibility attribute is absent
    • getDeclaredVisibility

      public Visibility getDeclaredVisibility()
      Get the visibility of the component as defined using its actual @visibility attribute
      Returns:
      the actual declared visibility; null if the visibility attribute is absent
    • export

      public abstract void export(ExpressionPresenter presenter) throws XPathException
      Export expression structure. The abstract expression tree is written to the supplied outputstream.
      Parameters:
      presenter - the expression presenter used to generate the XML representation of the structure
      Throws:
      XPathException - if things go wrong, for example an I/O failure
    • isExportable

      public boolean isExportable()
    • setChildExpression

      public void setChildExpression(Expression expr)
      Specified by:
      setChildExpression in interface ExpressionOwner
    • process

      protected TailCall process(Outputter out, XPathContext context) throws XPathException
      Throws:
      XPathException