Package net.sf.saxon.expr.instruct
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
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Allocate slot numbers to all the external component references in this componentstatic void
allocateBindingSlotsRecursive
(StylesheetPackage pack, Actor p, Expression exp, List<ComponentBinding> bindings) abstract void
export
(ExpressionPresenter presenter) Export expression structure.final Expression
getBody()
final Expression
int
Get the column number.Get the name of the component as a QNameGet the visibility of the component as defined using its actual @visibility attributeint
Get the line number.Get basic data about the unit of compilation (XQuery module, XSLT package) to which this container belongsgetProperty
(String name) Get the Public IDabstract SymbolicName
Get the symbolic name of the componentGet the system ID.Get a string used to identify this kind of component when used in tracing outputboolean
makeDeclaringComponent
(Visibility visibility, StylesheetPackage declaringPackage) obtainDeclaringComponent
(StyleElement declaration) Return the declaring component, creating it if it does not already exist.protected TailCall
process
(Outputter out, XPathContext context) Get an immutable copy of this Location object.void
setBody
(Expression body) void
setChildExpression
(Expression expr) void
setColumnNumber
(int col) void
setDeclaredVisibility
(Visibility visibility) Set the visibility of the component as defined using its actual @visibility attributevoid
void
setLineNumber
(int lineNumber) void
setPackageData
(PackageData packageData) Set basic data about the unit of compilation (XQuery module, XSLT package) to which this procedure belongsvoid
void
void
setSystemId
(String systemId)
-
Field Details
-
body
-
-
Constructor Details
-
Actor
public Actor()
-
-
Method Details
-
getSymbolicName
Get the symbolic name of the component- Returns:
- the symbolic name
-
getComponentName
Get the name of the component as a QName- Returns:
- the component's name
-
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
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
Get basic data about the unit of compilation (XQuery module, XSLT package) to which this container belongs- Returns:
- the package information
-
makeDeclaringComponent
-
obtainDeclaringComponent
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
-
setDeclaringComponent
-
allocateAllBindingSlots
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
-
getBody
-
getChildExpression
- Specified by:
getChildExpression
in interfaceExpressionOwner
-
setStackFrameMap
-
getStackFrameMap
-
setLineNumber
public void setLineNumber(int lineNumber) -
setColumnNumber
public void setColumnNumber(int col) -
setSystemId
-
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 interfaceLocation
- Specified by:
getLineNumber
in interfaceLocator
- Specified by:
getLineNumber
in interfaceSourceLocator
- Returns:
- the line number, or -1 if the information is not available.
-
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 interfaceLocation
- Specified by:
getSystemId
in interfaceLocator
- Specified by:
getSystemId
in interfaceSourceLocator
- 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 interfaceLocation
- Specified by:
getColumnNumber
in interfaceLocator
- Specified by:
getColumnNumber
in interfaceSourceLocator
- Returns:
- the column number, or -1 if the information is not available.
-
getPublicId
Description copied from interface:Location
Get the Public ID- Specified by:
getPublicId
in interfaceLocation
- Specified by:
getPublicId
in interfaceLocator
- Specified by:
getPublicId
in interfaceSourceLocator
- Returns:
- usually null
-
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 interfaceLocation
- Returns:
- an immutable copy (which may be the original object, if it is already immutable)
-
setRetainedStaticContext
-
getRetainedStaticContext
-
getProperty
-
setDeclaredVisibility
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
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
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
- Specified by:
setChildExpression
in interfaceExpressionOwner
-
process
- Throws:
XPathException
-