public class ObjectMap extends SystemFunction
The current implementation physically creates a new map, though there's some optimization if it is known that only one of the entries will be needed. There would be scope for a faster implementation, creating a virtual map backed by the Java object, if this proves to be needed.
|Constructor and Description|
|Modifier and Type||Method and Description|
Evaluate this function call at run-time
Make a map representing the methods defined in a class.
Convert a Java object to a map
dependsOnContextItem, dynamicCall, equals, export, exportAdditionalArguments, exportAttributes, fixArguments, getArity, getCardinality, getCompilerName, getContextNode, getDescription, getDetails, getErrorCodeForTypeErrors, getFunctionItemType, getFunctionName, getIntegerBounds, getNetCost, getOperandRoles, getRequiredType, getResultItemType, getResultItemType, getRetainedStaticContext, getSpecialProperties, getStaticBaseUriString, getStreamerName, importAttributes, isTrustedResultType, makeCall, makeFunction, makeFunctionCall, makeOptimizedFunctionCall, resultIfEmpty, setArity, setDetails, setRetainedStaticContext, supplyTypeInformation, toShortString, toString, typeCheckCaller
atomize, deepEquals, effectiveBooleanValue, getAnnotations, getStringValue, getStringValueCS, isArray, isMap, makeNewContext, simplify, typeCheck
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getLength, head, isStreamed, itemAt, iterate, reduce, subsequence, toGroundedValue
asIterable, concatenate, containsNode, materialize
public MapItem call(XPathContext context, Sequence arguments) throws XPathException
context- The XPath dynamic evaluation context
arguments- The values of the arguments to the function call. Each argument value (which is in general a sequence) is supplied in the form of an iterator over the items in the sequence. If required, the supplied sequence can be materialized by calling, for example,
new SequenceExtent(arguments[i]). If the argument is always a singleton, then the single item may be obtained by calling
arguments[i].next(). The implementation is not obliged to read all the items in each
SequenceIteratorif they are not required to compute the result; but if any SequenceIterator is not read to completion, it is good practice to call its close() method.
SingletonIterator. If the result is an empty sequence, the method should return
XPathException- if a dynamic error occurs during evaluation of the function. The Saxon run-time code will add information about the error location.
public static MapItem toMap(Configuration config, ObjectValue value, java.lang.String required)
config- the Saxon Configuration
value- the (wrapped) Java object to be converted
required- if non-null, indicates the key of the entry that is required in the map. If this parameter is supplied, then the map will be limited to a single entry with this key, since it is known that the other entries would never be used.
public static java.util.Map<java.lang.String,Function> makeMethodMap(Configuration config, java.lang.Class javaClass, java.lang.String required)
config- the Saxon configuration
javaClass- the Java class whose methods are required
required- if non-null, indicates the key of the entry that is required in the map. If this parameter is supplied, then the map will be limited to a single entry with this key, since it is known that the other entries would never be used
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.