public interface TypeLookup
Modifier and Type | Method and Description |
---|---|
Stream<EntityDescriptor> |
allEntities() |
Stream<ObjectDescriptor> |
allObjects() |
Stream<? extends ModelDescriptor> |
allServices() |
Stream<TransientDescriptor> |
allTransients() |
Stream<ValueDescriptor> |
allValues() |
EntityDescriptor |
lookupEntityModel(Class<?> type)
Lookup first Entity Model matching the given Type.
|
List<EntityDescriptor> |
lookupEntityModels(Class<?> type)
Lookup all Entity Models matching the given Type.
|
ObjectDescriptor |
lookupObjectModel(Class<?> type)
Lookup first Object Model matching the given Type.
|
ModelDescriptor |
lookupServiceModel(Type serviceType)
Lookup first ServiceDescriptor/ImportedServiceDescriptor matching the given Type.
|
List<? extends ModelDescriptor> |
lookupServiceModels(Type type)
Lookup all ServiceDescriptors matching the given Type.
|
TransientDescriptor |
lookupTransientModel(Class<?> type)
Lookup first Transient Model matching the given Type.
|
ValueDescriptor |
lookupValueModel(Class<?> type)
Lookup first Value Model matching the given Type.
|
ObjectDescriptor lookupObjectModel(Class<?> type) throws AmbiguousTypeException
First, if Object Models exactly match the given type, the closest one (Visibility then Assembly order) is returned. Multiple exact matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Second, if Object Models match a type assignable to the given type, the closest one (Visibility then Assembly order) is returned. Multiple assignable matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Type lookup is done lazily and cached.
type
- Looked up TypeAmbiguousTypeException
- when a type ambiguity is foundTransientDescriptor lookupTransientModel(Class<?> type) throws AmbiguousTypeException
First, if Transient Models exactly match the given type, the closest one (Visibility then Assembly order) is returned. Multiple exact matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Second, if Transient Models match a type assignable to the given type, the closest one (Visibility then Assembly order) is returned. Multiple assignable matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Type lookup is done lazily and cached.
type
- Looked up TypeAmbiguousTypeException
- when a type ambiguity is foundValueDescriptor lookupValueModel(Class<?> type) throws AmbiguousTypeException
First, if Value Models exactly match the given type, the closest one (Visibility then Assembly order) is returned. Multiple exact matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Second, if Value Models match a type assignable to the given type, the closest one (Visibility then Assembly order) is returned. Multiple assignable matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Type lookup is done lazily and cached.
type
- Looked up TypeAmbiguousTypeException
- when a type ambiguity is foundEntityDescriptor lookupEntityModel(Class<?> type) throws AmbiguousTypeException
First, if Entity Models exactly match the given type, the closest one (Visibility then Assembly order) is returned. Multiple exact matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Second, if Entity Models match a type assignable to the given type, the closest one (Visibility then Assembly order) is returned. Multiple assignable matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Type lookup is done lazily and cached.
Should be used for creational use cases only. For non-creational use cases see
lookupEntityModels(Class)
.
type
- Looked up TypeAmbiguousTypeException
- when a type ambiguity is foundList<EntityDescriptor> lookupEntityModels(Class<?> type) throws AmbiguousTypeException
Returned List contains, in order, Entity Models that:
Multiple exact matches with the same Visibility are forbidden and result in an AmbiguousTypeException.
Multiple assignable matches are allowed to enable polymorphic fetches and queries.
Type lookup is done lazily and cached.
Should be used for non-creational use cases only. For creational use cases see
lookupEntityModel(Class)
.
type
- Looked up TypeAmbiguousTypeException
- when a type ambiguity is foundModelDescriptor lookupServiceModel(Type serviceType) throws AmbiguousTypeException
Type lookup is done lazily and cached.
serviceType
- Looked up TypeAmbiguousTypeException
- when a type ambiguity is foundList<? extends ModelDescriptor> lookupServiceModels(Type type) throws AmbiguousTypeException
Returned List contains, in order, ServiceReferences that:
Multiple exact matches with the same Visibility are allowed to enable polymorphic lookup/injection.
Multiple assignable matches with the same Visibility are allowed for the very same reason.
Type lookup is done lazily and cached.
type
- Looked up TypeAmbiguousTypeException
- when a type ambiguity is foundStream<ObjectDescriptor> allObjects()
Stream<TransientDescriptor> allTransients()
Stream<ValueDescriptor> allValues()
Stream<EntityDescriptor> allEntities()
Stream<? extends ModelDescriptor> allServices()