Class LibraryFunction
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.util.MandatorySourceLocation
-
- software.amazon.smithy.rulesengine.language.syntax.expr.Expression
-
- software.amazon.smithy.rulesengine.language.syntax.fn.Function
-
- software.amazon.smithy.rulesengine.language.syntax.fn.LibraryFunction
-
- All Implemented Interfaces:
FromSourceLocation,ToNode,Into<Condition>,TypeCheck
public class LibraryFunction extends Function
A function (Function) which is constructed from aFunctionDefinition.
-
-
Constructor Summary
Constructors Constructor Description LibraryFunction(FunctionDefinition definition, FunctionNode functionNode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(ExpressionVisitor<T> visitor)Invoke theExpressionVisitorfunctions for this expression.static voidcheckTypeSignature(java.util.List<Type> expectedArgs, java.util.List<Expression> actualArguments, Scope<Type> scope)static LibraryFunctionofExpressions(FunctionDefinition definition, Expression... arguments)Creates a newLibraryFunctioninstance with the given arguments.protected TypetypeCheckLocal(Scope<Type> scope)-
Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.fn.Function
condition, condition, equals, expectOneArgument, getArguments, getName, getSourceLocation, hashCode, into, toNode, toString
-
-
-
-
Constructor Detail
-
LibraryFunction
public LibraryFunction(FunctionDefinition definition, FunctionNode functionNode)
-
-
Method Detail
-
ofExpressions
public static LibraryFunction ofExpressions(FunctionDefinition definition, Expression... arguments)
Creates a newLibraryFunctioninstance with the given arguments.- Parameters:
definition- the function definition.arguments- the function arguments.- Returns:
- the
LibraryFunctioninstance.
-
checkTypeSignature
public static void checkTypeSignature(java.util.List<Type> expectedArgs, java.util.List<Expression> actualArguments, Scope<Type> scope) throws InnerParseError
- Throws:
InnerParseError
-
typeCheckLocal
protected Type typeCheckLocal(Scope<Type> scope)
- Specified by:
typeCheckLocalin classExpression
-
accept
public <T> T accept(ExpressionVisitor<T> visitor)
Description copied from class:ExpressionInvoke theExpressionVisitorfunctions for this expression.- Specified by:
acceptin classExpression- Type Parameters:
T- the visitor return type.- Parameters:
visitor- the visitor to be invoked.- Returns:
- the return value of the visitor.
-
-