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
Modifier and TypeFieldDescription -
Constructor Summary
ConstructorDescriptionDatatypeRegistryImpl
(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()
void
Register 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:DatatypeRegistry
Get Datatype instance by its unique id- Specified by:
get
in interfaceDatatypeRegistry
- Returns:
- Datatype instance
-
find
Description copied from interface:DatatypeRegistry
Get Datatype instance by id.- Specified by:
find
in interfaceDatatypeRegistry
- Returns:
- Datatype instance or null if not found
-
find
Description copied from interface:DatatypeRegistry
Get Datatype instance by the corresponding Java class. This method tries to find matching supertype too.- Specified by:
find
in 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:
get
in interfaceDatatypeRegistry
- Returns:
- Datatype instance
- Throws:
IllegalArgumentException
- if no datatype suitable for the given type found
-
getId
Description copied from interface:DatatypeRegistry
Returns an ID of the given datatype in the registry.- Specified by:
getId
in interfaceDatatypeRegistry
-
getIdOptional
- Specified by:
getIdOptional
in interfaceDatatypeRegistry
- Returns:
- the ID of the given datatype wrapped in
Optional
if it found in the registry, otherwise an emptyOptional
.
-
getIdByJavaClass
Description copied from interface:DatatypeRegistry
Returns an ID of a first datatype handling the given Java class.- Specified by:
getIdByJavaClass
in interfaceDatatypeRegistry
-
getIdByJavaClassOptional
- Specified by:
getIdByJavaClassOptional
in interfaceDatatypeRegistry
- Returns:
- the ID of a first datatype handling the given Java class wrapped in
Optional
if it found, otherwise an emptyOptional
.
-
getIds
- Specified by:
getIds
in interfaceDatatypeRegistry
- Returns:
- all registered datatype identifiers.
-
register
Description copied from interface:DatatypeRegistry
Register a datatype instance- Specified by:
register
in interfaceDatatypeRegistry
- Parameters:
datatype
- datatype instanceid
- unique registration iddefaultForJavaClass
- true if the datatype should be default for a Java class handled by this datatype
-