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 TypeMethodDescriptionvoidAllocate slot numbers to all the external component references in this componentstatic voidallocateBindingSlotsRecursive(StylesheetPackage pack, Actor p, Expression exp, List<ComponentBinding> bindings) abstract voidexport(ExpressionPresenter presenter) Export expression structure.final ExpressiongetBody()final ExpressionintGet the column number.Get the name of the component as a QNameGet the visibility of the component as defined using its actual @visibility attributeintGet 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 SymbolicNameGet the symbolic name of the componentGet the system ID.Get a string used to identify this kind of component when used in tracing outputbooleanmakeDeclaringComponent(Visibility visibility, StylesheetPackage declaringPackage) obtainDeclaringComponent(StyleElement declaration) Return the declaring component, creating it if it does not already exist.protected TailCallprocess(Outputter out, XPathContext context) Get an immutable copy of this Location object.voidsetBody(Expression body) voidsetChildExpression(Expression expr) voidsetColumnNumber(int col) voidsetDeclaredVisibility(Visibility visibility) Set the visibility of the component as defined using its actual @visibility attributevoidvoidsetLineNumber(int lineNumber) voidsetPackageData(PackageData packageData) Set basic data about the unit of compilation (XQuery module, XSLT package) to which this procedure belongsvoidvoidvoidsetSystemId(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:
getChildExpressionin 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:LocationGet 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:
getLineNumberin interfaceLocation- Specified by:
getLineNumberin interfaceLocator- Specified by:
getLineNumberin interfaceSourceLocator- Returns:
- the line number, or -1 if the information is not available.
-
getSystemId
Description copied from interface:LocationGet 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:
getSystemIdin interfaceLocation- Specified by:
getSystemIdin interfaceLocator- Specified by:
getSystemIdin interfaceSourceLocator- Returns:
- the system ID, or null if the information is not available.
-
getColumnNumber
public int getColumnNumber()Description copied from interface:LocationGet the column number. This column number is relative to the line identified by the line number. Column numbers start at 1.- Specified by:
getColumnNumberin interfaceLocation- Specified by:
getColumnNumberin interfaceLocator- Specified by:
getColumnNumberin interfaceSourceLocator- Returns:
- the column number, or -1 if the information is not available.
-
getPublicId
Description copied from interface:LocationGet the Public ID- Specified by:
getPublicIdin interfaceLocation- Specified by:
getPublicIdin interfaceLocator- Specified by:
getPublicIdin interfaceSourceLocator- Returns:
- usually null
-
saveLocation
Description copied from interface:LocationGet 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:
saveLocationin 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:
setChildExpressionin interfaceExpressionOwner
-
process
- Throws:
XPathException
-