public class TypeLookup extends Object
Modifier and Type | Method and Description |
---|---|
org.qi4j.spi.module.ModelModule<ValueModel> |
lookupValueModel(Class type)
Lookup first Value Model matching the given Type.
|
public org.qi4j.spi.module.ModelModule<ValueModel> lookupValueModel(Class type)
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 Type