Class GetAttr
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.functions.LibraryFunction
software.amazon.smithy.rulesengine.language.syntax.expressions.functions.GetAttr
- All Implemented Interfaces:
FromSourceLocation,ToNode,TypeCheck,ToCondition,ToExpression
A rule-set expression for indexing a record/object or array.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classAFunctionDefinitionfor theGetAttrfunction.static interface -
Field Summary
FieldsFields inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.functions.LibraryFunction
definition, functionNode -
Method Summary
Modifier and TypeMethodDescription<R> Raccept(ExpressionVisitor<R> visitor) Invoke theExpressionVisitorfunctions for this expression.booleanGets the value at the defined path out of the target value.static GetAttr.DefinitionGets theFunctionDefinitionimplementation.getPath()Gets the list ofGetAttr.Parts that make up the path to the requested attribute.Gets the expression to retrieve an attribute of.inthashCode()static GetAttrofExpressions(ToExpression arg1, String arg2) Creates aGetAttrfunction from the given expressions.static GetAttrofExpressions(ToExpression arg1, ToExpression arg2) Creates aGetAttrfunction from the given expressions.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.functions.LibraryFunction
expectOneArgument, getArguments, getName, getSourceLocationMethods inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.Expression
fromNode, getLiteral, getReference, 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
-
Field Details
-
ID
- See Also:
-
-
Method Details
-
getDefinition
Gets theFunctionDefinitionimplementation.- Returns:
- the function definition.
-
ofExpressions
Creates aGetAttrfunction from the given expressions.- Parameters:
arg1- the argument to extract from.arg2- the path to extract.- Returns:
- The resulting
GetAttrfunction.
-
ofExpressions
Creates aGetAttrfunction from the given expressions.- Parameters:
arg1- the argument to extract from.arg2- the path to extract.- Returns:
- The resulting
GetAttrfunction.
-
evaluate
Gets the value at the defined path out of the target value.- Parameters:
target- the target value to retrieve a value out of.- Returns:
- the retrieve value.
-
getTarget
Gets the expression to retrieve an attribute of.- Returns:
- the expression targeted by this function.
-
getPath
Gets the list ofGetAttr.Parts that make up the path to the requested attribute.- Returns:
- the list of path parts to the requested attribute.
-
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
- Overrides:
typeCheckLocalin classLibraryFunction
-
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.
-
toNode
Description copied from interface:ToNodeConverts a value to aNode.- Specified by:
toNodein interfaceToNode- Overrides:
toNodein classLibraryFunction- Returns:
- Returns the creates Node.
-
equals
- Overrides:
equalsin classLibraryFunction
-
hashCode
public int hashCode()- Overrides:
hashCodein classLibraryFunction
-
toString
- Overrides:
toStringin classLibraryFunction
-