public final class BottomUpIndex extends java.lang.Object implements KnowledgeIndex
Constructor and Description |
---|
BottomUpIndex(Model model) |
Modifier and Type | Method and Description |
---|---|
java.util.List<EntityShape> |
getAllParents(ToShapeId service,
ToShapeId operationOrResource)
Gets all of the parents of an operation or resource within a service.
|
java.util.Optional<EntityShape> |
getEntityBinding(ToShapeId service,
ToShapeId operationOrResource)
Gets the direct parent of an operation or resource.
|
java.util.Optional<ResourceShape> |
getResourceBinding(ToShapeId service,
ToShapeId operationOrResource)
Gets the direct parent resource of an operation or resource if and only if
the given resource or operation is bound to a resource and not bound to a
service.
|
static BottomUpIndex |
of(Model model) |
public BottomUpIndex(Model model)
public static BottomUpIndex of(Model model)
public java.util.List<EntityShape> getAllParents(ToShapeId service, ToShapeId operationOrResource)
The returned list contains each EntityShape
parent (a resource or
service shape). The first element in the list is the direct parent of the
resource/operation, followed by that resource's parent, until finally the last
element in the list is always a ServiceShape
.
service
- Service to query.operationOrResource
- The operation or resource for which to find the parents.public java.util.Optional<EntityShape> getEntityBinding(ToShapeId service, ToShapeId operationOrResource)
service
- Service closure to query.operationOrResource
- The operation or resource to query.public java.util.Optional<ResourceShape> getResourceBinding(ToShapeId service, ToShapeId operationOrResource)
service
- Service closure to query.operationOrResource
- The operation or resource to query.