Package net.sf.saxon.expr.instruct
Class Actor
- java.lang.Object
-
- net.sf.saxon.expr.instruct.Actor
-
- All Implemented Interfaces:
javax.xml.transform.SourceLocator
,ExpressionOwner
,Location
,org.xml.sax.Locator
- Direct Known Subclasses:
Accumulator
,AttributeSet
,GlobalVariable
,KeyDefinition
,Mode
,NamedTemplate
,UserFunction
public abstract class Actor extends java.lang.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 Summary
Fields Modifier and Type Field Description protected Expression
body
-
Constructor Summary
Constructors Constructor Description Actor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
allocateAllBindingSlots(StylesheetPackage pack)
Allocate slot numbers to all the external component references in this componentstatic void
allocateBindingSlotsRecursive(StylesheetPackage pack, Actor p, Expression exp, java.util.List<ComponentBinding> bindings)
abstract void
export(ExpressionPresenter presenter)
Export expression structure.Expression
getBody()
Expression
getChildExpression()
int
getColumnNumber()
Get the column number.StructuredQName
getComponentName()
Get the name of the component as a QNameVisibility
getDeclaredVisibility()
Get the visibility of the component as defined using its actual @visibility attributeComponent
getDeclaringComponent()
int
getLineNumber()
Get the line number.Location
getLocation()
PackageData
getPackageData()
Get basic data about the unit of compilation (XQuery module, XSLT package) to which this container belongsjava.lang.Object
getProperty(java.lang.String name)
java.lang.String
getPublicId()
Get the Public IDRetainedStaticContext
getRetainedStaticContext()
SlotManager
getStackFrameMap()
abstract SymbolicName
getSymbolicName()
Get the symbolic name of the componentjava.lang.String
getSystemId()
Get the system ID.java.lang.String
getTracingTag()
Get a string used to identify this kind of component when used in tracing outputboolean
isExportable()
Component
makeDeclaringComponent(Visibility visibility, StylesheetPackage declaringPackage)
Component
obtainDeclaringComponent(StyleElement declaration)
Return the declaring component, creating it if it does not already exist.protected TailCall
process(Outputter out, XPathContext context)
Location
saveLocation()
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
setDeclaringComponent(Component comp)
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
setRetainedStaticContext(RetainedStaticContext rsc)
void
setStackFrameMap(SlotManager map)
void
setSystemId(java.lang.String systemId)
-
-
-
Field Detail
-
body
protected Expression body
-
-
Method Detail
-
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 java.lang.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, java.util.List<ComponentBinding> bindings)
-
setBody
public void setBody(Expression body)
-
getBody
public final Expression getBody()
-
getChildExpression
public final Expression getChildExpression()
- Specified by:
getChildExpression
in interfaceExpressionOwner
-
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(java.lang.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 interfaceLocation
- Specified by:
getLineNumber
in interfaceorg.xml.sax.Locator
- Specified by:
getLineNumber
in interfacejavax.xml.transform.SourceLocator
- Returns:
- the line number, or -1 if the information is not available.
-
getSystemId
public java.lang.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 interfaceLocation
- Specified by:
getSystemId
in interfaceorg.xml.sax.Locator
- Specified by:
getSystemId
in interfacejavax.xml.transform.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 interfaceLocation
- Specified by:
getColumnNumber
in interfaceorg.xml.sax.Locator
- Specified by:
getColumnNumber
in interfacejavax.xml.transform.SourceLocator
- Returns:
- the column number, or -1 if the information is not available.
-
getPublicId
public java.lang.String getPublicId()
Description copied from interface:Location
Get the Public ID- Specified by:
getPublicId
in interfaceLocation
- Specified by:
getPublicId
in interfaceorg.xml.sax.Locator
- Specified by:
getPublicId
in interfacejavax.xml.transform.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 interfaceLocation
- 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 java.lang.Object getProperty(java.lang.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 interfaceExpressionOwner
-
process
protected TailCall process(Outputter out, XPathContext context) throws XPathException
- Throws:
XPathException
-
-