Class UnreferencedShapes
- java.lang.Object
-
- software.amazon.smithy.model.neighbor.UnreferencedShapes
-
public final class UnreferencedShapes extends java.lang.Object
Finds shapes that are not connected to a "root" shape, are not trait definitions, are not referenced by trait definitions, and are not referenced in trait values throughIdRefTrait
.The "root" shapes defaults to all service shapes in the model. You can customize this by providing a selector that considers every matching shape a root shape. For example, a model might consider all shapes marked with a trait called "root" to be a root shape.
Prelude shapes are never considered unreferenced.
-
-
Constructor Summary
Constructors Constructor Description UnreferencedShapes()
UnreferencedShapes(java.util.function.Predicate<Shape> keepFilter)
UnreferencedShapes(java.util.function.Predicate<Shape> keepFilter, Selector rootShapeSelector)
UnreferencedShapes(Selector selector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Set<Shape>
compute(Model model)
Gets the set of shapes that are unreferenced.
-
-
-
Constructor Detail
-
UnreferencedShapes
public UnreferencedShapes(java.util.function.Predicate<Shape> keepFilter, Selector rootShapeSelector)
- Parameters:
keepFilter
- Predicate that if matched keeps a shape from being unreferenced.rootShapeSelector
- Selector that returns the root shapes to traverse from (defaults to all services).
-
UnreferencedShapes
public UnreferencedShapes()
-
UnreferencedShapes
public UnreferencedShapes(Selector selector)
-
UnreferencedShapes
public UnreferencedShapes(java.util.function.Predicate<Shape> keepFilter)
-
-