Interface ArgumentTypeStrategy
-
- All Known Implementing Classes:
AndArgumentTypeStrategy
,AnyArgumentTypeStrategy
,ArrayComparableElementArgumentTypeStrategy
,ArrayOfStringArgumentTypeStrategy
,CommonArgumentTypeStrategy
,CompositeArgumentTypeStrategy
,ConstraintArgumentTypeStrategy
,ExplicitArgumentTypeStrategy
,FamilyArgumentTypeStrategy
,IndexArgumentTypeStrategy
,ItemAtIndexArgumentTypeStrategy
,JsonQueryOnErrorEmptyArgumentTypeStrategy
,LiteralArgumentTypeStrategy
,OrArgumentTypeStrategy
,OutputArgumentTypeStrategy
,PercentageArgumentTypeStrategy
,PercentageArrayArgumentTypeStrategy
,RootArgumentTypeStrategy
,SymbolArgumentTypeStrategy
,TypeLiteralArgumentTypeStrategy
@PublicEvolving public interface ArgumentTypeStrategy
Strategy for inferring and validating a single input argument type of a function call.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Signature.Argument
getExpectedArgument(FunctionDefinition functionDefinition, int argumentPos)
Returns a summary of the function's expected argument atargumentPos
.Optional<DataType>
inferArgumentType(CallContext callContext, int argumentPos, boolean throwOnFailure)
Main logic for inferring and validating an argument.
-
-
-
Method Detail
-
inferArgumentType
Optional<DataType> inferArgumentType(CallContext callContext, int argumentPos, boolean throwOnFailure)
Main logic for inferring and validating an argument. Returns the data type that is valid for the given call. If the returned type differs fromCallContext.getArgumentDataTypes()
atargumentPos
, a casting operation can be inserted. An empty result means that the given input type could not be inferred.- Parameters:
callContext
- provides details about the function callargumentPos
- argument index in theCallContext
throwOnFailure
- whether this function is allowed to throw anValidationException
with a meaningful exception in case the inference is not successful or if this function should simply return an empty result.- Returns:
- three-state result for either "true, same data type as argument", "true, but argument must be casted to returned data type", or "false, no inferred data type could be found"
- See Also:
CallContext.newValidationError(String, Object...)
-
getExpectedArgument
Signature.Argument getExpectedArgument(FunctionDefinition functionDefinition, int argumentPos)
Returns a summary of the function's expected argument atargumentPos
.- Parameters:
functionDefinition
- the function definition that defines the function currently being called.argumentPos
- the position within the function call for which the signature should be retrieved
-
-