Class GetAttr
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.util.MandatorySourceLocation
-
- software.amazon.smithy.rulesengine.language.syntax.expr.Expression
-
- software.amazon.smithy.rulesengine.language.syntax.fn.GetAttr
-
- All Implemented Interfaces:
FromSourceLocation,ToNode,TypeCheck
public final class GetAttr extends Expression
A rule-set expression for indexing a record/object or array.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classGetAttr.Builderstatic interfaceGetAttr.Part
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringID
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <R> Raccept(ExpressionVisitor<R> visitor)Invoke theExpressionVisitorfunctions for this expression.static GetAttr.Builderbuilder()Conditioncondition()Convert this function into a condition.Conditioncondition(java.lang.String result)Converts this function into a condition which stores the output in the named result.booleanequals(java.lang.Object o)Valueevaluate(Value target)java.util.List<GetAttr.Part>getPath()ExpressiongetTarget()inthashCode()java.lang.Stringtemplate()Converts this expression to a string template.NodetoNode()Converts a value to aNode.java.lang.StringtoString()TypetypeCheckLocal(Scope<Type> scope)-
Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.expr.Expression
equal, equal, fromNode, getAttr, getAttr, isSet, isValidHostLabel, isVirtualHostableS3Bucket, literal, not, of, of, of, parseArn, parseShortform, parseUrl, reference, substring, type, typeCheck
-
Methods inherited from class software.amazon.smithy.rulesengine.language.util.MandatorySourceLocation
getSourceLocation
-
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
-
Method Detail
-
builder
public static GetAttr.Builder builder()
-
getTarget
public Expression getTarget()
-
getPath
public java.util.List<GetAttr.Part> getPath()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
accept
public <R> R accept(ExpressionVisitor<R> visitor)
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
public Type typeCheckLocal(Scope<Type> scope)
- Specified by:
typeCheckLocalin classExpression
-
template
public java.lang.String template()
Description copied from class:ExpressionConverts this expression to a string template. By default this implementation returns aRuntimeException.- Overrides:
templatein classExpression- Returns:
- the string template.
-
toNode
public Node toNode()
Description copied from interface:ToNodeConverts a value to aNode.- Returns:
- Returns the creates Node.
-
condition
public Condition condition()
Convert this function into a condition.- Returns:
- the function as a condition.
-
condition
public Condition condition(java.lang.String result)
Converts this function into a condition which stores the output in the named result.- Parameters:
result- the name of the result parameter.- Returns:
- the function as a condition.
-
equals
public boolean equals(java.lang.Object o)
- Specified by:
equalsin classExpression
-
hashCode
public int hashCode()
- Specified by:
hashCodein classExpression
-
-