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 IMicroElement.
The functionality is a special case of the TypeConverterRegistry as we need a parameter for conversion in this case.
Author:
Philip Helger
  • Field Details

    • DEFAULT_USE_CLASS_HIERARCHY

      public static final boolean DEFAULT_USE_CLASS_HIERARCHY
      See Also:
  • Method Details

    • isInstantiated

      public static boolean isInstantiated()
    • getInstance

      @Nonnull public static MicroTypeConverterRegistry 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: IMicroTypeConverterRegistry
      Register a new type converter.
      Specified by:
      registerMicroElementTypeConverter in interface IMicroTypeConverterRegistry
      Type Parameters:
      T - Data type
      Parameters:
      aClass - The class for which the converter is meant. May not be null.
      aConverter - The converter to be registered. May not be null.
    • getConverterToMicroElement

      @Nullable public <T> IMicroTypeConverter<T> getConverterToMicroElement(@Nullable Class<T> aSrcClass)
    • getConverterToNative

      @Nullable public <T> IMicroTypeConverter<T> getConverterToNative(@Nonnull Class<T> aDstClass)
    • iterateAllRegisteredMicroTypeConverters

      public void iterateAllRegisteredMicroTypeConverters(@Nonnull IMicroTypeConverterCallback aCallback)
      Iterate all registered micro type converters. For informational purposes only.
      Parameters:
      aCallback - The callback invoked for all iterations.
    • getRegisteredMicroTypeConverterCount

      @Nonnegative public int getRegisteredMicroTypeConverterCount()
    • reinitialize

      public void reinitialize()