net.sf.saxon.instruct
Class Procedure

java.lang.Object
  extended by net.sf.saxon.instruct.Procedure
All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, Container
Direct Known Subclasses:
AttributeSet, KeyDefinition, Template, UserFunction

public abstract class Procedure
extends 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.

See Also:
Serialized Form

Constructor Summary
Procedure()
           
 
Method Summary
 Expression getBody()
           
 int getColumnNumber()
           
 Executable getExecutable()
          Get the Executable (representing a complete stylesheet or query) of which this Container forms part
 int getHostLanguage()
          Get the host language (XSLT, XQuery, XPath) used to implement the code in this container
 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)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Procedure

public Procedure()
Method Detail

setBody

public void setBody(Expression body)

setHostLanguage

public void setHostLanguage(int language)

getHostLanguage

public int getHostLanguage()
Description copied from interface: Container
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container

Specified by:
getHostLanguage in interface Container
Returns:
typically Configuration.XSLT or Configuration.XQUERY

getBody

public final Expression getBody()

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

setStackFrameMap

public void setStackFrameMap(SlotManager map)

getStackFrameMap

public SlotManager getStackFrameMap()

getExecutable

public final Executable getExecutable()
Description copied from interface: Container
Get the Executable (representing a complete stylesheet or query) of which this Container forms part

Specified by:
getExecutable in interface Container
Returns:
the executable

setExecutable

public void setExecutable(Executable executable)

getLocationProvider

public LocationProvider getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved.

Specified by:
getLocationProvider in interface Container
Returns:
the location provider

setLineNumber

public void setLineNumber(int lineNumber)

setSystemId

public void setSystemId(String systemId)

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface SourceLocator

getSystemId

public String getSystemId()
Specified by:
getSystemId in interface SourceLocator

getColumnNumber

public int getColumnNumber()
Specified by:
getColumnNumber in interface SourceLocator

getPublicId

public String getPublicId()
Specified by:
getPublicId in interface SourceLocator

getSystemId

public String getSystemId(long locationId)
Description copied from interface: LocationProvider
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.

getLineNumber

public int getLineNumber(long locationId)
Description copied from interface: LocationProvider
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.


Copyright (C) Michael H. Kay. All rights reserved.