Package net.sf.saxon.query
Class XQueryFunction
java.lang.Object
net.sf.saxon.query.XQueryFunction
- All Implemented Interfaces:
SourceLocator,LocationProvider,SaxonLocator,Container,Declaration,InstructionInfo,Locator
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) List(package private) Expression(package private) int(package private) int(package private) boolean(package private) NamespaceResolver(package private) List(package private) SequenceType(package private) StaticContext(package private) String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidType-check references to this functionvoidexplain(Configuration config) Produce diagnostic output showing the compiled and optimized expression tree for a functionvoidFix up references to this functionintReturn the column numberintGet the type of construct.Get the Executable (representing a complete stylesheet or query) of which this Container forms partintintGet 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(int locationId) Get the line number within the document or module containing a particular locationGet the LocationProvider allowing location identifiers to be resolved.intGet the namespace context of the instruction.intintGet a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.Get an iterator over all the properties available.getProperty(String name) Get the value of a particular property of the instruction.Return the public identifier for the current document event.Get the system identifier (URI) of the source module containing the instruction.getSystemId(int locationId) Get the URI of the document or module containing a particular locationGet the callable compiled function contained within this XQueryFunction definition.booleanvoidbooleanreplaceSubExpression(Expression original, Expression replacement) Replace one subexpression by a replacement subexpressionvoidsetExecutable(Executable exec) voidsetMemoFunction(boolean isMemoFunction) voidsetNameCode(int nameCode)
-
Field Details
-
arguments
List arguments -
resultType
SequenceType resultType -
body
Expression body -
references
List references -
lineNumber
int lineNumber -
columnNumber
int columnNumber -
systemId
String systemId -
memoFunction
boolean memoFunction -
namespaceResolver
NamespaceResolver namespaceResolver -
staticContext
StaticContext staticContext
-
-
Constructor Details
-
XQueryFunction
public XQueryFunction()
-
-
Method Details
-
setNameCode
public void setNameCode(int nameCode) -
getNameCode
public int getNameCode() -
getFunctionDisplayName
-
getFunctionFingerprint
public int getFunctionFingerprint() -
getResultType
-
setExecutable
-
getExecutable
Description copied from interface:ContainerGet the Executable (representing a complete stylesheet or query) of which this Container forms part- Specified by:
getExecutablein interfaceContainer
-
getLocationProvider
Get the LocationProvider allowing location identifiers to be resolved.- Specified by:
getLocationProviderin interfaceContainer
-
getStaticContext
-
getArgumentTypes
-
getParameterDefinitions
-
getNumberOfArguments
public int getNumberOfArguments() -
registerReference
-
setMemoFunction
public void setMemoFunction(boolean isMemoFunction) -
isMemoFunction
public boolean isMemoFunction() -
compile
- Throws:
StaticError
-
fixupReferences
Fix up references to this function- Throws:
XPathException
-
checkReferences
Type-check references to this function- Throws:
XPathException
-
explain
Produce diagnostic output showing the compiled and optimized expression tree for a function- Parameters:
config- the configuration to be used
-
getUserFunction
Get the callable compiled function contained within this XQueryFunction definition. -
getConstructType
public int getConstructType()Get the type of construct. This will be a constant in classLocation.- Specified by:
getConstructTypein interfaceInstructionInfo
-
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.- Specified by:
getObjectNameCodein interfaceInstructionInfo
-
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.- Specified by:
getSystemIdin interfaceInstructionInfo- Specified by:
getSystemIdin interfaceLocator- Specified by:
getSystemIdin interfaceSourceLocator
-
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.- Specified by:
getLineNumberin interfaceInstructionInfo- Specified by:
getLineNumberin interfaceLocator- Specified by:
getLineNumberin interfaceSourceLocator
-
getPublicId
Return the public identifier for the current document event.- Specified by:
getPublicIdin interfaceLocator- Specified by:
getPublicIdin interfaceSourceLocator- Returns:
- A string containing the public identifier, or null if none is available.
- See Also:
-
getColumnNumber
public int getColumnNumber()Return the column number- Specified by:
getColumnNumberin interfaceLocator- Specified by:
getColumnNumberin interfaceSourceLocator- Returns:
- The column number, or -1 if none is available.
- See Also:
-
getSystemId
Description copied from interface:LocationProviderGet the URI of the document 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 or module.
-
getLineNumber
public int getLineNumber(int locationId) Description copied from interface:LocationProviderGet the line number within the document 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 or module.
-
getNamespaceResolver
Get the namespace context of the instruction. This will not always be available, in which case the method returns null.- Specified by:
getNamespaceResolverin interfaceInstructionInfo
-
getProperty
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.- 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.- Specified by:
getPropertiesin interfaceInstructionInfo
-
getHostLanguage
public int getHostLanguage()Get the host language (XSLT, XQuery, XPath) used to implement the code in this container- Specified by:
getHostLanguagein interfaceContainer- Returns:
- typically
Configuration.XSLTorConfiguration.XQUERY
-
replaceSubExpression
Replace one subexpression by a replacement subexpression- Specified by:
replaceSubExpressionin interfaceContainer- Parameters:
original- the original subexpressionreplacement- the replacement subexpression- Returns:
- true if the original subexpression is found
-