Package com.helger.xml.microdom.convert
Class MicroTypeConverterRegistry
java.lang.Object
com.helger.xml.microdom.convert.MicroTypeConverterRegistry
- All Implemented Interfaces:
IMicroTypeConverterRegistry
@ThreadSafe
@Singleton
public final class MicroTypeConverterRegistry
extends Object
implements IMicroTypeConverterRegistry
A utility class for converting objects from and to
The functionality is a special case of the
IMicroElement.The functionality is a special case of the
TypeConverterRegistry as we need a
parameter for conversion in this case.- Author:
- Philip Helger
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescription<T> IMicroTypeConverter<T>getConverterToMicroElement(Class<T> aSrcClass) <T> IMicroTypeConverter<T>getConverterToNative(Class<T> aDstClass) static MicroTypeConverterRegistryintstatic booleanbooleanvoidIterate all registered micro type converters.<T> voidregisterMicroElementTypeConverter(Class<T> aClass, IMicroTypeConverter<T> aConverter) Register a new type converter.voidvoidsetUseClassHierarchy(boolean bUseClassHierarchy)
-
Field Details
-
DEFAULT_USE_CLASS_HIERARCHY
public static final boolean DEFAULT_USE_CLASS_HIERARCHY- See Also:
-
-
Method Details
-
isInstantiated
public static boolean isInstantiated() -
getInstance
- Returns:
- The singleton instance of this class. Never
null.
-
isUseClassHierarchy
public boolean isUseClassHierarchy() -
setUseClassHierarchy
public void setUseClassHierarchy(boolean bUseClassHierarchy) -
registerMicroElementTypeConverter
public <T> void registerMicroElementTypeConverter(@Nonnull Class<T> aClass, @Nonnull IMicroTypeConverter<T> aConverter) Description copied from interface:IMicroTypeConverterRegistryRegister a new type converter.- Specified by:
registerMicroElementTypeConverterin interfaceIMicroTypeConverterRegistry- Type Parameters:
T- Data type- Parameters:
aClass- The class for which the converter is meant. May not benull.aConverter- The converter to be registered. May not benull.
-
getConverterToMicroElement
@Nullable public <T> IMicroTypeConverter<T> getConverterToMicroElement(@Nullable Class<T> aSrcClass) -
getConverterToNative
-
iterateAllRegisteredMicroTypeConverters
Iterate all registered micro type converters. For informational purposes only.- Parameters:
aCallback- The callback invoked for all iterations.
-
getRegisteredMicroTypeConverterCount
-
reinitialize
public void reinitialize()
-