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
ConstructorsConstructorDescriptionReference(Identifier name, FromSourceLocation sourceLocation) Creates a Reference for the identifier from the given source location. -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(ExpressionVisitor<R> visitor) Invoke theExpressionVisitorfunctions for this expression.booleangetName()Gets the name of the field being referenced.inthashCode()template()Converts this expression to a string template.toNode()Converts a value to aNode.toString()protected TypetypeCheckLocal(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, typeCheckMethods inherited from class software.amazon.smithy.rulesengine.language.syntax.SyntaxElement
booleanEqual, getAttr, getAttr, isSet, isValidHostLabel, not, parseUrl, stringEqual, substringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:SyntaxElementConverts this expression to a string template. By default, this implementation returns aRuntimeException.- Overrides:
templatein classSyntaxElement- Returns:
- the String template.
-
accept
Description copied from class:ExpressionInvoke theExpressionVisitorfunctions for this expression.- Specified by:
acceptin 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:
typeCheckLocalin classExpression
-
toNode
Description copied from interface:ToNodeConverts a value to aNode.- Returns:
- Returns the creates Node.
-
equals
- Specified by:
equalsin classExpression
-
hashCode
public int hashCode()- Specified by:
hashCodein classExpression
-
toString
-