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, writeFileCtArray(java.lang.String name,
ClassPool cp)
public ClassPool getClassPool()
CtClassClassPool for this class.getClassPool in class CtClasspublic boolean isArray()
CtClasstrue if this object represents an array type.public int getModifiers()
CtClassjavassist.Modifier.
If the class is a static nested class (a.k.a. static inner class),
the returned modifiers include Modifier.STATIC.
getModifiers in class CtClassModifierpublic CtClass[] getInterfaces() throws NotFoundException
CtClassgetInterfaces in class CtClassNotFoundExceptionpublic boolean subtypeOf(CtClass clazz) throws NotFoundException
CtClasstrue if this class extends or implements
clazz. It also returns true if
this class is the same as clazz.subtypeOf in class CtClassNotFoundExceptionpublic CtClass getComponentType() throws NotFoundException
CtClassnull.getComponentType in class CtClassNotFoundExceptionpublic CtClass getSuperclass() throws NotFoundException
CtClassjava.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 CtClassNotFoundExceptionpublic CtMethod[] getMethods()
CtClassCtMethod objects
representing all the non-private methods of the class.
That array includes non-private methods inherited from the
superclasses.getMethods in class CtClasspublic CtMethod getMethod(java.lang.String name, java.lang.String desc) throws NotFoundException
CtClassgetMethod in class CtClassname - method namedesc - method descriptorNotFoundExceptionCtBehavior.getSignature(),
Descriptorpublic CtConstructor[] getConstructors()
CtClassCtConstructor objects
representing all the non-private constructors of the class.getConstructors in class CtClass