Sophie

Sophie

distrib > Mageia > 7 > aarch64 > by-pkgid > b3bdfe6d859a3d6920ff2c44b38e9a6f > files > 171

saxon-manual-9.4.0.9-2.mga7.noarch.rpm

<html>
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>ExtensionFunctionDefinition</title>
      <meta name="keywords" content="Saxon.Api.ExtensionFunctionDefinition class">
      <link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
   </head>
   <body>
      <div style="width:20%; float:left; background-color:#c1cede; overflow:auto; height:100%">
         <h2>Saxon.Api</h2>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="DocumentBuilder.html">DocumentBuilder</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="DomDestination.html">DomDestination</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="DynamicContext.html">DynamicContext</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="DynamicError.html">DynamicError</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="EmptyEnumerator.html">EmptyEnumerator</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="ExtensionFunctionCall.html">ExtensionFunctionCall</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="ExtensionFunctionDefinition.html">ExtensionFunctionDefinition</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="NullDestination.html">NullDestination</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="Processor.html">Processor</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="QName.html">QName</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="SchemaManager.html">SchemaManager</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="SchemaValidator.html">SchemaValidator</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="Serializer.html">Serializer</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="StaticContext.html">StaticContext</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="StaticError.html">StaticError</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="TextWriterDestination.html">TextWriterDestination</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XPathCompiler.html">XPathCompiler</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XPathExecutable.html">XPathExecutable</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XPathSelector.html">XPathSelector</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XQueryCompiler.html">XQueryCompiler</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XQueryEvaluator.html">XQueryEvaluator</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XQueryExecutable.html">XQueryExecutable</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmAnyFunctionType.html">XdmAnyFunctionType</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmAnyItemType.html">XdmAnyItemType</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmAnyNodeType.html">XdmAnyNodeType</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmAtomicType.html">XdmAtomicType</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmAtomicValue.html">XdmAtomicValue</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmDestination.html">XdmDestination</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmEmptySequence.html">XdmEmptySequence</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmFunctionItem.html">XdmFunctionItem</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmItem.html">XdmItem</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmItemType.html">XdmItemType</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmNode.html">XdmNode</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmNodeKind.html">XdmNodeKind</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmSequenceType.html">XdmSequenceType</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XdmValue.html">XdmValue</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XmlDestination.html">XmlDestination</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XsltCompiler.html">XsltCompiler</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XsltExecutable.html">XsltExecutable</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Class&nbsp;<a href="XsltTransformer.html">XsltTransformer</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Enum&nbsp;<a href="RecoveryPolicy.html">RecoveryPolicy</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Enum&nbsp;<a href="SchemaValidationMode.html">SchemaValidationMode</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Enum&nbsp;<a href="TreeModel.html">TreeModel</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Enum&nbsp;<a href="WhitespacePolicy.html">WhitespacePolicy</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Enum&nbsp;<a href="XdmAxis.html">XdmAxis</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Interface&nbsp;<a href="IMessageListener.html">IMessageListener</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Interface&nbsp;<a href="IQueryResolver.html">IQueryResolver</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Interface&nbsp;<a href="IResultDocumentHandler.html">IResultDocumentHandler</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Interface&nbsp;<a href="IXdmEnumerator.html">IXdmEnumerator</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Interface&nbsp;<a href="IXmlLocation.html">IXmlLocation</a></p>
         </div>
         <div style="position:relative; height:4pt">
            <p>Interface&nbsp;<a href="SchemaResolver.html">SchemaResolver</a></p>
         </div>
      </div>
      <div style="width:5%; float:left; background-color:#e4eef0; overflow:auto; height:100%">
         &nbsp;
         
      </div>
      <div style="float:left; width:75%; overflow:auto; height:100%;">
         <h2><font size="-1">Saxon.Api</font><br>Class&nbsp;ExtensionFunctionDefinition
         </h2>
         <hr>
         <dl>
            <dt><pre>public abstract class&nbsp;ExtensionFunctionDefinition</pre></dt>
            <dt> implements <a href="http://msdn.microsoft.com/en-us/library/system.object(VS.80).aspx">object</a></dt>
         </dl>
         <dl>
            <dd>
               
               <p>Abstract superclass for user-written extension functions. An extension function may
                  be implemented as a subclass
                  of this class, with appropriate implementations of the defined methods.
               </p>
               
               <p>More precisely, a subclass of <code>ExtensionFunctionDefinition</code> identifies a family of extension functions
                  with the same (namespace-qualified) name but potentially having different arity (number
                  of arguments).
               </p>
               
               
               <p>A user-defined extension function is typically implemented using a pair of classes:
                  a class that extends 
                  <code>ExtensionFunctionDefinition</code>, whose purpose is to define the properties of the extension function
                  (in particular, its signature -- the types of its arguments and result); and a class
                  that extends
                  <code>ExtensionFunctionCall</code>, whose purpose is to perform the actual evaluation.
               </p> 
               
               <p>The <code>ExtensionFunctionDefinition</code> is immutable and will normally have a singleton instance
                  for each subclass; this singleton instance is registered with the <code>Processor</code> to associate the
                  name of the extension function with its definition.
               </p>
               
               <p>The <code>ExtensionFunctionCall</code> has one instance for each call on the extension function appearing
                  in the source code of a stylesheet or query; this instance is created when Saxon calls
                  the method <code>MakeFunctionCall</code>
                  provided by the <code>ExtensionFunctionDefinition</code> object. The instance of <code>ExtensionFunctionCall</code>
                  holds information about the static context of the function call, and its <code>Call</code> method is called
                  (by Saxon) to evaluate the extension function at run-time.
               </p>
               
            </dd>
         </dl>
         <hr><a name="property_summary"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary="">
            <tr border="#ccccff" class="TableHeadingColor">
               <th align="left" colspan="2"><font size="+2"><b>Property Summary</b></font></th>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;<a href="QName.html">QName</a></code></td>
               <td><code><b><a href="#FunctionName">FunctionName</a></b></code><p>
                     Read-only property returning the name of the extension function, as a QName.
                     
                  </p>
               </td>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;<a href="http://msdn.microsoft.com/en-us/library/system.int32(VS.80).aspx">int</a></code></td>
               <td><code><b><a href="#MinimumNumberOfArguments">MinimumNumberOfArguments</a></b></code><p>
                     Read-only property giving the minimum number of arguments in a call to this extension
                     function.
                     
                  </p>
               </td>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;<a href="http://msdn.microsoft.com/en-us/library/system.int32(VS.80).aspx">int</a></code></td>
               <td><code><b><a href="#MaximumNumberOfArguments">MaximumNumberOfArguments</a></b></code><p>
                     Read-only property giving the maximum number of arguments in a call to this extension
                     function.
                     
                  </p>
               </td>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;XdmSequenceType[]</code></td>
               <td><code><b><a href="#ArgumentTypes">ArgumentTypes</a></b></code><p>
                     Read-only property giving the required types of the arguments to this extension function.
                     
                     If the number of items in the array is less than the maximum number of arguments,
                     
                     then the last entry in the returned ArgumentTypes is assumed to apply to all the rest;
                     
                     if the returned array is empty, then all arguments are assumed to be of type <code>item()*</code>
                     
                  </p>
               </td>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;Boolean</code></td>
               <td><code><b><a href="#TrustResultType">TrustResultType</a></b></code><p>
                     This property may return true for a subclass if it guarantees that the returned result
                     of the function
                     will always be of the declared return type: setting this to true by-passes the run-time
                     checking of the type
                     of the value, together with code that would otherwise perform atomization, numeric
                     type promotion, and similar
                     conversions. If the value is set to true and the value is not of the correct type,
                     the effect is unpredictable
                     and probably disastrous.
                     
                  </p>
               </td>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;Boolean</code></td>
               <td><code><b><a href="#DependsOnFocus">DependsOnFocus</a></b></code><p>
                     This property must return true for a subclass if the evaluation of the function makes
                     use of the context
                     item, position, or size from the dynamic context. It should also return true (despite
                     the property name)
                     if the function makes use of parts of the static context that vary from one part of
                     the query or stylesheet
                     to another. Setting the property to true inhibits certain Saxon optimizations, such
                     as extracting the call
                     from a loop, or moving it into a global variable.
                     
                  </p>
               </td>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;Boolean</code></td>
               <td><code><b><a href="#HasSideEffects">HasSideEffects</a></b></code><p>
                     This property should return true for a subclass if the evaluation of the function
                     has side-effects.
                     Saxon never guarantees the result of calling functions with side-effects, but if this
                     property is set,
                     then certain aggressive optimizations will be avoided, making it more likely that
                     the function behaves
                     as expected.
                     
                  </p>
               </td>
            </tr>
         </table>&nbsp;<a name="method_summary"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary="">
            <tr border="#ccccff" class="TableHeadingColor">
               <th align="left" colspan="2"><font size="+2"><b>Method Summary</b></font></th>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;<a href="XdmSequenceType.html">XdmSequenceType</a></code></td>
               <td><code><b><a href="#ResultType(Saxon.Api.XdmSequenceType[])">ResultType</a></b>(Saxon.Api.XdmSequenceType[]&nbsp;ArgumentTypes)</code><p>
                     Method returning the declared type of the return value from the function. The type
                     of the return
                     value may be known more precisely if the types of the arguments are known (for example,
                     some functions
                     return a value that is the same type as the first argument. The method is therefore
                     called supplying the
                     static types of the actual arguments present in the call.
                     
                  </p>
               </td>
            </tr>
            <tr bgcolor="white" class="TableRowColor">
               <td align="right" valign="top" width="1%"><code>&nbsp;<a href="ExtensionFunctionCall.html">ExtensionFunctionCall</a></code></td>
               <td><code><b><a href="#MakeFunctionCall()">MakeFunctionCall</a></b>()</code><p>
                     Factory method to create an <code>ExtensionFunctionCall</code> object, representing a specific function call in the XSLT or XQuery
                     source code. Saxon will call this method once it has identified that a specific call
                     relates to this extension
                     function.
                     
                  </p>
               </td>
            </tr>
         </table>&nbsp;<a name="property_detail"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary="">
            <tr border="#ccccff" class="TableHeadingColor">
               <th align="left" colspan="2"><font size="+2"><b>Property Detail</b></font></th>
            </tr>
         </table><a name="FunctionName"></a><h3>FunctionName</h3><pre>public&nbsp;abstract&nbsp;<a href="QName.html">QName</a>&nbsp;<b>FunctionName</b>&nbsp;{}</pre><dl>
            <dd>
               <p>
                  Read-only property returning the name of the extension function, as a QName.
                  
               </p>
               <p>
                  A getter for this property must be implemented in every subclass.
                  
               </p>
            </dd>
         </dl>
         <hr><a name="MinimumNumberOfArguments"></a><h3>MinimumNumberOfArguments</h3><pre>public&nbsp;abstract&nbsp;<a href="http://msdn.microsoft.com/en-us/library/system.int32(VS.80).aspx">int</a>&nbsp;<b>MinimumNumberOfArguments</b>&nbsp;{}</pre><dl>
            <dd>
               <p>
                  Read-only property giving the minimum number of arguments in a call to this extension
                  function.
                  
               </p>
               <p>
                  A getter for this property must be implemented in every subclass.
                  
               </p>
            </dd>
         </dl>
         <hr><a name="MaximumNumberOfArguments"></a><h3>MaximumNumberOfArguments</h3><pre>public&nbsp;abstract&nbsp;<a href="http://msdn.microsoft.com/en-us/library/system.int32(VS.80).aspx">int</a>&nbsp;<b>MaximumNumberOfArguments</b>&nbsp;{}</pre><dl>
            <dd>
               <p>
                  Read-only property giving the maximum number of arguments in a call to this extension
                  function.
                  
               </p>
               <p>
                  A getter for this property must be implemented in every subclass.
                  
               </p>
            </dd>
         </dl>
         <hr><a name="ArgumentTypes"></a><h3>ArgumentTypes</h3><pre>public&nbsp;abstract&nbsp;XdmSequenceType[]&nbsp;<b>ArgumentTypes</b>&nbsp;{}</pre><dl>
            <dd>
               <p>
                  Read-only property giving the required types of the arguments to this extension function.
                  
                  If the number of items in the array is less than the maximum number of arguments,
                  
                  then the last entry in the returned ArgumentTypes is assumed to apply to all the rest;
                  
                  if the returned array is empty, then all arguments are assumed to be of type <code>item()*</code>
                  
               </p>
               <p>
                  A getter for this property must be implemented in every subclass.
                  
               </p>
            </dd>
         </dl>
         <hr><a name="TrustResultType"></a><h3>TrustResultType</h3><pre>public&nbsp;virtual&nbsp;Boolean&nbsp;<b>TrustResultType</b>&nbsp;{}</pre><dl>
            <dd>
               <p>
                  This property may return true for a subclass if it guarantees that the returned result
                  of the function
                  will always be of the declared return type: setting this to true by-passes the run-time
                  checking of the type
                  of the value, together with code that would otherwise perform atomization, numeric
                  type promotion, and similar
                  conversions. If the value is set to true and the value is not of the correct type,
                  the effect is unpredictable
                  and probably disastrous.
                  
               </p>
               <p>
                  The default value of this property is <code>false</code>. A getter for this property may be implemented in a subclass
                  to return a different value.
                  
               </p>
            </dd>
         </dl>
         <hr><a name="DependsOnFocus"></a><h3>DependsOnFocus</h3><pre>public&nbsp;virtual&nbsp;Boolean&nbsp;<b>DependsOnFocus</b>&nbsp;{}</pre><dl>
            <dd>
               <p>
                  This property must return true for a subclass if the evaluation of the function makes
                  use of the context
                  item, position, or size from the dynamic context. It should also return true (despite
                  the property name)
                  if the function makes use of parts of the static context that vary from one part of
                  the query or stylesheet
                  to another. Setting the property to true inhibits certain Saxon optimizations, such
                  as extracting the call
                  from a loop, or moving it into a global variable.
                  
               </p>
               <p>
                  The default value of this property is <code>false</code>. A getter for this property may be implemented in a subclass
                  to return a different value.
                  
               </p>
            </dd>
         </dl>
         <hr><a name="HasSideEffects"></a><h3>HasSideEffects</h3><pre>public&nbsp;virtual&nbsp;Boolean&nbsp;<b>HasSideEffects</b>&nbsp;{}</pre><dl>
            <dd>
               <p>
                  This property should return true for a subclass if the evaluation of the function
                  has side-effects.
                  Saxon never guarantees the result of calling functions with side-effects, but if this
                  property is set,
                  then certain aggressive optimizations will be avoided, making it more likely that
                  the function behaves
                  as expected.
                  
               </p>
               <p>
                  The default value of this property is <code>false</code>. A getter for this property may be implemented in a subclass
                  to return a different value.
                  
               </p>
            </dd>
         </dl>
         <hr><a name="method_detail"></a><table border="1" width="100%" cellpadding="3" cellspacing="0" summary="">
            <tr border="#ccccff" class="TableHeadingColor">
               <th align="left" colspan="2"><font size="+2"><b>Method Detail</b></font></th>
            </tr>
         </table><a name="ResultType(Saxon.Api.XdmSequenceType[])"></a><h3>ResultType</h3><pre>public&nbsp;abstract&nbsp;<a href="XdmSequenceType.html">XdmSequenceType</a>&nbsp;<b>ResultType</b>(Saxon.Api.XdmSequenceType[]&nbsp;ArgumentTypes)</pre><dl>
            <dd>
               <p>
                  Method returning the declared type of the return value from the function. The type
                  of the return
                  value may be known more precisely if the types of the arguments are known (for example,
                  some functions
                  return a value that is the same type as the first argument. The method is therefore
                  called supplying the
                  static types of the actual arguments present in the call.
                  
               </p>
               <p>
                  This method must be implemented in every subclass.
                  
               </p><b>Parameters:</b><dl>
                  <dt><code>ArgumentTypes</code> - 
                  </dt>
                  <dd>
                     The static types of the arguments present in the function call
                     
                  </dd>
               </dl>
               <dl>
                  <dt>returns</dt>
                  <dd>
                     An <code>XdmSequenceType</code> representing the declared return type of the extension function
                     
                  </dd>
               </dl>
            </dd>
         </dl>
         <hr><a name="MakeFunctionCall()"></a><h3>MakeFunctionCall</h3><pre>public&nbsp;abstract&nbsp;<a href="ExtensionFunctionCall.html">ExtensionFunctionCall</a>&nbsp;<b>MakeFunctionCall</b>()</pre><dl>
            <dd>
               <p>
                  Factory method to create an <code>ExtensionFunctionCall</code> object, representing a specific function call in the XSLT or XQuery
                  source code. Saxon will call this method once it has identified that a specific call
                  relates to this extension
                  function.
                  
               </p>
               <p>
                  This method must be implemented in every subclass. The implementation should normally
                  instantiate the relevant subclass
                  of <code>ExtensionFunctionCall</code>, and return the new instance.
                  
               </p>
               <dl>
                  <dt>returns</dt>
                  <dd>
                     An instance of the appropriate implementation of <code>ExtensionFunctionCall</code>
                     
                  </dd>
               </dl>
            </dd>
         </dl>
         <hr>
      </div>
   </body>
</html>