final class CtArray extends CtClass
CtClass.DelayedFileOutputStream
Modifier and Type | Field and Description |
---|---|
private CtClass[] |
interfaces |
protected ClassPool |
pool |
booleanType, byteType, charType, debugDump, doubleType, floatType, intType, javaLangObject, longType, primitiveTypes, qualifiedName, shortType, version, voidType
Constructor and Description |
---|
CtArray(java.lang.String name,
ClassPool cp) |
Modifier and Type | Method and Description |
---|---|
ClassPool |
getClassPool()
Returns a
ClassPool 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 containing
CtConstructor 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 containing
CtMethod 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()
Returns
true if this object represents an array type. |
boolean |
subtypeOf(CtClass clazz)
Returns
true if this class extends or implements
clazz . |
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, getDeclaringClass, getEnclosingMethod, getField, getField, getField2, getFields, getGenericSignature, getName, getNestedClasses, getPackageName, getRefClasses, getSimpleName, getURL, 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
CtArray(java.lang.String name, ClassPool cp)
public ClassPool getClassPool()
CtClass
ClassPool
for this class.getClassPool
in class CtClass
public boolean isArray()
CtClass
true
if this object represents an array type.public int getModifiers()
CtClass
javassist.Modifier
.
If the class is a static nested class (a.k.a. static inner class),
the returned modifiers include Modifier.STATIC
.
getModifiers
in class CtClass
Modifier
public CtClass[] getInterfaces() throws NotFoundException
CtClass
getInterfaces
in class CtClass
NotFoundException
public boolean subtypeOf(CtClass clazz) throws NotFoundException
CtClass
true
if this class extends or implements
clazz
. It also returns true
if
this class is the same as clazz
.subtypeOf
in class CtClass
NotFoundException
public CtClass getComponentType() throws NotFoundException
CtClass
null
.getComponentType
in class CtClass
NotFoundException
public CtClass getSuperclass() throws NotFoundException
CtClass
java.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, call getInterfaces()
.
getSuperclass
in class CtClass
NotFoundException
public CtMethod[] getMethods()
CtClass
CtMethod
objects
representing all the non-private methods of the class.
That array includes non-private methods inherited from the
superclasses.getMethods
in class CtClass
public CtMethod getMethod(java.lang.String name, java.lang.String desc) throws NotFoundException
CtClass
getMethod
in class CtClass
name
- method namedesc
- method descriptorNotFoundException
CtBehavior.getSignature()
,
Descriptor
public CtConstructor[] getConstructors()
CtClass
CtConstructor
objects
representing all the non-private constructors of the class.getConstructors
in class CtClass