Class Template
java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.expressions.Template
- All Implemented Interfaces:
- FromSourceLocation,- ToNode
Template represents a "Template Literal". This is a literal string within the rules language. A template
 can contain 0 or more dynamic sections. The dynamic sections use getAttr short-form:
 
`https://{Region}.{partition#dnsSuffix}` -------- ------------ | | Dynamic getAttr short form
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic final classA static template value part.static interfaceAn interface for parts of a template that can be visited.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescription<T> Stream<T>accept(TemplateVisitor<T> visitor) booleanReturns the literal value of this template, throwingRuntimeExceptionif the template is not static.static TemplatefromString(String s) getParts()Gets the source location of a value.inthashCode()booleanisStatic()Gets if the template is static or not.toNode()Converts a value to aNode.toString()Evaluates this template in the provided scope.
- 
Constructor Details- 
Template
 
- 
- 
Method Details- 
fromString
- 
getSourceLocationDescription copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
- getSourceLocationin interface- FromSourceLocation
- Returns:
- Returns the source location of the value.
 
- 
accept
- 
getParts
- 
isStaticpublic boolean isStatic()Gets if the template is static or not.- Returns:
- true if all template parts are literals, false otherwise.
 
- 
expectLiteralReturns the literal value of this template, throwingRuntimeExceptionif the template is not static.- Returns:
- returns the string literal value.
 
- 
typeCheckEvaluates this template in the provided scope.- Parameters:
- scope- the scope to check this template within.
- Returns:
- the type of the template.
 
- 
toNodeDescription copied from interface:ToNodeConverts a value to aNode.
- 
hashCodepublic int hashCode()
- 
equals
- 
toString
 
-