com.saxonica.extra
Class FirstClassFunction

java.lang.Object
  extended by net.sf.saxon.value.Value
      extended by net.sf.saxon.value.AtomicValue
          extended by net.sf.saxon.value.ObjectValue
              extended by com.saxonica.extra.FirstClassFunction
All Implemented Interfaces:
Serializable, PullEvent, SequenceIterable, GroundedValue, Item, ValueRepresentation, ConversionResult

public class FirstClassFunction
extends ObjectValue

A FirstClassFunction is a value that encapsulates a function; it can therefore be manipulated like any other value: for example it can be assigned to a variable and passed as a parameter to a function. A FirstClassFunction can be created using the extension function saxon:function(), and can be invoked using the extension function saxon:call().

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.sf.saxon.value.Value
EMPTY_CLASS_ARRAY, INDETERMINATE_ORDERING
 
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
 
Fields inherited from interface net.sf.saxon.om.ValueRepresentation
EMPTY_VALUE_ARRAY
 
Constructor Summary
FirstClassFunction(UserFunctionCall exp)
           
 
Method Summary
static FirstClassFunction bind(StructuredQName functionName, int arity, StaticContext env)
           
 int getArity()
           
 ValueRepresentation invoke(ValueRepresentation[] args, XPathContext context)
           
 
Methods inherited from class net.sf.saxon.value.ObjectValue
convertPrimitive, convertToJava, copyAsSubType, displayTypeName, effectiveBooleanValue, equals, getItemType, getObject, getPrimitiveType, getSchemaComparable, getStringValue, getXPathComparable, hashCode, setValue
 
Methods inherited from class net.sf.saxon.value.AtomicValue
asAtomic, checkPermittedContents, convert, convert, getCardinality, getComponent, getLength, getStringValueCS, getTypedValue, getTypeLabel, isNaN, itemAt, iterate, process, setTypeLabel, subsequence, toString
 
Methods inherited from class net.sf.saxon.value.Value
asItem, asItem, asIterator, asValue, convertJavaObjectToXPath, convertToJava, fromItem, getCanonicalLexicalRepresentation, getIterator, iterate, makeQNameValue, reduce, stringToNumber
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FirstClassFunction

public FirstClassFunction(UserFunctionCall exp)
Method Detail

getArity

public int getArity()

bind

public static FirstClassFunction bind(StructuredQName functionName,
                                      int arity,
                                      StaticContext env)
                               throws XPathException
Throws:
XPathException

invoke

public ValueRepresentation invoke(ValueRepresentation[] args,
                                  XPathContext context)
                           throws XPathException
Throws:
XPathException


Copyright (C) Michael H. Kay. All rights reserved.