Class Template
- java.lang.Object
- 
- software.amazon.smithy.rulesengine.language.syntax.expressions.Template
 
- 
- All Implemented Interfaces:
- FromSourceLocation,- ToNode
 
 public final class Template extends java.lang.Object implements 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 Classes Modifier and Type Class Description static classTemplate.LiteralA static template value part.static interfaceTemplate.PartAn interface for parts of a template that can be visited.
 - 
Constructor SummaryConstructors Constructor Description Template(StringNode template)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> java.util.stream.Stream<T>accept(TemplateVisitor<T> visitor)booleanequals(java.lang.Object o)java.lang.StringexpectLiteral()Returns the literal value of this template, throwingRuntimeExceptionif the template is not static.static TemplatefromString(java.lang.String s)java.util.List<Template.Part>getParts()SourceLocationgetSourceLocation()Gets the source location of a value.inthashCode()booleanisStatic()Gets if the template is static or not.NodetoNode()Converts a value to aNode.java.lang.StringtoString()TypetypeCheck(Scope<Type> scope)Evaluates this template in the provided scope.
 
- 
- 
- 
Constructor Detail- 
Templatepublic Template(StringNode template) 
 
- 
 - 
Method Detail- 
fromStringpublic static Template fromString(java.lang.String s) 
 - 
getSourceLocationpublic SourceLocation getSourceLocation() Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
- getSourceLocationin interface- FromSourceLocation
- Returns:
- Returns the source location of the value.
 
 - 
acceptpublic <T> java.util.stream.Stream<T> accept(TemplateVisitor<T> visitor) 
 - 
getPartspublic java.util.List<Template.Part> getParts() 
 - 
isStaticpublic boolean isStatic() Gets if the template is static or not.- Returns:
- true if all template parts are literals, false otherwise.
 
 - 
expectLiteralpublic java.lang.String expectLiteral() Returns the literal value of this template, throwingRuntimeExceptionif the template is not static.- Returns:
- returns the string literal value.
 
 - 
typeCheckpublic Type typeCheck(Scope<Type> scope) Evaluates this template in the provided scope.- Parameters:
- scope- the scope to check this template within.
- Returns:
- the type of the template.
 
 - 
hashCodepublic int hashCode() - Overrides:
- hashCodein class- java.lang.Object
 
 - 
equalspublic boolean equals(java.lang.Object o) - Overrides:
- equalsin class- java.lang.Object
 
 - 
toStringpublic java.lang.String toString() - Overrides:
- toStringin class- java.lang.Object
 
 
- 
 
-