Class DataTypeService


  • public final class DataTypeService
    extends Object
    This class provides a singleton service to allow data types to be discovered within the system based on an SPI provided by IDataTypeProvider.
    • Method Detail

      • getInstance

        @NonNull
        public static DataTypeService getInstance()
        Get the singleton service instance, which will be lazy constructed on first access.
        Returns:
        the service instance
      • getJavaTypeAdapterByName

        @Nullable
        public IDataTypeAdapter<?> getJavaTypeAdapterByName​(@NonNull
                                                            String name)
        Lookup a specific IDataTypeAdapter instance by its name.
        Parameters:
        name - the data type name of data type adapter to get the instance for
        Returns:
        the instance or null if the instance is unknown to the type system
      • getJavaTypeAdapterByClass

        @Nullable
        public <TYPE extends IDataTypeAdapter<?>> TYPE getJavaTypeAdapterByClass​(@NonNull
                                                                                 Class<TYPE> clazz)
        Lookup a specific IDataTypeAdapter instance by its class.
        Type Parameters:
        TYPE - the type of the requested adapter
        Parameters:
        clazz - the adapter class to get the instance for
        Returns:
        the instance or null if the instance is unknown to the type system