public class GeneralBagFunction extends BagFunction
BagFunction
class that supports all of the general-purpose bag functions:
type-one-and-only, type-bag-size, and type-bag.baseTypes, baseTypes2, NAME_BASE_BAG, NAME_BASE_BAG_SIZE, NAME_BASE_IS_IN, NAME_BASE_ONE_AND_ONLY, simpleTypes, simpleTypes2
FUNCTION_NS, FUNCTION_NS_2, FUNCTION_NS_3
Constructor and Description |
---|
GeneralBagFunction(String functionName)
Constructor that is used to create one of the general-purpose standard bag functions.
|
GeneralBagFunction(String functionName,
String datatype,
String functionType)
Constructor that is used to create instances of general-purpose bag functions for new
(non-standard) datatypes.
|
Modifier and Type | Method and Description |
---|---|
EvaluationResult |
evaluate(List inputs,
EvaluationCtx context)
Evaluate the function, using the specified parameters.
|
static Set |
getSupportedIdentifiers()
Returns a
Set containing all the function identifiers supported by this class. |
getBagInstance, getBagSizeInstance, getIsInInstance, getOneAndOnlyInstance
checkInputs, checkInputsNoBag, encode, encode, evalArgs, getFunctionId, getFunctionName, getIdentifier, getReturnType, getReturnTypeAsString, getType, makeProcessingError, returnsBag
public GeneralBagFunction(String functionName)
BagFunction
for
details about the supported names.functionName
- the name of the function to createIllegalArgumentException
- if the function is unknownpublic GeneralBagFunction(String functionName, String datatype, String functionType)
getInstance
methods in
BagFunction
and is generally only used by the run-time configuration code.functionName
- the name of the new functiondatatype
- the full identifier for the supported datatypefunctionType
- which kind of Bag function, based on the NAME_BASE_*
fieldspublic static Set getSupportedIdentifiers()
Set
containing all the function identifiers supported by this class.Set
of String
spublic EvaluationResult evaluate(List inputs, EvaluationCtx context)
inputs
- a List
of Evaluatable
objects representing the
arguments passed to the functioncontext
- an EvaluationCtx
so that the Evaluatable
objects can
be evaluatedEvaluationResult
representing the function's resultCopyright © 2017 WSO2. All rights reserved.