Class Jandex2Gizmo

java.lang.Object
org.jboss.jandex.gizmo2.Jandex2Gizmo

public class Jandex2Gizmo extends Object
Bridge methods from org.jboss.jandex types to the Gizmo 2 API.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addAnnotation(io.quarkus.gizmo2.creator.AnnotatableCreator annotatableCreator, org.jboss.jandex.AnnotationInstance annotation, org.jboss.jandex.IndexView index)
    Adds the given annotation to the given annotatableCreator.
    static void
    addTypeParameter(org.jboss.jandex.TypeVariable typeParameter, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator)
    Adds the given typeParameter to the given creator.
    static ClassDesc
    classDescOf(org.jboss.jandex.ClassInfo clazz)
    Returns the ClassDesc corresponding to the given Jandex ClassInfo.
    static ClassDesc
    classDescOf(org.jboss.jandex.DotName name)
    Returns the ClassDesc corresponding to the given Jandex DotName.
    static ClassDesc
    classDescOf(org.jboss.jandex.Type type)
    Returns the ClassDesc corresponding to the erasure of given Jandex Type.
    static io.quarkus.gizmo2.Const
    constOfEnum(org.jboss.jandex.FieldInfo enumConstant)
    Returns an enum constant corresponding to the given Jandex FieldInfo.
    static io.quarkus.gizmo2.desc.ConstructorDesc
    constructorDescOf(org.jboss.jandex.MethodInfo ctor)
    Returns the ConstructorDesc corresponding to the given Jandex MethodInfo.
    static Consumer<io.quarkus.gizmo2.creator.AnnotatableCreator>
    copyAnnotations(org.jboss.jandex.AnnotationTarget annotationTarget, org.jboss.jandex.IndexView index)
    Returns an AnnotatableCreator consumer that copies all annotations from given AnnotationTarget.
    static Consumer<io.quarkus.gizmo2.creator.AnnotatableCreator>
    copyAnnotations(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns an AnnotatableCreator consumer that copies all annotations from given Type.
    static void
    copyModifiers(org.jboss.jandex.ClassInfo clazz, io.quarkus.gizmo2.creator.ClassCreator creator)
    Copies all modifiers (including the access level) from the given Jandex clazz to the given creator.
    static void
    copyModifiers(org.jboss.jandex.FieldInfo field, io.quarkus.gizmo2.creator.FieldCreator creator)
    Copies all modifiers (including the access level) from the given Jandex field to the given creator.
    static void
    copyModifiers(org.jboss.jandex.MethodInfo method, io.quarkus.gizmo2.creator.MethodCreator creator)
    Copies all modifiers (including the access level) from the given Jandex method to the given creator.
    static void
    copyTypeParameters(org.jboss.jandex.ClassInfo clazz, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator)
    Copies type parameters from given clazz to the given creator, preserving order.
    static void
    copyTypeParameters(org.jboss.jandex.MethodInfo method, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator)
    Copies type parameters from given method to the given creator, preserving order.
    static io.quarkus.gizmo2.desc.FieldDesc
    fieldDescOf(org.jboss.jandex.FieldInfo field)
    Returns the FieldDesc corresponding to the given Jandex FieldInfo.
    static io.quarkus.gizmo2.GenericType
    genericTypeOf(org.jboss.jandex.DotName name)
    Returns a GenericType corresponding to the given Jandex DotName.
    static io.quarkus.gizmo2.GenericType
    genericTypeOf(org.jboss.jandex.Type type)
    Returns a GenericType corresponding to the given Jandex Type.
    static io.quarkus.gizmo2.GenericType
    genericTypeOf(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns a GenericType corresponding to the given Jandex Type.
    static io.quarkus.gizmo2.GenericType.OfArray
    genericTypeOfArray(org.jboss.jandex.Type type)
    Returns a GenericType.OfArray corresponding to the given Jandex array Type.
    static io.quarkus.gizmo2.GenericType.OfArray
    genericTypeOfArray(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns a GenericType.OfArray corresponding to the given Jandex array Type.
    static io.quarkus.gizmo2.GenericType.OfClass
    genericTypeOfClass(org.jboss.jandex.Type type)
    Returns a GenericType.OfClass corresponding to the given Jandex class or parameterized Type.
    static io.quarkus.gizmo2.GenericType.OfClass
    genericTypeOfClass(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns a GenericType.OfClass corresponding to the given Jandex class or parameterized Type.
    static io.quarkus.gizmo2.GenericType.OfPrimitive
    genericTypeOfPrimitive(org.jboss.jandex.Type type)
    Returns a GenericType.OfPrimitive corresponding to the given Jandex primitive Type.
    static io.quarkus.gizmo2.GenericType.OfPrimitive
    genericTypeOfPrimitive(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns a GenericType.OfPrimitive corresponding to the given Jandex primitive Type.
    static io.quarkus.gizmo2.GenericType.OfReference
    genericTypeOfReference(org.jboss.jandex.Type type)
    Returns a GenericType.OfReference corresponding to the given Jandex reference Type.
    static io.quarkus.gizmo2.GenericType.OfReference
    genericTypeOfReference(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns a GenericType.OfReference corresponding to the given Jandex reference Type.
    static io.quarkus.gizmo2.GenericType.OfThrows
    genericTypeOfThrows(org.jboss.jandex.Type type)
    Returns a GenericType.OfThrows corresponding to the given Jandex throwable Type.
    static io.quarkus.gizmo2.GenericType.OfThrows
    genericTypeOfThrows(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns a GenericType.OfThrows corresponding to the given Jandex throwable Type.
    static io.quarkus.gizmo2.GenericType.OfTypeVariable
    genericTypeOfTypeVariable(org.jboss.jandex.Type type)
    Returns a GenericType.OfTypeVariable corresponding to the given Jandex Type variable.
    static io.quarkus.gizmo2.GenericType.OfTypeVariable
    genericTypeOfTypeVariable(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns a GenericType.OfTypeVariable corresponding to the given Jandex Type variable.
    static io.quarkus.gizmo2.desc.MethodDesc
    methodDescOf(org.jboss.jandex.MethodInfo method)
    Returns the MethodDesc corresponding to the given Jandex MethodInfo.
    static io.quarkus.gizmo2.TypeArgument
    typeArgumentOf(org.jboss.jandex.Type type)
    Returns a TypeArgument corresponding to the given Jandex Type.
    static io.quarkus.gizmo2.TypeArgument
    typeArgumentOf(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
    Returns a TypeArgument corresponding to the given Jandex Type.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Jandex2Gizmo

      public Jandex2Gizmo()
  • Method Details

    • classDescOf

      public static ClassDesc classDescOf(org.jboss.jandex.DotName name)
      Returns the ClassDesc corresponding to the given Jandex DotName. See Type.name() for the description of the format this method recognizes.
      Parameters:
      name - the Jandex DotName (must not be null)
      Returns:
      the ClassDesc corresponding to the given Jandex DotName
    • classDescOf

      public static ClassDesc classDescOf(org.jboss.jandex.Type type)
      Returns the ClassDesc corresponding to the erasure of given Jandex Type.
      Parameters:
      type - the Jandex type (must not be null)
      Returns:
      the ClassDesc corresponding to the erasure of given Jandex Type
    • classDescOf

      public static ClassDesc classDescOf(org.jboss.jandex.ClassInfo clazz)
      Returns the ClassDesc corresponding to the given Jandex ClassInfo.
      Parameters:
      clazz - the Jandex class (must not be null)
      Returns:
      the ClassDesc corresponding to the given Jandex ClassInfo
    • fieldDescOf

      public static io.quarkus.gizmo2.desc.FieldDesc fieldDescOf(org.jboss.jandex.FieldInfo field)
      Returns the FieldDesc corresponding to the given Jandex FieldInfo.
      Parameters:
      field - the Jandex field (must not be null)
      Returns:
      the FieldDesc corresponding to the given Jandex FieldInfo
    • methodDescOf

      public static io.quarkus.gizmo2.desc.MethodDesc methodDescOf(org.jboss.jandex.MethodInfo method)
      Returns the MethodDesc corresponding to the given Jandex MethodInfo.
      Parameters:
      method - the Jandex method (must not be null)
      Returns:
      the MethodDesc corresponding to the given Jandex MethodInfo
      Throws:
      IllegalArgumentException - if the method is a static initializer or constructor
    • constructorDescOf

      public static io.quarkus.gizmo2.desc.ConstructorDesc constructorDescOf(org.jboss.jandex.MethodInfo ctor)
      Returns the ConstructorDesc corresponding to the given Jandex MethodInfo.
      Parameters:
      ctor - the Jandex constructor (must not be null)
      Returns:
      the ConstructorDesc corresponding to the given Jandex MethodInfo
      Throws:
      IllegalArgumentException - if the ctor is not a constructor
    • genericTypeOf

      public static io.quarkus.gizmo2.GenericType genericTypeOf(org.jboss.jandex.DotName name)
      Returns a GenericType corresponding to the given Jandex DotName.
      Parameters:
      name - the Jandex DotName (must not be null)
      Returns:
      a GenericType corresponding to the given Jandex DotName
    • genericTypeOf

      public static io.quarkus.gizmo2.GenericType genericTypeOf(org.jboss.jandex.Type type)
      Returns a GenericType corresponding to the given Jandex Type. The result does not include type annotations.
      Parameters:
      type - the Jandex Type (must not be null)
      Returns:
      a GenericType corresponding to the given Jandex Type
    • genericTypeOf

      public static io.quarkus.gizmo2.GenericType genericTypeOf(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns a GenericType corresponding to the given Jandex Type. The result includes type annotations if the index is not null.
      Parameters:
      type - the Jandex Type (must not be null)
      index - the Jandex index that contains classes of type annotations (may be null)
      Returns:
      a GenericType corresponding to the given Jandex Type
    • genericTypeOfPrimitive

      public static io.quarkus.gizmo2.GenericType.OfPrimitive genericTypeOfPrimitive(org.jboss.jandex.Type type)
      Returns a GenericType.OfPrimitive corresponding to the given Jandex primitive Type. The result does not include type annotations.
      Parameters:
      type - the Jandex Type (must not be null)
      Returns:
      a GenericType.OfPrimitive corresponding to the given Jandex primitive Type
      Throws:
      IllegalArgumentException - if the given type is not a primitive type or void
    • genericTypeOfPrimitive

      public static io.quarkus.gizmo2.GenericType.OfPrimitive genericTypeOfPrimitive(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns a GenericType.OfPrimitive corresponding to the given Jandex primitive Type. The result includes type annotations if the index is not null.
      Parameters:
      type - the Jandex Type (must not be null)
      index - the Jandex index that contains classes of type annotations (may be null)
      Returns:
      a GenericType.OfPrimitive corresponding to the given Jandex primitive Type
      Throws:
      IllegalArgumentException - if the given type is not a primitive type or void
    • genericTypeOfReference

      public static io.quarkus.gizmo2.GenericType.OfReference genericTypeOfReference(org.jboss.jandex.Type type)
      Returns a GenericType.OfReference corresponding to the given Jandex reference Type. The result does not include type annotations.
      Parameters:
      type - the Jandex Type (must not be null)
      Returns:
      a GenericType.OfReference corresponding to the given Jandex reference Type
      Throws:
      IllegalArgumentException - if the given type is not a reference type
    • genericTypeOfReference

      public static io.quarkus.gizmo2.GenericType.OfReference genericTypeOfReference(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns a GenericType.OfReference corresponding to the given Jandex reference Type. The result includes type annotations if the index is not null.
      Parameters:
      type - the Jandex Type (must not be null)
      index - the Jandex index that contains classes of type annotations (may be null)
      Returns:
      a GenericType.OfReference corresponding to the given Jandex reference Type
      Throws:
      IllegalArgumentException - if the given type is not a reference type
    • genericTypeOfArray

      public static io.quarkus.gizmo2.GenericType.OfArray genericTypeOfArray(org.jboss.jandex.Type type)
      Returns a GenericType.OfArray corresponding to the given Jandex array Type. The result does not include type annotations.
      Parameters:
      type - the Jandex Type (must not be null)
      Returns:
      a GenericType.OfArray corresponding to the given Jandex array Type
      Throws:
      IllegalArgumentException - if the given type is not an array type
    • genericTypeOfArray

      public static io.quarkus.gizmo2.GenericType.OfArray genericTypeOfArray(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns a GenericType.OfArray corresponding to the given Jandex array Type. The result includes type annotations if the index is not null.
      Parameters:
      type - the Jandex Type (must not be null)
      index - the Jandex index that contains classes of type annotations (may be null)
      Returns:
      a GenericType.OfArray corresponding to the given Jandex array Type
      Throws:
      IllegalArgumentException - if the given type is not an array type
    • genericTypeOfThrows

      public static io.quarkus.gizmo2.GenericType.OfThrows genericTypeOfThrows(org.jboss.jandex.Type type)
      Returns a GenericType.OfThrows corresponding to the given Jandex throwable Type. The result does not include type annotations.
      Parameters:
      type - the Jandex Type (must not be null)
      Returns:
      a GenericType.OfThrows corresponding to the given Jandex throwable Type
      Throws:
      IllegalArgumentException - if the given type is not a throwable type
    • genericTypeOfThrows

      public static io.quarkus.gizmo2.GenericType.OfThrows genericTypeOfThrows(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns a GenericType.OfThrows corresponding to the given Jandex throwable Type. The result includes type annotations if the index is not null.
      Parameters:
      type - the Jandex Type (must not be null)
      index - the Jandex index that contains classes of type annotations (may be null)
      Returns:
      a GenericType.OfThrows corresponding to the given Jandex throwable Type
      Throws:
      IllegalArgumentException - if the given type is not a throwable type
    • genericTypeOfClass

      public static io.quarkus.gizmo2.GenericType.OfClass genericTypeOfClass(org.jboss.jandex.Type type)
      Returns a GenericType.OfClass corresponding to the given Jandex class or parameterized Type. The result does not include type annotations.
      Parameters:
      type - the Jandex Type (must not be null)
      Returns:
      a GenericType.OfClass corresponding to the given Jandex class or parameterized Type
      Throws:
      IllegalArgumentException - if the given type is not a class or parameterized type
    • genericTypeOfClass

      public static io.quarkus.gizmo2.GenericType.OfClass genericTypeOfClass(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns a GenericType.OfClass corresponding to the given Jandex class or parameterized Type. The result includes type annotations if the index is not null.
      Parameters:
      type - the Jandex Type (must not be null)
      index - the Jandex index that contains classes of type annotations (may be null)
      Returns:
      a GenericType.OfClass corresponding to the given Jandex class or parameterized Type
      Throws:
      IllegalArgumentException - if the given type is not a class or parameterized type
    • genericTypeOfTypeVariable

      public static io.quarkus.gizmo2.GenericType.OfTypeVariable genericTypeOfTypeVariable(org.jboss.jandex.Type type)
      Returns a GenericType.OfTypeVariable corresponding to the given Jandex Type variable. The result does not include type annotations.
      Parameters:
      type - the Jandex Type (must not be null)
      Returns:
      a GenericType.OfTypeVariable corresponding to the given Jandex Type variable
      Throws:
      IllegalArgumentException - if the given type is not a type variable
    • genericTypeOfTypeVariable

      public static io.quarkus.gizmo2.GenericType.OfTypeVariable genericTypeOfTypeVariable(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns a GenericType.OfTypeVariable corresponding to the given Jandex Type variable. The result includes type annotations if the index is not null.
      Parameters:
      type - the Jandex Type (must not be null)
      index - the Jandex index that contains classes of type annotations (may be null)
      Returns:
      a GenericType.OfTypeVariable corresponding to the given Jandex Type variable
      Throws:
      IllegalArgumentException - if the given type is not a type variable
    • typeArgumentOf

      public static io.quarkus.gizmo2.TypeArgument typeArgumentOf(org.jboss.jandex.Type type)
      Returns a TypeArgument corresponding to the given Jandex Type. The result does not include type annotations.
      Parameters:
      type - the Jandex Type (must not be null)
      Returns:
      a TypeArgument corresponding to the given Jandex Type
      Throws:
      IllegalArgumentException - if the given type cannot be a type argument
    • typeArgumentOf

      public static io.quarkus.gizmo2.TypeArgument typeArgumentOf(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns a TypeArgument corresponding to the given Jandex Type. The result includes type annotations if the index is not null.
      Parameters:
      type - the Jandex Type (must not be null)
      index - the Jandex index that contains classes of type annotations (may be null)
      Returns:
      a TypeArgument corresponding to the given Jandex Type
      Throws:
      IllegalArgumentException - if the given type cannot be a type argument
    • copyTypeParameters

      public static void copyTypeParameters(org.jboss.jandex.ClassInfo clazz, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator)
      Copies type parameters from given clazz to the given creator, preserving order.
      Parameters:
      clazz - the Jandex ClassInfo (must not be null)
      creator - the Gizmo TypeParameterizedCreator (must not be null)
    • copyTypeParameters

      public static void copyTypeParameters(org.jboss.jandex.MethodInfo method, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator)
      Copies type parameters from given method to the given creator, preserving order.
      Parameters:
      method - the Jandex MethodInfo (must not be null)
      creator - the Gizmo TypeParameterizedCreator (must not be null)
    • addTypeParameter

      public static void addTypeParameter(org.jboss.jandex.TypeVariable typeParameter, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator)
      Adds the given typeParameter to the given creator.
      Parameters:
      typeParameter - the Jandex TypeVariable (must not be null)
      creator - the Gizmo TypeParameterizedCreator (must not be null)
    • copyAnnotations

      public static Consumer<io.quarkus.gizmo2.creator.AnnotatableCreator> copyAnnotations(org.jboss.jandex.AnnotationTarget annotationTarget, org.jboss.jandex.IndexView index)
      Returns an AnnotatableCreator consumer that copies all annotations from given AnnotationTarget.
      Parameters:
      annotationTarget - the AnnotationTarget from which to copy the annotations (must not be null)
      index - the Jandex index that contains annotation classes (must not be null)
      Returns:
      an AnnotatableCreator consumer that copies all annotations from given AnnotationTarget
    • copyAnnotations

      public static Consumer<io.quarkus.gizmo2.creator.AnnotatableCreator> copyAnnotations(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index)
      Returns an AnnotatableCreator consumer that copies all annotations from given Type.
      Parameters:
      type - the Type from which to copy the annotations (must not be null)
      index - the Jandex index that contains annotation classes (must not be null)
      Returns:
      an AnnotatableCreator consumer that copies all annotations from given Type
    • addAnnotation

      public static void addAnnotation(io.quarkus.gizmo2.creator.AnnotatableCreator annotatableCreator, org.jboss.jandex.AnnotationInstance annotation, org.jboss.jandex.IndexView index)
      Adds the given annotation to the given annotatableCreator.
      Parameters:
      annotatableCreator - the AnnotatableCreator to which to add the annotation (must not be null)
      annotation - the AnnotationInstance to add (must not be null)
      index - the Jandex index that contains annotation classes (must not be null)
    • constOfEnum

      public static io.quarkus.gizmo2.Const constOfEnum(org.jboss.jandex.FieldInfo enumConstant)
      Returns an enum constant corresponding to the given Jandex FieldInfo.
      Parameters:
      enumConstant - the Jandex enum constant (must not be null)
      Returns:
      an enum constant corresponding to the given Jandex FieldInfo
      Throws:
      IllegalArgumentException - if the enumConstant is not an actual enum constant
    • copyModifiers

      public static void copyModifiers(org.jboss.jandex.ClassInfo clazz, io.quarkus.gizmo2.creator.ClassCreator creator)
      Copies all modifiers (including the access level) from the given Jandex clazz to the given creator.
      Parameters:
      clazz - the Jandex class (must not be null)
      creator - the Gizmo class creator (must not be null)
    • copyModifiers

      public static void copyModifiers(org.jboss.jandex.MethodInfo method, io.quarkus.gizmo2.creator.MethodCreator creator)
      Copies all modifiers (including the access level) from the given Jandex method to the given creator.
      Parameters:
      method - the Jandex method (must not be null)
      creator - the Gizmo method creator (must not be null)
    • copyModifiers

      public static void copyModifiers(org.jboss.jandex.FieldInfo field, io.quarkus.gizmo2.creator.FieldCreator creator)
      Copies all modifiers (including the access level) from the given Jandex field to the given creator.
      Parameters:
      field - the Jandex field (must not be null)
      creator - the Gizmo field creator (must not be null)