Class LibraryFunction
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
-
- software.amazon.smithy.rulesengine.language.syntax.expressions.Expression
-
- software.amazon.smithy.rulesengine.language.syntax.expressions.functions.LibraryFunction
-
- All Implemented Interfaces:
FromSourceLocation,ToNode,TypeCheck,ToCondition,ToExpression
- Direct Known Subclasses:
AwsPartition,BooleanEquals,GetAttr,IsSet,IsValidHostLabel,IsVirtualHostableS3Bucket,Not,ParseArn,ParseUrl,StringEquals,Substring,UriEncode
public abstract class LibraryFunction extends Expression
A function which is constructed from aFunctionDefinition.
-
-
Field Summary
Fields Modifier and Type Field Description protected FunctionDefinitiondefinitionprotected FunctionNodefunctionNode
-
Constructor Summary
Constructors Constructor Description LibraryFunction(FunctionDefinition definition, FunctionNode functionNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)protected ExpressionexpectOneArgument()java.util.List<Expression>getArguments()java.lang.StringgetName()Returns the name of this function, eg.SourceLocationgetSourceLocation()Gets the source location of a value.inthashCode()NodetoNode()Converts a value to aNode.java.lang.StringtoString()protected TypetypeCheckLocal(Scope<Type> scope)-
Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.Expression
accept, fromNode, getLiteral, getReference, of, of, of, parseShortform, toConditionBuilder, toExpression, type, typeCheck
-
Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
booleanEqual, getAttr, getAttr, isSet, isValidHostLabel, not, parseUrl, stringEqual, substring, template
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.smithy.rulesengine.language.syntax.ToCondition
toCondition, toCondition
-
-
-
-
Field Detail
-
definition
protected final FunctionDefinition definition
-
functionNode
protected final FunctionNode functionNode
-
-
Constructor Detail
-
LibraryFunction
public LibraryFunction(FunctionDefinition definition, FunctionNode functionNode)
-
-
Method Detail
-
getName
public java.lang.String getName()
Returns the name of this function, eg.isSet,parseUrl- Returns:
- The name
-
getArguments
public java.util.List<Expression> getArguments()
- Returns:
- The arguments to this function
-
expectOneArgument
protected Expression expectOneArgument()
-
getSourceLocation
public SourceLocation getSourceLocation()
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Overrides:
getSourceLocationin classExpression- Returns:
- Returns the source location of the value.
-
typeCheckLocal
protected Type typeCheckLocal(Scope<Type> scope)
- Specified by:
typeCheckLocalin classExpression
-
toNode
public Node toNode()
Description copied from interface:ToNodeConverts a value to aNode.- Returns:
- Returns the creates Node.
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin classExpression
-
hashCode
public int hashCode()
- Specified by:
hashCodein classExpression
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-