Package io.quarkus.arc.processor
Class AsmUtilCopy
- java.lang.Object
-
- io.quarkus.arc.processor.AsmUtilCopy
-
public class AsmUtilCopy extends Object
Copy of quarkus-core AsmUtil for some methods, with a tweak on the ARG_MAPPER (not name->String anymore) and methods for getting a class signature and knowing if a signature is required.
-
-
Constructor Summary
Constructors Constructor Description AsmUtilCopy()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetGeneratedSubClassSignature(org.jboss.jandex.ClassInfo superClass, org.jboss.jandex.Type superClassAsType)Returns the Java bytecode signature of a given Jandex Class using the given type argument mappings.static StringgetSignature(org.jboss.jandex.MethodInfo method)Returns the Java bytecode signature of a given Jandex MethodInfo with no type argument mappings.static StringgetSignature(org.jboss.jandex.MethodInfo method, Function<org.jboss.jandex.TypeVariable,org.jboss.jandex.Type> typeArgMapper)Returns the Java bytecode signature of a given Jandex MethodInfo using the given type argument mappings.static booleanneedsSignature(org.jboss.jandex.MethodInfo method)Returns true if the given method has type parameters or if its return type or parameter types require a signature
-
-
-
Method Detail
-
getSignature
public static String getSignature(org.jboss.jandex.MethodInfo method)
Returns the Java bytecode signature of a given Jandex MethodInfo with no type argument mappings. For example, given this method:
This will return <R:Ljava/lang/Object;>(ITT;)Ljava/util/List<TR;>;.public class Foo<T> { public <R> List<R> method(int a, T t){...} }- Parameters:
method- the method you want the signature for.- Returns:
- a bytecode signature for that method.
-
getSignature
public static String getSignature(org.jboss.jandex.MethodInfo method, Function<org.jboss.jandex.TypeVariable,org.jboss.jandex.Type> typeArgMapper)
Returns the Java bytecode signature of a given Jandex MethodInfo using the given type argument mappings. For example, given this method:
This will return <R:Ljava/lang/Object;>(ILjava/lang/Integer;)Ljava/util/List<TR;>; if yourpublic class Foo<T> { public <R> List<R> method(int a, T t){...} }typeArgMappercontainsT=Ljava/lang/Integer;.- Parameters:
method- the method you want the signature for.typeArgMapper- a mapping between type variables and their resolved type.- Returns:
- a bytecode signature for that method.
-
getGeneratedSubClassSignature
public static String getGeneratedSubClassSignature(org.jboss.jandex.ClassInfo superClass, org.jboss.jandex.Type superClassAsType)
Returns the Java bytecode signature of a given Jandex Class using the given type argument mappings. For example, given this superclass:{@code public class FooThis will return <R:Ljava/lang/Object;>LFoo<TR;>;. {@code Bar} and {@code List} will be ignored, as they won't be part of the signature of the generated subclass. All will be as if the generated subclass was declared like this:extends Bar implements List { } {@code public class MyGeneratedClassextends Foo { } - Parameters:
superClass- the superclass of the type you want to generate the signature for.superClassAsType- the superclass as a Jandex Type.- Returns:
- a bytecode signature for that class.
-
needsSignature
public static boolean needsSignature(org.jboss.jandex.MethodInfo method)
Returns true if the given method has type parameters or if its return type or parameter types require a signature
-
-