Class Rule
java.lang.Object
software.amazon.smithy.rulesengine.language.syntax.rule.Rule
- All Implemented Interfaces:
FromSourceLocation,ToNode,TypeCheck
- Direct Known Subclasses:
EndpointRule,ErrorRule,TreeRule
The core functionality of a rule-set rule.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract <T> Taccept(RuleValueVisitor<T> visitor) Invoke theRuleValueVisitorfunctions for this Rule.static Rule.Builderbuilder()Builder to create aRuleinstance.static Rule.Builderbuilder(FromSourceLocation sourceLocation) Builder to create aRuleinstance.booleanstatic RuleCreates aRuleinstance from the given Node information.Gets the conditions required to satisfy this rule.Gets the documentation value.Gets the source location of a value.inthashCode()toNode()Converts a value to aNode.toString()Checks whether the given types within a scope satisfy the constraints.protected abstract TypetypecheckValue(Scope<Type> scope)
-
Field Details
-
DOCUMENTATION
- See Also:
-
ENDPOINT
- See Also:
-
ERROR
- See Also:
-
TREE
- See Also:
-
RULES
- See Also:
-
TYPE
- See Also:
-
-
Constructor Details
-
Rule
-
-
Method Details
-
builder
Builder to create aRuleinstance.- Returns:
- returns a new Builder.
-
builder
Builder to create aRuleinstance.- Parameters:
sourceLocation- the source of the rule.- Returns:
- returns a new Builder.
-
fromNode
Creates aRuleinstance from the given Node information.- Parameters:
node- the node to deserialize.- Returns:
- the created Rule.
-
getSourceLocation
Description copied from interface:FromSourceLocationGets the source location of a value.- Specified by:
getSourceLocationin interfaceFromSourceLocation- Returns:
- Returns the source location of the value.
-
getConditions
Gets the conditions required to satisfy this rule.- Returns:
- the list of conditions.
-
getDocumentation
Gets the documentation value.- Returns:
- returns the optional documentation value.
-
accept
Invoke theRuleValueVisitorfunctions for this Rule.- Type Parameters:
T- the visitor return type.- Parameters:
visitor- the visitor to be invoked.- Returns:
- the return value of the visitor.
-
typecheckValue
-
typeCheck
Description copied from interface:TypeCheckChecks whether the given types within a scope satisfy the constraints. -
toNode
Description copied from interface:ToNodeConverts a value to aNode. -
equals
-
hashCode
public int hashCode() -
toString
-