|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.query.XQueryFunction
public class XQueryFunction
A user-defined function in an XQuery module
Constructor Summary | |
---|---|
XQueryFunction()
Create an XQuery function |
Method Summary | |
---|---|
void |
addArgument(UserFunctionParameter argument)
Add an argument to the list of arguments |
void |
checkReferences(ExpressionVisitor visitor)
Type-check references to this function |
void |
compile()
Compile this function to create a run-time definition that can be interpreted (note, this has nothing to do with Java code generation) |
void |
explain(ExpressionPresenter out)
Produce diagnostic output showing the compiled and optimized expression tree for a function |
void |
fixupReferences()
Fix up references to this function |
SequenceType[] |
getArgumentTypes()
Get the declared types of the arguments of this function |
Expression |
getBody()
Get the body of the function |
int |
getColumnNumber()
Return the column number |
int |
getColumnNumber(long locationId)
Get the column number within the document, entity, or module containing a particular location |
int |
getConstructType()
Get the type of construct. |
int |
getContainerGranularity()
Get the granularity of the container. |
String |
getDisplayName()
Get the name of the function for display in error messages |
Executable |
getExecutable()
Get the executable in which this function is contained |
StructuredQName |
getFunctionName()
Get the name of the function as a structured QName |
int |
getHostLanguage()
Get the host language (XSLT, XQuery, XPath) used to implement the code in this container |
String |
getIdentificationKey()
Get an identifying key for this function, which incorporates the URI and local part of the function name plus the arity |
static String |
getIdentificationKey(String uri,
String localName,
int arity)
Construct what the identification key would be for a function with given URI, local name, and arity |
static String |
getIdentificationKey(StructuredQName qName,
int arity)
Construct what the identification key would be for a function with given URI, local name, and arity |
int |
getLineNumber()
Get the line number of the instruction in the source stylesheet module. |
int |
getLineNumber(long locationId)
Get the line number within the document, entity or module containing a particular location |
LocationProvider |
getLocationProvider()
Get the LocationProvider allowing location identifiers to be resolved. |
NamespaceResolver |
getNamespaceResolver()
Get the namespace context of the instruction. |
int |
getNumberOfArguments()
Get the arity of the function |
StructuredQName |
getObjectName()
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()
Get the definitions of the arguments to this function |
Iterator |
getProperties()
Get an iterator over all the properties available. |
Object |
getProperty(String name)
Get the value of a particular property of the instruction. |
String |
getPublicId()
Return the public identifier for the current document event. |
SequenceType |
getResultType()
Get the result type of the function |
StaticContext |
getStaticContext()
Get the static context for this function |
String |
getSystemId()
Get the system identifier (URI) of the source module containing the instruction. |
String |
getSystemId(long locationId)
Get the URI of the document, entity, or module containing a particular location |
UserFunction |
getUserFunction()
Get the callable compiled function contained within this XQueryFunction definition. |
boolean |
isMemoFunction()
Find out whether this is a memo function |
boolean |
isPrivate()
Ask whether this is a private function (as defined in XQuery 1.1) |
boolean |
isUpdating()
Ask whether this is an updating function (as defined in XQuery Update) |
void |
optimize()
Optimize the body of this function |
void |
registerReference(UserFunctionCall ufc)
Register a call on this function |
void |
setBody(Expression body)
Set the body of the function |
void |
setColumnNumber(int column)
Set the column number of the function declaration |
void |
setExecutable(Executable exec)
Set the executable in which this function is contained |
void |
setFunctionName(StructuredQName name)
Set the name of the function |
void |
setLineNumber(int line)
Set the line number of the function declaration within its module |
void |
setMemoFunction(boolean isMemoFunction)
Set that this is, or is not, a memo function. |
void |
setPrivate(boolean privateFunction)
Set whether this is a private function (as defined in XQuery 1.1) |
void |
setResultType(SequenceType resultType)
Set the required result type of the function |
void |
setStaticContext(QueryModule env)
Set the static context for this function |
void |
setSystemId(String systemId)
Set the system ID of the module containing the function |
void |
setUpdating(boolean isUpdating)
Set whether this is an updating function (as defined in XQuery Update) |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XQueryFunction()
Method Detail |
---|
public int getContainerGranularity()
getContainerGranularity
in interface Container
public void setFunctionName(StructuredQName name)
name
- the name of the function as a StructuredQName objectpublic void addArgument(UserFunctionParameter argument)
argument
- the formal declaration of the argument to be addedpublic void setResultType(SequenceType resultType)
resultType
- the declared result type of the functionpublic void setBody(Expression body)
body
- the expression forming the body of the functionpublic Expression getBody()
public void setSystemId(String systemId)
systemId
- the system ID (= base URI) of the module containing the functionpublic void setLineNumber(int line)
line
- the line number of the function declarationpublic void setColumnNumber(int column)
column
- the column number of the function declarationpublic StructuredQName getFunctionName()
public String getDisplayName()
public String getIdentificationKey()
public static String getIdentificationKey(String uri, String localName, int arity)
uri
- the URI part of the function namelocalName
- the local part of the function namearity
- the number of arguments in the function
public static String getIdentificationKey(StructuredQName qName, int arity)
qName
- the name of the functionarity
- the number of arguments
public SequenceType getResultType()
public void setExecutable(Executable exec)
exec
- the executablepublic Executable getExecutable()
getExecutable
in interface Container
public LocationProvider getLocationProvider()
getLocationProvider
in interface Container
public void setStaticContext(QueryModule env)
env
- the static context for the module in which the function is declaredpublic StaticContext getStaticContext()
public SequenceType[] getArgumentTypes()
public UserFunctionParameter[] getParameterDefinitions()
public int getNumberOfArguments()
public void registerReference(UserFunctionCall ufc)
ufc
- a user function call that references this function.public void setMemoFunction(boolean isMemoFunction)
isMemoFunction
- true if this is a memo function.public boolean isMemoFunction()
public void setUpdating(boolean isUpdating)
isUpdating
- true if this is an updating functionpublic boolean isUpdating()
public void setPrivate(boolean privateFunction)
privateFunction
- true if this is a private functionpublic boolean isPrivate()
public void compile() throws XPathException
XPathException
- if errors are foundpublic void optimize() throws XPathException
XPathException
public void fixupReferences() throws XPathException
XPathException
public void checkReferences(ExpressionVisitor visitor) throws XPathException
visitor
- the expression visitor
XPathException
public void explain(ExpressionPresenter out)
out
- the destination to be usedpublic UserFunction getUserFunction()
public int getConstructType()
Location
.
getConstructType
in interface InstructionInfo
public StructuredQName getObjectName()
getObjectName
in interface InstructionInfo
public String getSystemId()
getSystemId
in interface SourceLocator
getSystemId
in interface InstructionInfo
getSystemId
in interface Locator
public int getLineNumber()
getLineNumber
in interface SourceLocator
getLineNumber
in interface InstructionInfo
getLineNumber
in interface Locator
public String getPublicId()
getPublicId
in interface SourceLocator
getPublicId
in interface Locator
getSystemId()
public int getColumnNumber()
getColumnNumber
in interface SourceLocator
getColumnNumber
in interface Locator
getLineNumber()
public String getSystemId(long locationId)
LocationProvider
getSystemId
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
public int getLineNumber(long locationId)
LocationProvider
getLineNumber
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
public int getColumnNumber(long locationId)
LocationProvider
getColumnNumber
in interface LocationProvider
locationId
- identifier of the location in question (as passed down the Receiver pipeline)
public NamespaceResolver getNamespaceResolver()
public Object getProperty(String name)
getProperty
in interface InstructionInfo
name
- The name of the required property
public Iterator getProperties()
getProperties
in interface InstructionInfo
public int getHostLanguage()
getHostLanguage
in interface Container
Configuration.XSLT
or Configuration.XQUERY
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |