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 FunctionDefinition
definition
protected FunctionNode
functionNode
-
Constructor Summary
Constructors Constructor Description LibraryFunction(FunctionDefinition definition, FunctionNode functionNode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
protected Expression
expectOneArgument()
java.util.List<Expression>
getArguments()
java.lang.String
getName()
Returns the name of this function, eg.SourceLocation
getSourceLocation()
Gets the source location of a value.int
hashCode()
Node
toNode()
Converts a value to aNode
.java.lang.String
toString()
protected Type
typeCheckLocal(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:FromSourceLocation
Gets the source location of a value.- Specified by:
getSourceLocation
in interfaceFromSourceLocation
- Overrides:
getSourceLocation
in classExpression
- Returns:
- Returns the source location of the value.
-
typeCheckLocal
protected Type typeCheckLocal(Scope<Type> scope)
- Specified by:
typeCheckLocal
in classExpression
-
toNode
public Node toNode()
Description copied from interface:ToNode
Converts a value to aNode
.- Returns:
- Returns the creates Node.
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equals
in classExpression
-
hashCode
public int hashCode()
- Specified by:
hashCode
in classExpression
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-