Package io.jmix.core.metamodel.datatype
Interface DatatypeRegistry
- All Known Implementing Classes:
DatatypeRegistryImpl
public interface DatatypeRegistry
Registry for
Datatype
s-
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
-
Method Details
-
get
Get Datatype instance by its unique id- Returns:
- Datatype instance
- Throws:
IllegalArgumentException
- if no datatype with the given name found
-
find
Get Datatype instance by id.- Returns:
- Datatype instance or null if not found
-
find
Get Datatype instance by the corresponding Java class. This method tries to find matching supertype too.- 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.- Returns:
- Datatype instance
- Throws:
IllegalArgumentException
- if no datatype suitable for the given type found
-
getId
Returns an ID of the given datatype in the registry.- Throws:
IllegalArgumentException
- if the datatype is not registered
-
getIdOptional
-
getIdByJavaClass
Returns an ID of a first datatype handling the given Java class.- Throws:
IllegalArgumentException
- if no datatypes handle the given Java class
-
getIdByJavaClassOptional
-
getIds
- Returns:
- all registered datatype identifiers.
-
register
Register a datatype instance- Parameters:
datatype
- datatype instanceid
- unique registration iddefaultForJavaClass
- true if the datatype should be default for a Java class handled by this datatype
-