Package software.amazon.smithy.contracts
Class ConditionsTraitPlugin
java.lang.Object
software.amazon.smithy.model.validation.node.MemberAndShapeTraitPlugin<Node,ConditionsTrait>
software.amazon.smithy.contracts.ConditionsTraitPlugin
- All Implemented Interfaces:
NodeValidatorPlugin
Validates that shapes with the conditions trait only contain values
that satisfy each condition expression.
-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.smithy.model.validation.node.NodeValidatorPlugin
NodeValidatorPlugin.Context, NodeValidatorPlugin.Emitter -
Field Summary
Fields inherited from interface software.amazon.smithy.model.validation.node.NodeValidatorPlugin
EMPTY_STRING_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheck(Shape shape, ConditionsTrait trait, Node value, NodeValidatorPlugin.Context context, NodeValidatorPlugin.Emitter emitter) Validates the given node value.A filter expressing the shape types this plugin applies to.Methods inherited from class software.amazon.smithy.model.validation.node.MemberAndShapeTraitPlugin
applyMatchingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface software.amazon.smithy.model.validation.node.NodeValidatorPlugin
apply
-
Constructor Details
-
ConditionsTraitPlugin
public ConditionsTraitPlugin()
-
-
Method Details
-
shapeTypeFilter
Description copied from interface:NodeValidatorPluginA filter expressing the shape types this plugin applies to.- Returns:
- A
ShapeTypeFilterthat matches aShapeTypeif this plugin has an effect on shapes of that type.
-
check
protected void check(Shape shape, ConditionsTrait trait, Node value, NodeValidatorPlugin.Context context, NodeValidatorPlugin.Emitter emitter) Description copied from class:MemberAndShapeTraitPluginValidates the given node value.Implementors can assume the given trait is applied to the given shape.
- Specified by:
checkin classMemberAndShapeTraitPlugin<Node,ConditionsTrait> - Parameters:
shape- The shape the given value is for.trait- The applied trait on the given shape.value- TheNodevalue to validate.context- The plugin validation context.emitter- The emitter to emit any validation events that occur.
-