Class NodeValidatorPlugin.Context
- java.lang.Object
-
- software.amazon.smithy.model.validation.node.NodeValidatorPlugin.Context
-
- Enclosing interface:
- NodeValidatorPlugin
public static final class NodeValidatorPlugin.Context extends java.lang.Object
Validation context to pass to each NodeValidatorPlugin.
-
-
Constructor Summary
Constructors Constructor Description Context(Model model)
Context(Model model, java.util.Set<NodeValidationVisitor.Feature> features)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<MemberShape>
getReferringMember()
boolean
hasFeature(NodeValidationVisitor.Feature feature)
Model
model()
Get the model being evaluated.java.util.Set<Shape>
select(Selector selector)
Select and memoize shapes from the model using a Selector.void
setReferringMember(MemberShape referringMember)
-
-
-
Constructor Detail
-
Context
public Context(Model model)
- Parameters:
model
- Model being evaluated.
-
Context
public Context(Model model, java.util.Set<NodeValidationVisitor.Feature> features)
-
-
Method Detail
-
model
public Model model()
Get the model being evaluated.- Returns:
- Returns the model.
-
select
public java.util.Set<Shape> select(Selector selector)
Select and memoize shapes from the model using a Selector.The cache used by this method is not thread-safe, though that's fine because NodeValidatorPlugins using the same Context all run within the same thread.
- Parameters:
selector
- Selector to evaluate.- Returns:
- Returns the matching shapes.
-
hasFeature
public boolean hasFeature(NodeValidationVisitor.Feature feature)
-
setReferringMember
public void setReferringMember(MemberShape referringMember)
-
getReferringMember
public java.util.Optional<MemberShape> getReferringMember()
-
-