Package org.codehaus.groovy.classgen.asm.util

# Class TypeUtil

java.lang.Object
org.codehaus.groovy.classgen.asm.util.TypeUtil

public abstract class TypeUtil extends Object
A utility for getting information of types

Since:
  2.5.0

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TypeUtil()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static Class`
  `autoboxType(Class type)`
  Returns the wrapper type for the supplied primitive class, or the class itself if it is already a reference type.
  `static String`
  `getDescriptionByName(String name)`
  Returns the JVM type descriptor for the supplied type name.
  `static String`
  `getDescriptionByType(ClassNode type)`
  Returns the JVM type descriptor for the supplied class node.
  `static int`
  `getLoadInsnByType(org.objectweb.asm.Type type)`
  Returns the load opcode for the supplied ASM type.
  `static int`
  `getReturnInsnByType(org.objectweb.asm.Type type)`
  Returns the return opcode for the supplied ASM type.
  `static String`
  `getWrappedClassDescriptor(org.objectweb.asm.Type type)`
  Returns the descriptor of the wrapper class corresponding to the supplied primitive ASM type.
  `static boolean`
  `isPrimitiveType(String name)`
  Tests whether the supplied type name denotes a primitive type.
  `static boolean`
  `isPrimitiveType(ClassNode type)`
  Tests whether the supplied class node denotes a primitive type.
  `static boolean`
  `isPrimitiveType(org.objectweb.asm.Type type)`
  Tests whether the supplied ASM type is primitive.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TypeUtil

    public TypeUtil()

- ## Method Details

  - ### autoboxType

    public static Class autoboxType(Class type)
    Returns the wrapper type for the supplied primitive class, or the class itself if it is already a reference type.

  - ### getLoadInsnByType

    public static int getLoadInsnByType(org.objectweb.asm.Type type)
    Returns the load opcode for the supplied ASM type.

  - ### getReturnInsnByType

    public static int getReturnInsnByType(org.objectweb.asm.Type type)
    Returns the return opcode for the supplied ASM type.

  - ### getWrappedClassDescriptor

    public static String getWrappedClassDescriptor(org.objectweb.asm.Type type)
    Returns the descriptor of the wrapper class corresponding to the supplied primitive ASM type.

  - ### isPrimitiveType

    public static boolean isPrimitiveType(org.objectweb.asm.Type type)
    Tests whether the supplied ASM type is primitive.

  - ### isPrimitiveType

    public static boolean isPrimitiveType(String name)
    Tests whether the supplied type name denotes a primitive type.

  - ### isPrimitiveType

    public static boolean isPrimitiveType(ClassNode type)
    Tests whether the supplied class node denotes a primitive type.

  - ### getDescriptionByType

    public static String getDescriptionByType(ClassNode type)
    Returns the JVM type descriptor for the supplied class node.

  - ### getDescriptionByName

    public static String getDescriptionByName(String name)
    Returns the JVM type descriptor for the supplied type name.