Class JAXBContextCacheKey

java.lang.Object
com.helger.jaxb.JAXBContextCacheKey

@Immutable @MustImplementEqualsAndHashcode public class JAXBContextCacheKey extends Object
The key class for the JAXBContextCache
Author:
Philip Helger
  • Constructor Details

    • JAXBContextCacheKey

      @Deprecated(forRemoval=true, since="11.0.4") public JAXBContextCacheKey(@Nonnull Package aPackage, @Nullable ClassLoader aClassLoader)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Cache key using package and optional class loader
      Parameters:
      aPackage - Package to be used. May not be null.
      aClassLoader - Class loader. May be null.
    • JAXBContextCacheKey

      public JAXBContextCacheKey(@Nonnull com.helger.commons.collection.impl.ICommonsList<Package> aPackages, @Nullable ClassLoader aClassLoader)
      Cache key using package and optional class loader
      Parameters:
      aPackages - Packages to be used. May not be null.
      aClassLoader - Class loader. May be null.
      Since:
      11.0.4
    • JAXBContextCacheKey

      public JAXBContextCacheKey(@Nonnull com.helger.commons.collection.impl.ICommonsList<Class<?>> aClasses, @Nullable Map<String,?> aProperties)
      Cache key using package and optional class loader
      Parameters:
      aClasses - Classes to be used. May not be null.
      aProperties - JAXB context properties. May be null.
      Since:
      v9.4.2
  • Method Details

    • createJAXBContext

      @Nonnull public jakarta.xml.bind.JAXBContext createJAXBContext(@Nonnull com.helger.commons.log.ConditionalLogger aCondLog)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createForPackage

      @Nonnull public static JAXBContextCacheKey createForPackage(@Nonnull Package aPackage)
      Factory method with a single package and the default ClassLoader.
      Parameters:
      aPackage - Package to load. May not be null.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForPackage

      @Nonnull public static JAXBContextCacheKey createForPackage(@Nonnull Package aPackage, @Nullable ClassLoader aClassLoader)
      Factory method with a single package and the provided ClassLoader.
      Parameters:
      aPackage - Package to load. May not be null.
      aClassLoader - Class loader. May be null.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForPackages

      @Nonnull public static JAXBContextCacheKey createForPackages(@Nonnull com.helger.commons.collection.impl.ICommonsList<Package> aPackages)
      Factory method with a list of packages and the default ClassLoader.
      Parameters:
      aPackages - List of packages to load. May not be null.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForPackages

      @Nonnull public static JAXBContextCacheKey createForPackages(@Nonnull Package... aPackages)
      Factory method with a list of packages and the default ClassLoader.
      Parameters:
      aPackages - List of packages to load. May not be null.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForPackages

      @Nonnull public static JAXBContextCacheKey createForPackages(@Nonnull com.helger.commons.collection.impl.ICommonsList<Package> aPackages, @Nullable ClassLoader aClassLoader)
      Factory method with a list of packages and the provided ClassLoader.
      Parameters:
      aPackages - List of packages to load. May not be null.
      aClassLoader - Class loader. May be null.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForClass

      @Nonnull public static JAXBContextCacheKey createForClass(@Nonnull Class<?> aClass)
      Get the JAXBContext from an existing Class object. If the class's owning package is a valid JAXB package, this method redirects to createForPackage(Package)
      Parameters:
      aClass - The class for which the JAXB context is to be created. May not be null.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForClass

      @Nonnull public static JAXBContextCacheKey createForClass(@Nonnull Class<?> aClass, @Nullable ClassLoader aClassLoader)
      Get the JAXBContext from an existing Class object. If the class's owning package is a valid JAXB package, this method redirects to createForPackage(Package, ClassLoader)
      Parameters:
      aClass - The class for which the JAXB context is to be created. May not be null.
      aClassLoader - Class loader to use. May be null in which case the default class loader is used.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForClasses

      @Nonnull public static JAXBContextCacheKey createForClasses(@Nonnull com.helger.commons.collection.impl.ICommonsList<Class<?>> aClasses)
      Get the JAXBContext from existing Class objects.
      Parameters:
      aClasses - The classes for which the JAXB context is to be created. May not be null nor empty.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForClasses

      @Nonnull public static JAXBContextCacheKey createForClasses(@Nonnull Class<?>... aClasses)
      Get the JAXBContext from existing Class objects.
      Parameters:
      aClasses - The classes for which the JAXB context is to be created. May not be null nor empty.
      Returns:
      The created object. Never null.
      Since:
      11.0.4
    • createForClasses

      @Nonnull public static JAXBContextCacheKey createForClasses(@Nonnull com.helger.commons.collection.impl.ICommonsList<Class<?>> aClasses, @Nullable Map<String,?> aProperties)
      Get the JAXBContext from existing Class objects and optional JAXB Context properties.
      Parameters:
      aClasses - The classes for which the JAXB context is to be created. May not be null nor empty.
      aProperties - JAXB context properties. May be null.
      Returns:
      The created object. Never null.
      Since:
      11.0.4