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
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract <T> T
accept
(RuleValueVisitor<T> visitor) Invoke theRuleValueVisitor
functions for this Rule.static Rule.Builder
builder()
Builder to create aRule
instance.static Rule.Builder
builder
(FromSourceLocation sourceLocation) Builder to create aRule
instance.boolean
static Rule
Creates aRule
instance from the given Node information.Gets the conditions required to satisfy this rule.Gets the documentation value.Gets the source location of a value.int
hashCode()
toNode()
Converts a value to aNode
.toString()
Checks whether the given types within a scope satisfy the constraints.protected abstract Type
typecheckValue
(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 aRule
instance.- Returns:
- returns a new Builder.
-
builder
Builder to create aRule
instance.- Parameters:
sourceLocation
- the source of the rule.- Returns:
- returns a new Builder.
-
fromNode
Creates aRule
instance from the given Node information.- Parameters:
node
- the node to deserialize.- Returns:
- the created Rule.
-
getSourceLocation
Description copied from interface:FromSourceLocation
Gets the source location of a value.- Specified by:
getSourceLocation
in 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 theRuleValueVisitor
functions 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:TypeCheck
Checks whether the given types within a scope satisfy the constraints. -
toNode
Description copied from interface:ToNode
Converts a value to aNode
. -
equals
-
hashCode
public int hashCode() -
toString
-