javassist

Class CtPrimitiveType

public final class CtPrimitiveType extends CtClass

An instance of CtPrimitiveType represents a primitive type. It is obtained from CtClass.
Method Summary
intgetArrayType()
Returns the array-type code representing the type.
intgetDataSize()
Returns the data size of the primitive type.
chargetDescriptor()
Returns the descriptor representing this type.
StringgetGetMethodDescriptor()
Returns the descriptor of the method for retrieving the value from the wrapper object.
StringgetGetMethodName()
Returns the name of the method for retrieving the value from the wrapper object.
intgetReturnOp()
Returns the opcode for returning a value of the type.
StringgetWrapperName()
Returns the name of the wrapper class.
booleanisPrimitive()
Returns true if this object represents a primitive Java type: boolean, byte, char, short, int, long, float, double, or void.

Method Detail

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.

getDescriptor

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

getGetMethodDescriptor

public 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.

getGetMethodName

public 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.

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.

getWrapperName

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

isPrimitive

public boolean isPrimitive()
Returns true if this object represents a primitive Java type: boolean, byte, char, short, int, long, float, double, or void.
Javassist, a Java-bytecode translator toolkit.
Copyright (C) 1999-2006 Shigeru Chiba. All Rights Reserved.