Class Reference
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.Reference
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,TypeCheck
,ToCondition
,ToExpression
A reference to a field.
-
Constructor Summary
ConstructorDescriptionReference
(Identifier name, FromSourceLocation sourceLocation) Creates a Reference for the identifier from the given source location. -
Method Summary
Modifier and TypeMethodDescription<R> R
accept
(ExpressionVisitor<R> visitor) Invoke theExpressionVisitor
functions for this expression.boolean
getName()
Gets the name of the field being referenced.int
hashCode()
template()
Converts this expression to a string template.toNode()
Converts a value to aNode
.toString()
protected Type
typeCheckLocal
(Scope<Type> scope) Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.Expression
fromNode, getLiteral, getReference, getSourceLocation, 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
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
-
Constructor Details
-
Reference
Creates a Reference for the identifier from the given source location.- Parameters:
name
- the identifier being referenced.sourceLocation
- the source location for the reference.
-
-
Method Details
-
getName
Gets the name of the field being referenced.- Returns:
- the name of the referenced field.
-
template
Description copied from class:SyntaxElement
Converts this expression to a string template. By default, this implementation returns aRuntimeException
.- Overrides:
template
in classSyntaxElement
- Returns:
- the String template.
-
accept
Description copied from class:Expression
Invoke theExpressionVisitor
functions for this expression.- Specified by:
accept
in classExpression
- Type Parameters:
R
- the visitor return type.- Parameters:
visitor
- the visitor to be invoked.- Returns:
- the return value of the visitor.
-
typeCheckLocal
- Specified by:
typeCheckLocal
in classExpression
-
toNode
Description copied from interface:ToNode
Converts a value to aNode
.- Returns:
- Returns the creates Node.
-
equals
- Specified by:
equals
in classExpression
-
hashCode
public int hashCode()- Specified by:
hashCode
in classExpression
-
toString
-