Class ShapeClosureIndex
- All Implemented Interfaces:
KnowledgeIndex
shapeClosures metadata into the set of shapes that
make up each declared closure.
A closure starts from the shapes that match its
includeNamespaces and includeBySelector criteria and
is expanded transitively through directed neighbor relationships. The resolved
set may therefore contain member shapes and any prelude shapes
reached by walking those neighbors (e.g. smithy.api#String
via a structure member).
The rename member of a closure is also exposed so
consumers can apply the renames consistently.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRenames(String closure) Gets the renames declared by the named closure.getRootShapesInClosure(String closure) Gets the root shapes in the named closure.getShapesInClosure(String closure) Gets the shapes in the named closure, including any prelude shapes that were reached by transitive walking.static ShapeClosureIndex
-
Constructor Details
-
ShapeClosureIndex
-
-
Method Details
-
of
-
getShapesInClosure
Gets the shapes in the named closure, including any prelude shapes that were reached by transitive walking.- Parameters:
closure- The id of the closure to look up.- Returns:
- The shapes in the closure.
- Throws:
ExpectationNotMetException- if no closure with the given id is defined in the model.
-
getRootShapesInClosure
Gets the root shapes in the named closure.This only includes shapes directly matched by
includeBySelectorand shape that are part of a namespace inincludeNamespaces. It does NOT include any connected shapes that are not themselves matched by the selector or part of an included namespace.- Parameters:
closure- The id of the closure to look up.- Returns:
- The shapes in the closure.
- Throws:
ExpectationNotMetException- if no closure with the given id is defined in the model.
-
getRenames
Gets the renames declared by the named closure.The keys are the original shape ids and the values are the new names (without a namespace) that consumers should use for those shapes.
- Parameters:
closure- The id of the closure to look up.- Returns:
- The renames declared by the closure.
- Throws:
ExpectationNotMetException- if no closure with the given id is defined in the model.
-
getClosureIds
- Returns:
- The ids of every closure declared in the model.
-