net.sf.saxon.query

Class XQueryFunction

public class XQueryFunction extends Object implements InstructionInfo, Container, Declaration

Field Summary
Listarguments
Expressionbody
intcolumnNumber
intlineNumber
NamespaceResolvernamespaceResolver
Listreferences
SequenceTyperesultType
StringsystemId
Constructor Summary
XQueryFunction()
Method Summary
voidcheckReferences(StaticContext env)
Type-check references to this function
UserFunctioncompile(StaticQueryContext env)
voidexplain(NamePool pool)
Produce diagnostic output showing the compiled and optimized expression tree for a function
voidfixupReferences(StaticContext env)
Fix up references to this function
SequenceType[]getArgumentTypes()
intgetColumnNumber()
Return the column number
intgetConstructType()
Get the type of construct.
ExecutablegetExecutable()
StringgetFunctionDisplayName(NamePool pool)
intgetFunctionFingerprint()
intgetHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container
intgetLineNumber()
Get the line number of the instruction in the source stylesheet module.
intgetLineNumber(int locationId)
LocationProvidergetLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved.
intgetNameCode()
NamespaceResolvergetNamespaceResolver()
Get the namespace context of the instruction.
intgetNumberOfArguments()
intgetObjectNameCode()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.
UserFunctionParameter[]getParameterDefinitions()
IteratorgetProperties()
Get an iterator over all the properties available.
ObjectgetProperty(String name)
Get the value of a particular property of the instruction.
StringgetPublicId()
Return the public identifier for the current document event.
SequenceTypegetResultType()
StaticContextgetStaticContext()
StringgetSystemId()
Get the system identifier (URI) of the source module containing the instruction.
StringgetSystemId(int locationId)
UserFunctiongetUserFunction()
Get the callable compiled function contained within this XQueryFunction definition.
voidregisterReference(UserFunctionCall ufc)
voidsetExecutable(Executable exec)
voidsetNameCode(int nameCode)

Field Detail

arguments

List arguments

body

Expression body

columnNumber

int columnNumber

lineNumber

int lineNumber

namespaceResolver

NamespaceResolver namespaceResolver

references

List references

resultType

SequenceType resultType

systemId

String systemId

Constructor Detail

XQueryFunction

public XQueryFunction()

Method Detail

checkReferences

public void checkReferences(StaticContext env)
Type-check references to this function

compile

public UserFunction compile(StaticQueryContext env)

explain

public void explain(NamePool pool)
Produce diagnostic output showing the compiled and optimized expression tree for a function

Parameters: pool the namepool to be used

fixupReferences

public void fixupReferences(StaticContext env)
Fix up references to this function

getArgumentTypes

public SequenceType[] getArgumentTypes()

getColumnNumber

public int getColumnNumber()
Return the column number

Returns: The column number, or -1 if none is available.

See Also: XQueryFunction

getConstructType

public int getConstructType()
Get the type of construct. This will be a constant in class Location.

getExecutable

public Executable getExecutable()

getFunctionDisplayName

public String getFunctionDisplayName(NamePool pool)

getFunctionFingerprint

public int getFunctionFingerprint()

getHostLanguage

public int getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container

Returns: typically XSLT or XQUERY

getLineNumber

public int getLineNumber()
Get 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.

getLineNumber

public int getLineNumber(int locationId)

getLocationProvider

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

getNameCode

public int getNameCode()

getNamespaceResolver

public NamespaceResolver getNamespaceResolver()
Get the namespace context of the instruction. This will not always be available, in which case the method returns null.

getNumberOfArguments

public int getNumberOfArguments()

getObjectNameCode

public int getObjectNameCode()
Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically.

getParameterDefinitions

public UserFunctionParameter[] getParameterDefinitions()

getProperties

public Iterator 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.

getProperty

public Object getProperty(String name)
Get 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.

Parameters: name The name of the required property

Returns: The value of the requested property, or null if the property is not available

getPublicId

public String getPublicId()
Return the public identifier for the current document event.

Returns: A string containing the public identifier, or null if none is available.

See Also: XQueryFunction

getResultType

public SequenceType getResultType()

getStaticContext

public StaticContext getStaticContext()

getSystemId

public String getSystemId()
Get the system identifier (URI) of the source 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.

getSystemId

public String getSystemId(int locationId)

getUserFunction

public UserFunction getUserFunction()
Get the callable compiled function contained within this XQueryFunction definition.

registerReference

public void registerReference(UserFunctionCall ufc)

setExecutable

public void setExecutable(Executable exec)

setNameCode

public void setNameCode(int nameCode)