net.sf.saxon.instruct

Class Procedure

Implemented Interfaces:
Serializable, Container, SourceLocator, LocationProvider
Known Direct Subclasses:
AttributeSet, KeyDefinition, Template, UserFunction

public abstract class Procedure
extends java.lang.Object
implements Serializable, Container, LocationProvider

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

protected Expression
body

Constructor Summary

Procedure()

Method Summary

Expression
getBody()
int
getColumnNumber()
Executable
getExecutable()
int
getHostLanguage()
int
getLineNumber()
int
getLineNumber(long locationId)
Get the line number within the document or module containing a particular location
LocationProvider
getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved.
String
getPublicId()
SlotManager
getStackFrameMap()
String
getSystemId()
String
getSystemId(long locationId)
Get the URI of the document or module containing a particular location
boolean
replaceSubExpression(Expression original, Expression replacement)
Replace one subexpression by a replacement subexpression
void
setBody(Expression body)
void
setExecutable(Executable executable)
void
setHostLanguage(int language)
void
setLineNumber(int lineNumber)
void
setStackFrameMap(SlotManager map)
void
setSystemId(String systemId)

Field Details

body

protected Expression body

Constructor Details

Procedure

public Procedure()

Method Details

getBody

public final Expression getBody()

getColumnNumber

public int getColumnNumber()

getExecutable

public final Executable getExecutable()
Specified by:
getExecutable in interface Container

getHostLanguage

public int getHostLanguage()
Specified by:
getHostLanguage in interface Container

getLineNumber

public int getLineNumber()

getLineNumber

public int getLineNumber(long locationId)
Get the line number within the document or module containing a particular location
Specified by:
getLineNumber in interface LocationProvider
Parameters:
locationId - identifier of the location in question (as passed down the Receiver pipeline)
Returns:
the line number within the document or module.

getLocationProvider

public LocationProvider getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved.
Specified by:
getLocationProvider in interface Container

getPublicId

public String getPublicId()

getStackFrameMap

public SlotManager getStackFrameMap()

getSystemId

public String getSystemId()

getSystemId

public String getSystemId(long locationId)
Get the URI of the document or module containing a particular location
Specified by:
getSystemId in interface LocationProvider
Parameters:
locationId - identifier of the location in question (as passed down the Receiver pipeline)
Returns:
the URI of the document or module.

replaceSubExpression

public boolean replaceSubExpression(Expression original,
                                    Expression replacement)
Replace one subexpression by a replacement subexpression
Specified by:
replaceSubExpression in interface Container
Parameters:
original - the original subexpression
replacement - the replacement subexpression
Returns:
true if the original subexpression is found

setBody

public void setBody(Expression body)

setExecutable

public void setExecutable(Executable executable)

setHostLanguage

public void setHostLanguage(int language)

setLineNumber

public void setLineNumber(int lineNumber)

setStackFrameMap

public void setStackFrameMap(SlotManager map)

setSystemId

public void setSystemId(String systemId)