javassist
Class CtPrimitiveType

java.lang.Object
  extended by javassist.CtClass
      extended by javassist.CtPrimitiveType

public final class CtPrimitiveType
extends CtClass

An instance of CtPrimitiveType represents a primitive type. It is obtained from CtClass.


Field Summary
 
Fields inherited from class javassist.CtClass
booleanType, byteType, charType, doubleType, floatType, intType, longType, shortType, version, voidType
 
Method Summary
 int getArrayType()
          Returns the array-type code representing the type.
 int getDataSize()
          Returns the data size of the primitive type.
 char getDescriptor()
          Returns the descriptor representing this type.
 java.lang.String getGetMethodDescriptor()
          Returns the descriptor of the method for retrieving the value from the wrapper object.
 java.lang.String getGetMethodName()
          Returns the name of the method for retrieving the value from the wrapper object.
 int getReturnOp()
          Returns the opcode for returning a value of the type.
 java.lang.String getWrapperName()
          Returns the name of the wrapper class.
 boolean isPrimitive()
          Returns true if this object represents a primitive Java type: boolean, byte, char, short, int, long, float, double, or void.
 
Methods inherited from class javassist.CtClass
addConstructor, addField, addField, addField, addInterface, addMethod, debugWriteFile, defrost, detach, getAccessorMaker, getAnnotations, getAttribute, getAvailableAnnotations, getClassFile, getClassFile2, getClassInitializer, getClassPool, getComponentType, getConstructor, getConstructors, getDeclaredBehaviors, getDeclaredConstructor, getDeclaredConstructors, getDeclaredField, getDeclaredFields, getDeclaredMethod, getDeclaredMethod, getDeclaredMethods, getDeclaringClass, getEnclosingMethod, getField, getFields, getInterfaces, getMethod, getMethods, getModifiers, getName, getNestedClasses, getPackageName, getRefClasses, getSimpleName, getSuperclass, getURL, instrument, instrument, isAnnotation, isArray, isEnum, isFrozen, isInterface, isModified, main, makeClassInitializer, makeNestedClass, makeUniqueName, prune, removeConstructor, removeField, removeMethod, replaceClassName, replaceClassName, setAttribute, setInterfaces, setModifiers, setName, setSuperclass, stopPruning, subclassOf, subtypeOf, toBytecode, toBytecode, toClass, toClass, toClass, toString, writeFile, writeFile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

isPrimitive

public boolean isPrimitive()
Returns true if this object represents a primitive Java type: boolean, byte, char, short, int, long, float, double, or void.

Overrides:
isPrimitive in class CtClass

getDescriptor

public char getDescriptor()
Returns the descriptor representing this type. For example, if the type is int, then the descriptor is I.


getWrapperName

public java.lang.String getWrapperName()
Returns the name of the wrapper class. For example, if the type is int, then the wrapper class is java.lang.Integer.


getGetMethodName

public java.lang.String getGetMethodName()
Returns the name of the method for retrieving the value from the wrapper object. For example, if the type is int, then the method name is intValue.


getGetMethodDescriptor

public java.lang.String getGetMethodDescriptor()
Returns the descriptor of the method for retrieving the value from the wrapper object. For example, if the type is int, then the method descriptor is ()I.


getReturnOp

public int getReturnOp()
Returns the opcode for returning a value of the type. For example, if the type is int, then the returned opcode is javassit.bytecode.Opcode.IRETURN.


getArrayType

public int getArrayType()
Returns the array-type code representing the type. It is used for the newarray instruction. For example, if the type is int, then this method returns javassit.bytecode.Opcode.T_INT.


getDataSize

public int getDataSize()
Returns the data size of the primitive type. If the type is long or double, this method returns 2. Otherwise, it returns 1.



Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.