Class ReflectiveHierarchyBuildItem

java.lang.Object
io.quarkus.builder.item.BuildItem
io.quarkus.builder.item.MultiBuildItem
io.quarkus.deployment.builditem.nativeimage.ReflectiveHierarchyBuildItem

public final class ReflectiveHierarchyBuildItem extends io.quarkus.builder.item.MultiBuildItem
Attempts to register a complete type hierarchy for reflection.

This is intended to be used to register types that are going to be serialized, e.g. by Jackson or some other JSON mapper.

This will do 'smart discovery' and in addition to registering the type itself it will also attempt to register the following:

  • Superclasses
  • Interfaces
  • Component types of collections
  • Types used in bean properties (if method reflection is enabled)
  • Field types (if field reflection is enabled)

This discovery is applied recursively, so any additional types that are registered will also have their dependencies discovered.

  • Constructor Details

    • ReflectiveHierarchyBuildItem

      @Deprecated public ReflectiveHierarchyBuildItem(org.jboss.jandex.Type type)
      Deprecated.
      Use the Builder instead.
    • ReflectiveHierarchyBuildItem

      @Deprecated public ReflectiveHierarchyBuildItem(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Deprecated.
      Use the Builder instead and provide a source for easy debugging.
    • ReflectiveHierarchyBuildItem

      @Deprecated public ReflectiveHierarchyBuildItem(org.jboss.jandex.Type type, Predicate<org.jboss.jandex.DotName> ignoreTypePredicate)
      Deprecated.
      Use the Builder instead and provide a source for easy debugging.
    • ReflectiveHierarchyBuildItem

      @Deprecated public ReflectiveHierarchyBuildItem(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index, Predicate<org.jboss.jandex.DotName> ignoreTypePredicate)
      Deprecated.
      Use the Builder instead and provide a source for easy debugging.
    • ReflectiveHierarchyBuildItem

      @Deprecated public ReflectiveHierarchyBuildItem(org.jboss.jandex.Type type, String source)
      Deprecated.
      Use the Builder instead and provide a source for easy debugging.
    • ReflectiveHierarchyBuildItem

      @Deprecated public ReflectiveHierarchyBuildItem(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index, String source)
      Deprecated.
      Use the Builder instead and provide a source for easy debugging.
    • ReflectiveHierarchyBuildItem

      @Deprecated public ReflectiveHierarchyBuildItem(org.jboss.jandex.Type type, Predicate<org.jboss.jandex.DotName> ignoreTypePredicate, String source)
      Deprecated.
      Use the Builder instead and provide a source for easy debugging.
    • ReflectiveHierarchyBuildItem

      @Deprecated public ReflectiveHierarchyBuildItem(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index, Predicate<org.jboss.jandex.DotName> ignoreTypePredicate, String source)
      Deprecated.
      Use the Builder instead and provide a source for easy debugging.
  • Method Details

    • getType

      public org.jboss.jandex.Type getType()
    • getIndex

      public org.jboss.jandex.IndexView getIndex()
    • getIgnoreTypePredicate

      public Predicate<org.jboss.jandex.DotName> getIgnoreTypePredicate()
    • getIgnoreFieldPredicate

      public Predicate<org.jboss.jandex.FieldInfo> getIgnoreFieldPredicate()
    • getIgnoreMethodPredicate

      public Predicate<org.jboss.jandex.MethodInfo> getIgnoreMethodPredicate()
    • hasSource

      public boolean hasSource()
    • isConstructors

      public boolean isConstructors()
    • isMethods

      public boolean isMethods()
    • isFields

      public boolean isFields()
    • isSerialization

      public boolean isSerialization()
    • isUnsafeAllocated

      public boolean isUnsafeAllocated()
    • isIgnoreNested

      public boolean isIgnoreNested()
    • getSource

      public String getSource()
    • builder

      public static ReflectiveHierarchyBuildItem.Builder builder(Class<?> clazz)
      Creates a new ReflectiveHierarchyBuildItem.Builder instance, using the specified class for the underlying Type which hierarchy is to be be registered for reflection.
      Parameters:
      clazz - the Class which hierarchy is to be registered for reflection
      Returns:
      a new ReflectiveHierarchyBuildItem.Builder instance, initialized from the specified Class
    • builder

      public static ReflectiveHierarchyBuildItem.Builder builder(String className)
      Creates a new ReflectiveHierarchyBuildItem.Builder instance, using the specified class for the underlying Type which hierarchy is to be be registered for reflection.
      Parameters:
      className - the name of the Class which hierarchy is to be registered for reflection
      Returns:
      a new ReflectiveHierarchyBuildItem.Builder instance, initialized from the specified Class
    • builder

      public static ReflectiveHierarchyBuildItem.Builder builder(org.jboss.jandex.DotName className)
      Creates a new ReflectiveHierarchyBuildItem.Builder instance, using the specified class for the underlying Type which hierarchy is to be be registered for reflection.
      Parameters:
      className - the DotName of the Class which hierarchy is to be registered for reflection
      Returns:
      a new ReflectiveHierarchyBuildItem.Builder instance, initialized from the specified Class
    • builder

      public static ReflectiveHierarchyBuildItem.Builder builder(org.jboss.jandex.Type type)
      Creates a new ReflectiveHierarchyBuildItem.Builder instance, initializing it with the specified Type
      Parameters:
      type - the Type which hierarchy is to be registered for reflection
      Returns:
      a new ReflectiveHierarchyBuildItem.Builder instance, initialized from the specified Type