public class ProgramClass extends SimpleFeatureNamedProcessable implements Clazz
Clazz is a complete representation of the data in a Java class.| Modifier and Type | Field and Description |
|---|---|
Attribute[] |
attributes |
Constant[] |
constantPool |
ProgramField[] |
fields |
KotlinMetadata |
kotlinMetadata |
ProgramMethod[] |
methods |
int |
subClassCount |
Clazz[] |
subClasses
An extra field pointing to the subclasses of this class.
|
int |
u2accessFlags |
int |
u2attributesCount |
int |
u2constantPoolCount |
int |
u2fieldsCount |
int[] |
u2interfaces |
int |
u2interfacesCount |
int |
u2methodsCount |
int |
u2superClass |
int |
u2thisClass |
int |
u4version |
featureNameprocessingFlags, processingInfo| Constructor and Description |
|---|
ProgramClass()
Creates an uninitialized ProgramClass.
|
ProgramClass(int u4version,
int u2constantPoolCount,
Constant[] constantPool,
int u2accessFlags,
int u2thisClass,
int u2superClass)
Creates an initialized ProgramClass without fields, methods, attributes,
or subclasses.
|
ProgramClass(int u4version,
int u2constantPoolCount,
Constant[] constantPool,
int u2accessFlags,
int u2thisClass,
int u2superClass,
int u2interfacesCount,
int[] u2interfaces,
int u2fieldsCount,
ProgramField[] fields,
int u2methodsCount,
ProgramMethod[] methods,
int u2attributesCount,
Attribute[] attributes,
int subClassCount,
Clazz[] subClasses)
Creates an initialized ProgramClass.
|
ProgramClass(int u4version,
int u2constantPoolCount,
Constant[] constantPool,
int u2accessFlags,
int u2thisClass,
int u2superClass,
int u2interfacesCount,
int[] u2interfaces,
int u2fieldsCount,
ProgramField[] fields,
int u2methodsCount,
ProgramMethod[] methods,
int u2attributesCount,
Attribute[] attributes,
int subClassCount,
Clazz[] subClasses,
java.lang.String featureName,
int processingFlags,
java.lang.Object processingInfo)
Creates an initialized ProgramClass.
|
ProgramClass(int u4version,
int u2constantPoolCount,
Constant[] constantPool,
int u2accessFlags,
int u2thisClass,
int u2superClass,
java.lang.String featureName,
int processingFlags,
java.lang.Object processingInfo)
Creates an initialized ProgramClass without fields, methods, attributes,
or subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(ClassVisitor classVisitor)
Accepts the given class visitor.
|
void |
addSubClass(Clazz clazz)
Notifies this Clazz that it is being subclassed by another class.
|
void |
attributeAccept(java.lang.String name,
AttributeVisitor attributeVisitor)
Lets the given attribute info visitor visit the specified attribute.
|
void |
attributesAccept(AttributeVisitor attributeVisitor)
Lets the given attribute info visitor visit all attributes of this class.
|
void |
constantPoolEntriesAccept(ConstantVisitor constantVisitor)
Lets the given constant pool entry visitor visit all constant pool entries
of this class.
|
void |
constantPoolEntryAccept(int index,
ConstantVisitor constantVisitor)
Lets the given constant pool entry visitor visit the constant pool entry
at the specified index.
|
boolean |
extends_(Clazz clazz)
Returns whether this class extends the given class.
|
boolean |
extends_(java.lang.String className)
Returns whether this class extends the specified class.
|
boolean |
extendsOrImplements(Clazz clazz)
Returns whether this class implements the given class.
|
boolean |
extendsOrImplements(java.lang.String className)
Returns whether this class implements the specified class.
|
void |
fieldAccept(java.lang.String name,
java.lang.String descriptor,
MemberVisitor memberVisitor)
Lets the given member info visitor visit the specified field.
|
void |
fieldsAccept(MemberVisitor memberVisitor)
Lets the given member info visitor visit all fields of this class.
|
Field |
findField(java.lang.String name,
java.lang.String descriptor)
Returns the field with the given name and descriptor.
|
Method |
findMethod(java.lang.String name,
java.lang.String descriptor)
Returns the method with the given name and descriptor.
|
int |
getAccessFlags()
Returns the access flags of this class.
|
java.lang.String |
getClassName(int constantIndex)
Returns the class name of ClassConstant at the specified index.
|
Constant |
getConstant(int constantIndex)
Returns the Constant at the given index in the constant pool.
|
Clazz |
getInterface(int index)
Returns the interface at the given index.
|
int |
getInterfaceCount()
Returns the number of interfaces that this class implements.
|
java.lang.String |
getInterfaceName(int index)
Returns the full internal name of the interface at the given index of
this class.
|
java.lang.String |
getModuleName(int constantIndex)
Returns the name of the ModuleConstant at the specified index.
|
java.lang.String |
getName()
Returns the full internal name of this class.
|
java.lang.String |
getName(int constantIndex)
Returns the name of the NameAndTypeConstant at the specified index.
|
java.lang.String |
getPackageName(int constantIndex)
Returns the name of the PackageConstant at the specified index.
|
java.lang.String |
getRefClassName(int constantIndex)
Returns the class name of the RefConstant at the specified index.
|
java.lang.String |
getRefName(int constantIndex)
Returns the name of the RefConstant at the specified index.
|
java.lang.String |
getRefType(int constantIndex)
Returns the type of the RefConstant at the specified index.
|
java.lang.String |
getString(int constantIndex)
Returns the String value of the Utf8Constant at the specified index.
|
java.lang.String |
getStringString(int constantIndex)
Returns the String value of the StringConstant at the specified index.
|
Clazz |
getSuperClass()
Returns the super class of this class.
|
java.lang.String |
getSuperName()
Returns the full internal name of the super class of this class, or
null if this class represents java.lang.Object.
|
int |
getTag(int constantIndex)
Returns the tag value of the Constant at the specified index.
|
java.lang.String |
getType(int constantIndex)
Returns the type of the NameAndTypeConstant at the specified index.
|
void |
hierarchyAccept(boolean visitThisClass,
boolean visitSuperClass,
boolean visitInterfaces,
boolean visitSubclasses,
ClassVisitor classVisitor)
Accepts the given class visitor in the class hierarchy.
|
void |
interfaceConstantsAccept(ConstantVisitor constantVisitor)
Lets the given constant pool entry visitor visit the class constant pool
entries for all interfaces of this class.
|
void |
kotlinMetadataAccept(KotlinMetadataVisitor kotlinMetadataVisitor)
Lets the given Kotlin metadata visitor visit the metadata of this class.
|
boolean |
mayHaveImplementations(Method method)
Returns whether the given method may possibly have implementing or
overriding methods down the class hierarchy.
|
void |
methodAccept(java.lang.String name,
java.lang.String descriptor,
MemberVisitor memberVisitor)
Lets the given member info visitor visit the specified method.
|
void |
methodsAccept(MemberVisitor memberVisitor)
Lets the given member info visitor visit all methods of this class.
|
void |
removeSubClass(Clazz clazz)
Notifies this Clazz that it is no longer being subclassed by another
class.
|
void |
subclassesAccept(ClassVisitor classVisitor)
Lets the given class visitor visit all known subclasses.
|
void |
superClassConstantAccept(ConstantVisitor constantVisitor)
Lets the given constant pool entry visitor visit the class constant pool
entry of the super class of this class, if there is one.
|
void |
thisClassConstantAccept(ConstantVisitor constantVisitor)
Lets the given constant pool entry visitor visit the class constant pool
entry of this class.
|
java.lang.String |
toString() |
getFeatureName, setFeatureNamegetProcessingFlags, getProcessingInfo, setProcessingFlags, setProcessingInfoclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetFeatureName, setFeatureNamegetProcessingFlags, getProcessingInfo, setProcessingFlags, setProcessingInfopublic int u4version
public int u2constantPoolCount
public Constant[] constantPool
public int u2accessFlags
public int u2thisClass
public int u2superClass
public int u2interfacesCount
public int[] u2interfaces
public int u2fieldsCount
public ProgramField[] fields
public int u2methodsCount
public ProgramMethod[] methods
public int u2attributesCount
public Attribute[] attributes
public KotlinMetadata kotlinMetadata
public Clazz[] subClasses
ClassSubHierarchyInitializer.public int subClassCount
public ProgramClass()
public ProgramClass(int u4version,
int u2constantPoolCount,
Constant[] constantPool,
int u2accessFlags,
int u2thisClass,
int u2superClass)
public ProgramClass(int u4version,
int u2constantPoolCount,
Constant[] constantPool,
int u2accessFlags,
int u2thisClass,
int u2superClass,
java.lang.String featureName,
int processingFlags,
java.lang.Object processingInfo)
public ProgramClass(int u4version,
int u2constantPoolCount,
Constant[] constantPool,
int u2accessFlags,
int u2thisClass,
int u2superClass,
int u2interfacesCount,
int[] u2interfaces,
int u2fieldsCount,
ProgramField[] fields,
int u2methodsCount,
ProgramMethod[] methods,
int u2attributesCount,
Attribute[] attributes,
int subClassCount,
Clazz[] subClasses)
public ProgramClass(int u4version,
int u2constantPoolCount,
Constant[] constantPool,
int u2accessFlags,
int u2thisClass,
int u2superClass,
int u2interfacesCount,
int[] u2interfaces,
int u2fieldsCount,
ProgramField[] fields,
int u2methodsCount,
ProgramMethod[] methods,
int u2attributesCount,
Attribute[] attributes,
int subClassCount,
Clazz[] subClasses,
java.lang.String featureName,
int processingFlags,
java.lang.Object processingInfo)
public Constant getConstant(int constantIndex)
public int getAccessFlags()
ClazzgetAccessFlags in interface ClazzClassConstantspublic java.lang.String getName()
Clazzpublic java.lang.String getSuperName()
ClazzgetSuperName in interface Clazzpublic int getInterfaceCount()
ClazzgetInterfaceCount in interface Clazzpublic java.lang.String getInterfaceName(int index)
ClazzgetInterfaceName in interface Clazzpublic int getTag(int constantIndex)
Clazzpublic java.lang.String getString(int constantIndex)
Clazzpublic java.lang.String getStringString(int constantIndex)
ClazzgetStringString in interface Clazzpublic java.lang.String getClassName(int constantIndex)
ClazzgetClassName in interface Clazzpublic java.lang.String getName(int constantIndex)
Clazzpublic java.lang.String getType(int constantIndex)
Clazzpublic java.lang.String getRefClassName(int constantIndex)
ClazzgetRefClassName in interface Clazzpublic java.lang.String getRefName(int constantIndex)
ClazzgetRefName in interface Clazzpublic java.lang.String getRefType(int constantIndex)
ClazzgetRefType in interface Clazzpublic java.lang.String getModuleName(int constantIndex)
ClazzgetModuleName in interface Clazzpublic java.lang.String getPackageName(int constantIndex)
ClazzgetPackageName in interface Clazzpublic void addSubClass(Clazz clazz)
ClazzaddSubClass in interface Clazzpublic void removeSubClass(Clazz clazz)
ClazzremoveSubClass in interface Clazzpublic Clazz getSuperClass()
ClazzgetSuperClass in interface Clazzpublic Clazz getInterface(int index)
ClazzgetInterface in interface Clazzpublic boolean extends_(Clazz clazz)
Clazzpublic boolean extends_(java.lang.String className)
Clazzpublic boolean extendsOrImplements(Clazz clazz)
ClazzextendsOrImplements in interface Clazzpublic boolean extendsOrImplements(java.lang.String className)
ClazzextendsOrImplements in interface Clazzpublic Field findField(java.lang.String name, java.lang.String descriptor)
Clazzpublic Method findMethod(java.lang.String name, java.lang.String descriptor)
ClazzfindMethod in interface Clazzname - the method name, or null if it is irrelevant.descriptor - the method descriptor, or null if it is irrelevant.public void accept(ClassVisitor classVisitor)
Clazzpublic void hierarchyAccept(boolean visitThisClass,
boolean visitSuperClass,
boolean visitInterfaces,
boolean visitSubclasses,
ClassVisitor classVisitor)
ClazzhierarchyAccept in interface ClazzvisitThisClass - specifies whether to visit this class.visitSuperClass - specifies whether to visit the super classes.visitInterfaces - specifies whether to visit the interfaces.visitSubclasses - specifies whether to visit the subclasses.classVisitor - the ClassVisitor that will
visit the class hierarchy.public void subclassesAccept(ClassVisitor classVisitor)
ClazzsubclassesAccept in interface ClazzclassVisitor - the ClassVisitor that will visit the
subclasses.public void constantPoolEntriesAccept(ConstantVisitor constantVisitor)
ClazzconstantPoolEntriesAccept in interface Clazzpublic void constantPoolEntryAccept(int index,
ConstantVisitor constantVisitor)
ClazzconstantPoolEntryAccept in interface Clazzpublic void thisClassConstantAccept(ConstantVisitor constantVisitor)
ClazzthisClassConstantAccept in interface Clazzpublic void superClassConstantAccept(ConstantVisitor constantVisitor)
ClazzsuperClassConstantAccept in interface Clazzpublic void interfaceConstantsAccept(ConstantVisitor constantVisitor)
ClazzinterfaceConstantsAccept in interface Clazzpublic void fieldsAccept(MemberVisitor memberVisitor)
ClazzfieldsAccept in interface Clazzpublic void fieldAccept(java.lang.String name,
java.lang.String descriptor,
MemberVisitor memberVisitor)
ClazzfieldAccept in interface Clazzpublic void methodsAccept(MemberVisitor memberVisitor)
ClazzmethodsAccept in interface Clazzpublic void methodAccept(java.lang.String name,
java.lang.String descriptor,
MemberVisitor memberVisitor)
ClazzmethodAccept in interface Clazzpublic boolean mayHaveImplementations(Method method)
ClazzmayHaveImplementations in interface Clazzmethod - the method that may have implementations.public void attributesAccept(AttributeVisitor attributeVisitor)
ClazzattributesAccept in interface Clazzpublic void attributeAccept(java.lang.String name,
AttributeVisitor attributeVisitor)
ClazzattributeAccept in interface Clazzpublic void kotlinMetadataAccept(KotlinMetadataVisitor kotlinMetadataVisitor)
ClazzkotlinMetadataAccept in interface Clazzpublic java.lang.String toString()
toString in class java.lang.Object