Class Procedure
java.lang.Object
net.sf.saxon.expr.instruct.Procedure
- All Implemented Interfaces:
Serializable, SourceLocator, LocationProvider, SaxonLocator, Container, InstructionInfo, Locator
- Direct Known Subclasses:
AttributeSet, KeyDefinition, Template, UserFunction
public abstract class Procedure
extends Object
implements Serializable, Container, InstructionInfo, 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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal ExpressiongetBody()intintgetColumnNumber(long locationId) Get the column number within the document, entity, or module containing a particular locationintGet the granularity of the container.final ExecutableGet the Executable (representing a complete stylesheet or query) of which this Container forms partintGet the host language (XSLT, XQuery, XPath) used to implement the code in this containerintGet the line number of the instruction in the source stylesheet module.intgetLineNumber(long locationId) Get the line number within the document, entity or module containing a particular locationGet the LocationProvider allowing location identifiers to be resolved.Get an iterator over all the properties available.getProperty(String name) Get the value of a particular property of the instruction.Get the system identifier (URI) of the source stylesheet or query module containing the instruction.getSystemId(long locationId) Get the URI of the document, entity, or module containing a particular locationvoidsetBody(Expression body) voidsetExecutable(Executable executable) voidsetHostLanguage(int language) voidsetLineNumber(int lineNumber) voidvoidsetSystemId(String systemId) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface InstructionInfo
getConstructType, getObjectName
-
Field Details
-
body
-
-
Constructor Details
-
Procedure
public Procedure()
-
-
Method Details
-
getContainerGranularity
public int getContainerGranularity()Get the granularity of the container.- Specified by:
getContainerGranularityin interfaceContainer- Returns:
- 0 for a temporary container created during parsing; 1 for a container that operates at the level of an XPath expression; 2 for a container at the level of a global function or template
-
setBody
-
setHostLanguage
public void setHostLanguage(int language) -
getHostLanguage
public int getHostLanguage()Description copied from interface:ContainerGet the host language (XSLT, XQuery, XPath) used to implement the code in this container- Specified by:
getHostLanguagein interfaceContainer- Returns:
- typically
Configuration.XSLTorConfiguration.XQUERY
-
getBody
-
setStackFrameMap
-
getStackFrameMap
-
getExecutable
Description copied from interface:ContainerGet the Executable (representing a complete stylesheet or query) of which this Container forms part- Specified by:
getExecutablein interfaceContainer- Returns:
- the executable
-
setExecutable
-
getLocationProvider
Get the LocationProvider allowing location identifiers to be resolved.- Specified by:
getLocationProviderin interfaceContainer- Returns:
- the location provider
-
setLineNumber
public void setLineNumber(int lineNumber) -
setSystemId
-
getLineNumber
public int getLineNumber()Description copied from interface:InstructionInfoGet the line number of the instruction in the source stylesheet module. If this is not known, or if the instruction is an artificial one that does not relate to anything in the source code, the value returned may be -1.- Specified by:
getLineNumberin interfaceInstructionInfo- Specified by:
getLineNumberin interfaceLocator- Specified by:
getLineNumberin interfaceSourceLocator- Returns:
- the line number of the expression within the containing module
-
getSystemId
Description copied from interface:InstructionInfoGet the system identifier (URI) of the source stylesheet or query module containing the instruction. This will generally be an absolute URI. If the system identifier is not known, the method may return null. In some cases, for example where XML external entities are used, the correct system identifier is not always retained.- Specified by:
getSystemIdin interfaceInstructionInfo- Specified by:
getSystemIdin interfaceLocator- Specified by:
getSystemIdin interfaceSourceLocator- Returns:
- the URI of the containing module
-
getColumnNumber
public int getColumnNumber()- Specified by:
getColumnNumberin interfaceLocator- Specified by:
getColumnNumberin interfaceSourceLocator
-
getPublicId
- Specified by:
getPublicIdin interfaceLocator- Specified by:
getPublicIdin interfaceSourceLocator
-
getSystemId
Description copied from interface:LocationProviderGet the URI of the document, entity, or module containing a particular location- Specified by:
getSystemIdin interfaceLocationProvider- Parameters:
locationId- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the URI of the document, XML entity or module. For a SourceLocationProvider this will be the URI of the document or entity (the URI that would be the base URI if there were no xml:base attributes). In other cases it may identify the query or stylesheet module currently being executed.
-
getLineNumber
public int getLineNumber(long locationId) Description copied from interface:LocationProviderGet the line number within the document, entity or module containing a particular location- Specified by:
getLineNumberin interfaceLocationProvider- Parameters:
locationId- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the line number within the document, entity or module, or -1 if no information is available.
-
getColumnNumber
public int getColumnNumber(long locationId) Description copied from interface:LocationProviderGet the column number within the document, entity, or module containing a particular location- Specified by:
getColumnNumberin interfaceLocationProvider- Parameters:
locationId- identifier of the location in question (as passed down the Receiver pipeline)- Returns:
- the column number within the document, entity, or module, or -1 if this is not available
-
getProperty
Description copied from interface:InstructionInfoGet the value of a particular property of the instruction. Properties of XSLT instructions are generally known by the name of the stylesheet attribute that defines them.- Specified by:
getPropertyin interfaceInstructionInfo- Parameters:
name- The name of the required property- Returns:
- The value of the requested property, or null if the property is not available
-
getProperties
Get an iterator over all the properties available. The values returned by the iterator will be of type String, and each string can be supplied as input to the getProperty() method to retrieve the value of the property. The iterator may return properties whose value is null.- Specified by:
getPropertiesin interfaceInstructionInfo- Returns:
- an iterator over the properties.
-