Class UnreferencedShapes
java.lang.Object
software.amazon.smithy.model.neighbor.UnreferencedShapes
Finds shapes that do not meet any of the following criteria:
- The shape is connected to a "root" shape.
- The shape is a trait definition or is connected to a trait definition.
- The shape is referenced in a trait value through
IdRefTrait. - The shape is a metadata definition or is connected to a metadata definition.
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
ConstructorsConstructorDescriptionUnreferencedShapes(Predicate<Shape> keepFilter) UnreferencedShapes(Predicate<Shape> keepFilter, Selector rootShapeSelector) UnreferencedShapes(Selector selector) -
Method Summary
-
Constructor Details
-
UnreferencedShapes
- 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
-
UnreferencedShapes
-
-
Method Details
-
compute
Gets the set of shapes that are unreferenced.- Parameters:
model- Model to compute from.- Returns:
- Returns the unreferenced shapes.
-