Klasse Type

java.lang.Object
org.aspectj.apache.bcel.generic.Type
Bekannte direkte Unterklassen:
BasicType, ReferenceType, ReturnaddressType

public abstract class Type extends Object
Abstract super class for all possible java types, namely basic types such as int, object types like String and array types, e.g. int[]
Version:
$Id: Type.java,v 1.14 2011/09/28 01:14:54 aclement Exp $
Autor:
M. Dahm modified: AndyClement 2-mar-05: Removed unnecessary static and optimized
  • Felddetails

    • type

      protected byte type
    • signature

      protected String signature
    • VOID

      public static final BasicType VOID
    • BOOLEAN

      public static final BasicType BOOLEAN
    • INT

      public static final BasicType INT
    • SHORT

      public static final BasicType SHORT
    • BYTE

      public static final BasicType BYTE
    • LONG

      public static final BasicType LONG
    • DOUBLE

      public static final BasicType DOUBLE
    • FLOAT

      public static final BasicType FLOAT
    • CHAR

      public static final BasicType CHAR
    • OBJECT

      public static final ObjectType OBJECT
    • STRING

      public static final ObjectType STRING
    • OBJECT_ARRAY

      public static final ArrayType OBJECT_ARRAY
    • STRING_ARRAY

      public static final ArrayType STRING_ARRAY
    • CLASS_ARRAY

      public static final ArrayType CLASS_ARRAY
    • STRINGBUFFER

      public static final ObjectType STRINGBUFFER
    • STRINGBUILDER

      public static final ObjectType STRINGBUILDER
    • THROWABLE

      public static final ObjectType THROWABLE
    • CLASS

      public static final ObjectType CLASS
    • INTEGER

      public static final ObjectType INTEGER
    • EXCEPTION

      public static final ObjectType EXCEPTION
    • LIST

      public static final ObjectType LIST
    • ITERATOR

      public static final ObjectType ITERATOR
    • NO_ARGS

      public static final Type[] NO_ARGS
    • NULL

      public static final ReferenceType NULL
    • UNKNOWN

      public static final Type UNKNOWN
    • STRINGARRAY1

      public static final Type[] STRINGARRAY1
    • STRINGARRAY2

      public static final Type[] STRINGARRAY2
    • STRINGARRAY3

      public static final Type[] STRINGARRAY3
    • STRINGARRAY4

      public static final Type[] STRINGARRAY4
    • STRINGARRAY5

      public static final Type[] STRINGARRAY5
    • STRINGARRAY6

      public static final Type[] STRINGARRAY6
    • STRINGARRAY7

      public static final Type[] STRINGARRAY7
  • Konstruktordetails

    • Type

      protected Type(byte t, String s)
  • Methodendetails

    • getSignature

      public String getSignature()
    • getType

      public byte getType()
    • getSize

      public int getSize()
      Gibt zurück:
      stack size of this type (2 for long and double, 0 for void, 1 otherwise)
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
      Gibt zurück:
      Type string, e.g. 'int[]'
    • getType

      public static final Type getType(String signature)
    • getTypeInternal

      public static final Type.TypeHolder getTypeInternal(String signature) throws StringIndexOutOfBoundsException
      Convert signature to a Type object.
      Parameter:
      signature - signature string such as Ljava/lang/String;
      Gibt zurück:
      type object
      Löst aus:
      StringIndexOutOfBoundsException
    • getReturnType

      public static Type getReturnType(String signature)
      Convert return value of a method (signature) to a Type object.
      Parameter:
      signature - signature string such as (Ljava/lang/String;)V
      Gibt zurück:
      return type
    • getArgumentTypes

      public static Type[] getArgumentTypes(String signature)
      Convert arguments of a method (signature) to an array of Type objects.
      Parameter:
      signature - signature string such as (Ljava/lang/String;)V
      Gibt zurück:
      array of argument types
    • getArgumentSizes

      public static int getArgumentSizes(String signature)
      Work out the type of each argument in the signature and return the cumulative sizes of all the types (size means number of stack slots it consumes, eg double=2, int=1). Unlike the call above, this does minimal unpacking
    • getTypeSize

      public static int getTypeSize(String signature)
      Return the size of the type expressed in the signature. The signature should contain only one type.
    • getType

      public static Type getType(Class cl)
      Convert runtime java.lang.Class to BCEL Type object.
      Parameter:
      cl - Java class
      Gibt zurück:
      corresponding Type object
    • getSignature

      public static String getSignature(Method meth)
    • getSignature

      public static String getSignature(Constructor<?> cons)