Package javassist
Class CtArray
- java.lang.Object
-
- javassist.CtClass
-
- javassist.CtArray
-
final class CtArray extends CtClass
Array types.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javassist.CtClass
CtClass.DelayedFileOutputStream
-
-
Field Summary
Fields Modifier and Type Field Description private CtClass[]
interfaces
protected ClassPool
pool
-
Fields inherited from class javassist.CtClass
booleanType, byteType, charType, debugDump, doubleType, floatType, intType, javaLangObject, longType, primitiveTypes, qualifiedName, shortType, version, voidType
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassPool
getClassPool()
Returns aClassPool
for this class.CtClass
getComponentType()
If this object represents an array, this method returns the component type of the array.CtConstructor[]
getConstructors()
Returns an array containingCtConstructor
objects representing all the non-private constructors of the class.CtClass[]
getInterfaces()
Obtains the class objects representing the interfaces implemented by the class or, if this object represents an interface, the interfaces extended by that interface.CtMethod
getMethod(java.lang.String name, java.lang.String desc)
Returns the method with the given name and signature.CtMethod[]
getMethods()
Returns an array containingCtMethod
objects representing all the non-private methods of the class.int
getModifiers()
Returns the modifiers for this class, encoded in an integer.CtClass
getSuperclass()
Obtains the class object representing the superclass of the class.boolean
isArray()
Returnstrue
if this object represents an array type.boolean
subtypeOf(CtClass clazz)
Returnstrue
if this class extends or implementsclazz
.-
Methods inherited from class javassist.CtClass
addConstructor, addField, addField, addField, addInterface, addMethod, checkModify, compress, debugWriteFile, debugWriteFile, defrost, detach, extendToString, freeze, getAccessorMaker, getAnnotation, getAnnotations, getAttribute, getAvailableAnnotations, getClassFile, getClassFile2, getClassInitializer, getConstructor, getDeclaredBehaviors, getDeclaredClasses, getDeclaredConstructor, getDeclaredConstructors, getDeclaredField, getDeclaredField, getDeclaredFields, getDeclaredMethod, getDeclaredMethod, getDeclaredMethods, getDeclaredMethods, getDeclaringClass, getEnclosingBehavior, getEnclosingMethod, getField, getField, getField2, getFields, getGenericSignature, getName, getNestedClasses, getPackageName, getRefClasses, getSimpleName, getURL, hasAnnotation, hasAnnotation, incGetCounter, instrument, instrument, isAnnotation, isEnum, isFrozen, isInterface, isModified, isPrimitive, main, makeClassInitializer, makeFileOutput, makeNestedClass, makeUniqueName, prune, rebuildClassFile, removeConstructor, removeField, removeMethod, replaceClassName, replaceClassName, setAttribute, setGenericSignature, setInterfaces, setModifiers, setName, setSuperclass, stopPruning, subclassOf, toBytecode, toBytecode, toClass, toClass, toClass, toString, writeFile, writeFile
-
-
-
-
Constructor Detail
-
CtArray
CtArray(java.lang.String name, ClassPool cp)
-
-
Method Detail
-
getClassPool
public ClassPool getClassPool()
Description copied from class:CtClass
Returns aClassPool
for this class.- Overrides:
getClassPool
in classCtClass
-
isArray
public boolean isArray()
Description copied from class:CtClass
Returnstrue
if this object represents an array type.
-
getModifiers
public int getModifiers()
Description copied from class:CtClass
Returns the modifiers for this class, encoded in an integer. For decoding, usejavassist.Modifier
.If the class is a static nested class (a.k.a. static inner class), the returned modifiers include
Modifier.STATIC
.- Overrides:
getModifiers
in classCtClass
- See Also:
Modifier
-
getInterfaces
public CtClass[] getInterfaces() throws NotFoundException
Description copied from class:CtClass
Obtains the class objects representing the interfaces implemented by the class or, if this object represents an interface, the interfaces extended by that interface.- Overrides:
getInterfaces
in classCtClass
- Throws:
NotFoundException
-
subtypeOf
public boolean subtypeOf(CtClass clazz) throws NotFoundException
Description copied from class:CtClass
Returnstrue
if this class extends or implementsclazz
. It also returnstrue
if this class is the same asclazz
.- Overrides:
subtypeOf
in classCtClass
- Throws:
NotFoundException
-
getComponentType
public CtClass getComponentType() throws NotFoundException
Description copied from class:CtClass
If this object represents an array, this method returns the component type of the array. Otherwise, it returnsnull
.- Overrides:
getComponentType
in classCtClass
- Throws:
NotFoundException
-
getSuperclass
public CtClass getSuperclass() throws NotFoundException
Description copied from class:CtClass
Obtains the class object representing the superclass of the class. It returns null if this object represents thejava.lang.Object
class and thus it does not have the super class.If this object represents an interface, this method always returns the
java.lang.Object
class. To obtain the super interfaces extended by that interface, callgetInterfaces()
.- Overrides:
getSuperclass
in classCtClass
- Throws:
NotFoundException
-
getMethods
public CtMethod[] getMethods()
Description copied from class:CtClass
Returns an array containingCtMethod
objects representing all the non-private methods of the class. That array includes non-private methods inherited from the superclasses.- Overrides:
getMethods
in classCtClass
-
getMethod
public CtMethod getMethod(java.lang.String name, java.lang.String desc) throws NotFoundException
Description copied from class:CtClass
Returns the method with the given name and signature. The returned method may be declared in a super class. The method signature is represented by a character string called method descriptor, which is defined in the JVM specification.- Overrides:
getMethod
in classCtClass
- Parameters:
name
- method namedesc
- method descriptor- Throws:
NotFoundException
- See Also:
CtBehavior.getSignature()
,Descriptor
-
getConstructors
public CtConstructor[] getConstructors()
Description copied from class:CtClass
Returns an array containingCtConstructor
objects representing all the non-private constructors of the class.- Overrides:
getConstructors
in classCtClass
-
-