Package io.jmix.core.impl
Class DatatypeRegistryImpl
java.lang.Object
io.jmix.core.impl.DatatypeRegistryImpl
- All Implemented Interfaces:
DatatypeRegistry
@Component("core_DatatypeRegistry")
public class DatatypeRegistryImpl
extends Object
implements DatatypeRegistry
-
Field Summary
FieldsModifier and TypeFieldDescription -
Constructor Summary
ConstructorsConstructorDescriptionDatatypeRegistryImpl(List<Datatype<?>> datatypeList, JmixModulesAwareBeanSelector beanSelector) -
Method Summary
Modifier and TypeMethodDescription<T> Datatype<T>Get Datatype instance by the corresponding Java class.Datatype<?>Get Datatype instance by id.<T> Datatype<T>Get Datatype instance by the corresponding Java class.Datatype<?>Get Datatype instance by its unique idReturns an ID of the given datatype in the registry.getIdByJavaClass(Class<?> javaClass) Returns an ID of a first datatype handling the given Java class.getIdByJavaClassOptional(Class<?> javaClass) getIdOptional(Datatype<?> datatype) getIds()voidRegister a datatype instance
-
Field Details
-
datatypeByClass
-
datatypeById
-
-
Constructor Details
-
DatatypeRegistryImpl
@Autowired public DatatypeRegistryImpl(List<Datatype<?>> datatypeList, JmixModulesAwareBeanSelector beanSelector)
-
-
Method Details
-
get
Description copied from interface:DatatypeRegistryGet Datatype instance by its unique id- Specified by:
getin interfaceDatatypeRegistry- Returns:
- Datatype instance
-
find
Description copied from interface:DatatypeRegistryGet Datatype instance by id.- Specified by:
findin interfaceDatatypeRegistry- Returns:
- Datatype instance or null if not found
-
find
Description copied from interface:DatatypeRegistryGet Datatype instance by the corresponding Java class. This method tries to find matching supertype too.- Specified by:
findin interfaceDatatypeRegistry- Returns:
- Datatype instance or null if not found
-
get
Get Datatype instance by the corresponding Java class. This method tries to find matching supertype too.- Specified by:
getin interfaceDatatypeRegistry- Returns:
- Datatype instance
- Throws:
IllegalArgumentException- if no datatype suitable for the given type found
-
getId
Description copied from interface:DatatypeRegistryReturns an ID of the given datatype in the registry.- Specified by:
getIdin interfaceDatatypeRegistry
-
getIdOptional
- Specified by:
getIdOptionalin interfaceDatatypeRegistry- Returns:
- the ID of the given datatype wrapped in
Optionalif it found in the registry, otherwise an emptyOptional.
-
getIdByJavaClass
Description copied from interface:DatatypeRegistryReturns an ID of a first datatype handling the given Java class.- Specified by:
getIdByJavaClassin interfaceDatatypeRegistry
-
getIdByJavaClassOptional
- Specified by:
getIdByJavaClassOptionalin interfaceDatatypeRegistry- Returns:
- the ID of a first datatype handling the given Java class wrapped in
Optionalif it found, otherwise an emptyOptional.
-
getIds
- Specified by:
getIdsin interfaceDatatypeRegistry- Returns:
- all registered datatype identifiers.
-
register
Description copied from interface:DatatypeRegistryRegister a datatype instance- Specified by:
registerin interfaceDatatypeRegistry- Parameters:
datatype- datatype instanceid- unique registration iddefaultForJavaClass- true if the datatype should be default for a Java class handled by this datatype
-