Package javassist
Class CtPrimitiveType
java.lang.Object
javassist.CtClass
javassist.CtPrimitiveType
An instance of
CtPrimitiveType represents a primitive type.
It is obtained from CtClass.-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionintReturns the array-type code representing the type.intReturns the data size of the primitive type.charReturns the descriptor representing this type.Returns the descriptor of the method for retrieving the value from the wrapper object.Returns the name of the method for retrieving the value from the wrapper object.intReturns the modifiers for this type.intReturns the opcode for returning a value of the type.Returns the name of the wrapper class.booleanReturnstrueif 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, debugWriteFile, defrost, detach, freeze, getAccessorMaker, getAnnotation, getAnnotations, getAttribute, getAvailableAnnotations, getClassFile, getClassFile2, getClassInitializer, getClassPool, getComponentType, getConstructor, getConstructors, getDeclaredBehaviors, getDeclaredClasses, getDeclaredConstructor, getDeclaredConstructors, getDeclaredField, getDeclaredField, getDeclaredFields, getDeclaredMethod, getDeclaredMethod, getDeclaredMethods, getDeclaredMethods, getDeclaringClass, getEnclosingBehavior, getEnclosingMethod, getField, getField, getFields, getGenericSignature, getInterfaces, getMethod, getMethods, getName, getNestedClasses, getPackageName, getRefClasses, getSimpleName, getSuperclass, getURL, hasAnnotation, hasAnnotation, instrument, instrument, isAnnotation, isArray, isEnum, isFrozen, isInterface, isKotlin, isModified, main, makeClassInitializer, makeNestedClass, makeUniqueName, prune, rebuildClassFile, removeConstructor, removeField, removeMethod, replaceClassName, replaceClassName, setAttribute, setGenericSignature, setInterfaces, setModifiers, setName, setSuperclass, stopPruning, subclassOf, subtypeOf, toBytecode, toBytecode, toClass, toClass, toClass, toClass, toClass, toString, writeFile, writeFile
-
Method Details
-
isPrimitive
public boolean isPrimitive()Returnstrueif this object represents a primitive Java type: boolean, byte, char, short, int, long, float, double, or void.- Overrides:
isPrimitivein classCtClass
-
getModifiers
public int getModifiers()Returns the modifiers for this type. For decoding, usejavassist.Modifier.- Overrides:
getModifiersin classCtClass- See Also:
-
getDescriptor
public char getDescriptor()Returns the descriptor representing this type. For example, if the type is int, then the descriptor is I. -
getWrapperName
Returns the name of the wrapper class. For example, if the type is int, then the wrapper class isjava.lang.Integer. -
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 isintValue. -
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 isjavassit.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 returnsjavassit.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.
-