Package proguard.classfile
Class ProgramClass
- java.lang.Object
 - 
- proguard.util.SimpleProcessable
 - 
- proguard.util.SimpleFeatureNamedProcessable
 - 
- proguard.classfile.ProgramClass
 
 
 
 
- 
- All Implemented Interfaces:
 java.io.Serializable,Clazz,FeatureNamed,Processable
public class ProgramClass extends SimpleFeatureNamedProcessable implements Clazz
ThisClazzis a complete representation of the data in a Java class.- See Also:
 - Serialized Form
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description Attribute[]attributesConstant[]constantPoolProgramField[]fieldsKotlinMetadatakotlinMetadataProgramMethod[]methodsintsubClassCountClazz[]subClassesAn extra field pointing to the subclasses of this class.intu2accessFlagsintu2attributesCountintu2constantPoolCountintu2fieldsCountint[]u2interfacesintu2interfacesCountintu2methodsCountintu2superClassintu2thisClassintu4version- 
Fields inherited from class proguard.util.SimpleFeatureNamedProcessable
extraFeatureNames, featureName 
- 
Fields inherited from class proguard.util.SimpleProcessable
processingFlags, processingInfo 
 - 
 
- 
Constructor Summary
Constructors Constructor 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. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(ClassVisitor classVisitor)Accepts the given class visitor.voidaddSubClass(Clazz clazz)Notifies this Clazz that it is being subclassed by another class.voidattributeAccept(java.lang.String name, AttributeVisitor attributeVisitor)Lets the given attribute info visitor visit the specified attribute.voidattributesAccept(AttributeVisitor attributeVisitor)Lets the given attribute info visitor visit all attributes of this class.voidconstantPoolEntriesAccept(ConstantVisitor constantVisitor)Lets the given constant pool entry visitor visit all constant pool entries of this class.voidconstantPoolEntryAccept(int index, ConstantVisitor constantVisitor)Lets the given constant pool entry visitor visit the constant pool entry at the specified index.booleanextends_(java.lang.String className)Returns whether this class extends the specified class.booleanextends_(Clazz clazz)Returns whether this class extends the given class.booleanextendsOrImplements(java.lang.String className)Returns whether this class implements the specified class.booleanextendsOrImplements(Clazz clazz)Returns whether this class implements the given class.voidfieldAccept(java.lang.String name, java.lang.String descriptor, MemberVisitor memberVisitor)Lets the given member info visitor visit the specified field.voidfieldsAccept(MemberVisitor memberVisitor)Lets the given member info visitor visit all fields of this class.FieldfindField(java.lang.String name, java.lang.String descriptor)Returns the field with the given name and descriptor.MethodfindMethod(java.lang.String name, java.lang.String descriptor)Returns the method with the given name and descriptor.intgetAccessFlags()Returns the access flags of this class.java.lang.StringgetClassName(int constantIndex)Returns the class name of ClassConstant at the specified index.ConstantgetConstant(int constantIndex)Returns the Constant at the given index in the constant pool.ClazzgetInterface(int index)Returns the interface at the given index.intgetInterfaceCount()Returns the number of interfaces that this class implements.java.lang.StringgetInterfaceName(int index)Returns the full internal name of the interface at the given index of this class.java.lang.StringgetModuleName(int constantIndex)Returns the name of the ModuleConstant at the specified index.java.lang.StringgetName()Returns the full internal name of this class.java.lang.StringgetName(int constantIndex)Returns the name of the NameAndTypeConstant at the specified index.java.lang.StringgetPackageName(int constantIndex)Returns the name of the PackageConstant at the specified index.java.lang.StringgetRefClassName(int constantIndex)Returns the class name of the RefConstant at the specified index.java.lang.StringgetRefName(int constantIndex)Returns the name of the RefConstant at the specified index.java.lang.StringgetRefType(int constantIndex)Returns the type of the RefConstant at the specified index.java.lang.StringgetString(int constantIndex)Returns the String value of the Utf8Constant at the specified index.java.lang.StringgetStringString(int constantIndex)Returns the String value of the StringConstant at the specified index.ClazzgetSuperClass()Returns the super class of this class.java.lang.StringgetSuperName()Returns the full internal name of the super class of this class, or null if this class represents java.lang.Object.intgetTag(int constantIndex)Returns the tag value of the Constant at the specified index.java.lang.StringgetType(int constantIndex)Returns the type of the NameAndTypeConstant at the specified index.voidhierarchyAccept(boolean visitThisClass, boolean visitSuperClass, boolean visitInterfaces, boolean visitSubclasses, ClassVisitor classVisitor)Accepts the given class visitor in the class hierarchy.voidinterfaceConstantsAccept(ConstantVisitor constantVisitor)Lets the given constant pool entry visitor visit the class constant pool entries for all interfaces of this class.voidkotlinMetadataAccept(KotlinMetadataVisitor kotlinMetadataVisitor)Lets the given Kotlin metadata visitor visit the metadata of this class.booleanmayHaveImplementations(Method method)Returns whether the given method may possibly have implementing or overriding methods down the class hierarchy.voidmethodAccept(java.lang.String name, java.lang.String descriptor, MemberVisitor memberVisitor)Lets the given member info visitor visit the specified method.voidmethodsAccept(MemberVisitor memberVisitor)Lets the given member info visitor visit all methods of this class.voidremoveSubClass(Clazz clazz)Notifies this Clazz that it is no longer being subclassed by another class.voidsubclassesAccept(ClassVisitor classVisitor)Lets the given class visitor visit all known subclasses.voidsuperClassConstantAccept(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.voidthisClassConstantAccept(ConstantVisitor constantVisitor)Lets the given constant pool entry visitor visit the class constant pool entry of this class.java.lang.StringtoString()- 
Methods inherited from class proguard.util.SimpleFeatureNamedProcessable
addExtraFeatureName, getExtraFeatureNames, getFeatureName, isInFeature, setFeatureName 
- 
Methods inherited from class proguard.util.SimpleProcessable
addProcessingFlags, getProcessingFlags, getProcessingInfo, hasProcessingFlags, removeProcessingFlags, setProcessingFlags, setProcessingInfo 
- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
- 
Methods inherited from interface proguard.util.FeatureNamed
addExtraFeatureName, getExtraFeatureNames, getFeatureName, isInFeature, setFeatureName 
- 
Methods inherited from interface proguard.util.Processable
getProcessingFlags, getProcessingInfo, setProcessingFlags, setProcessingInfo 
 - 
 
 - 
 
- 
- 
Field Detail
- 
u4version
public int u4version
 
- 
u2constantPoolCount
public int u2constantPoolCount
 
- 
constantPool
public Constant[] constantPool
 
- 
u2accessFlags
public int u2accessFlags
 
- 
u2thisClass
public int u2thisClass
 
- 
u2superClass
public int u2superClass
 
- 
u2interfacesCount
public int u2interfacesCount
 
- 
u2interfaces
public int[] u2interfaces
 
- 
u2fieldsCount
public int u2fieldsCount
 
- 
fields
public ProgramField[] fields
 
- 
u2methodsCount
public int u2methodsCount
 
- 
methods
public ProgramMethod[] methods
 
- 
u2attributesCount
public int u2attributesCount
 
- 
attributes
public Attribute[] attributes
 
- 
kotlinMetadata
public KotlinMetadata kotlinMetadata
 
- 
subClasses
public Clazz[] subClasses
An extra field pointing to the subclasses of this class. This field is typically filled out by theClassSubHierarchyInitializer. 
- 
subClassCount
public int subClassCount
 
 - 
 
- 
Constructor Detail
- 
ProgramClass
public ProgramClass()
Creates an uninitialized ProgramClass. 
- 
ProgramClass
public ProgramClass(int u4version, int u2constantPoolCount, Constant[] constantPool, int u2accessFlags, int u2thisClass, int u2superClass)Creates an initialized ProgramClass without fields, methods, attributes, or subclasses. 
- 
ProgramClass
public 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. 
- 
ProgramClass
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)Creates an initialized ProgramClass. 
- 
ProgramClass
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)Creates an initialized ProgramClass. 
 - 
 
- 
Method Detail
- 
getConstant
public Constant getConstant(int constantIndex)
Returns the Constant at the given index in the constant pool. 
- 
getAccessFlags
public int getAccessFlags()
Description copied from interface:ClazzReturns the access flags of this class.- Specified by:
 getAccessFlagsin interfaceClazz- See Also:
 ClassConstants
 
- 
getName
public java.lang.String getName()
Description copied from interface:ClazzReturns the full internal name of this class. 
- 
getSuperName
public java.lang.String getSuperName()
Description copied from interface:ClazzReturns the full internal name of the super class of this class, or null if this class represents java.lang.Object.- Specified by:
 getSuperNamein interfaceClazz
 
- 
getInterfaceCount
public int getInterfaceCount()
Description copied from interface:ClazzReturns the number of interfaces that this class implements.- Specified by:
 getInterfaceCountin interfaceClazz
 
- 
getInterfaceName
public java.lang.String getInterfaceName(int index)
Description copied from interface:ClazzReturns the full internal name of the interface at the given index of this class.- Specified by:
 getInterfaceNamein interfaceClazz
 
- 
getTag
public int getTag(int constantIndex)
Description copied from interface:ClazzReturns the tag value of the Constant at the specified index. 
- 
getString
public java.lang.String getString(int constantIndex)
Description copied from interface:ClazzReturns the String value of the Utf8Constant at the specified index. 
- 
getStringString
public java.lang.String getStringString(int constantIndex)
Description copied from interface:ClazzReturns the String value of the StringConstant at the specified index.- Specified by:
 getStringStringin interfaceClazz
 
- 
getClassName
public java.lang.String getClassName(int constantIndex)
Description copied from interface:ClazzReturns the class name of ClassConstant at the specified index.- Specified by:
 getClassNamein interfaceClazz
 
- 
getName
public java.lang.String getName(int constantIndex)
Description copied from interface:ClazzReturns the name of the NameAndTypeConstant at the specified index. 
- 
getType
public java.lang.String getType(int constantIndex)
Description copied from interface:ClazzReturns the type of the NameAndTypeConstant at the specified index. 
- 
getRefClassName
public java.lang.String getRefClassName(int constantIndex)
Description copied from interface:ClazzReturns the class name of the RefConstant at the specified index.- Specified by:
 getRefClassNamein interfaceClazz
 
- 
getRefName
public java.lang.String getRefName(int constantIndex)
Description copied from interface:ClazzReturns the name of the RefConstant at the specified index.- Specified by:
 getRefNamein interfaceClazz
 
- 
getRefType
public java.lang.String getRefType(int constantIndex)
Description copied from interface:ClazzReturns the type of the RefConstant at the specified index.- Specified by:
 getRefTypein interfaceClazz
 
- 
getModuleName
public java.lang.String getModuleName(int constantIndex)
Description copied from interface:ClazzReturns the name of the ModuleConstant at the specified index.- Specified by:
 getModuleNamein interfaceClazz
 
- 
getPackageName
public java.lang.String getPackageName(int constantIndex)
Description copied from interface:ClazzReturns the name of the PackageConstant at the specified index.- Specified by:
 getPackageNamein interfaceClazz
 
- 
addSubClass
public void addSubClass(Clazz clazz)
Description copied from interface:ClazzNotifies this Clazz that it is being subclassed by another class.- Specified by:
 addSubClassin interfaceClazz
 
- 
removeSubClass
public void removeSubClass(Clazz clazz)
Description copied from interface:ClazzNotifies this Clazz that it is no longer being subclassed by another class.- Specified by:
 removeSubClassin interfaceClazz
 
- 
getSuperClass
public Clazz getSuperClass()
Description copied from interface:ClazzReturns the super class of this class.- Specified by:
 getSuperClassin interfaceClazz
 
- 
getInterface
public Clazz getInterface(int index)
Description copied from interface:ClazzReturns the interface at the given index.- Specified by:
 getInterfacein interfaceClazz
 
- 
extends_
public boolean extends_(Clazz clazz)
Description copied from interface:ClazzReturns whether this class extends the given class. A class is always considered to extend itself. Interfaces are considered to only extend the root Object class. 
- 
extends_
public boolean extends_(java.lang.String className)
Description copied from interface:ClazzReturns whether this class extends the specified class. A class is always considered to extend itself. Interfaces are considered to only extend the root Object class. 
- 
extendsOrImplements
public boolean extendsOrImplements(Clazz clazz)
Description copied from interface:ClazzReturns whether this class implements the given class. A class is always considered to implement itself. Interfaces are considered to implement all their superinterfaces.- Specified by:
 extendsOrImplementsin interfaceClazz
 
- 
extendsOrImplements
public boolean extendsOrImplements(java.lang.String className)
Description copied from interface:ClazzReturns whether this class implements the specified class. A class is always considered to implement itself. Interfaces are considered to implement all their superinterfaces.- Specified by:
 extendsOrImplementsin interfaceClazz
 
- 
findField
public Field findField(java.lang.String name, java.lang.String descriptor)
Description copied from interface:ClazzReturns the field with the given name and descriptor. 
- 
findMethod
public Method findMethod(java.lang.String name, java.lang.String descriptor)
Description copied from interface:ClazzReturns the method with the given name and descriptor.- Specified by:
 findMethodin interfaceClazz- Parameters:
 name- the method name, or null if it is irrelevant.descriptor- the method descriptor, or null if it is irrelevant.- Returns:
 - the first matching method, or null there is no matching method.
 
 
- 
accept
public void accept(ClassVisitor classVisitor)
Description copied from interface:ClazzAccepts the given class visitor. 
- 
hierarchyAccept
public void hierarchyAccept(boolean visitThisClass, boolean visitSuperClass, boolean visitInterfaces, boolean visitSubclasses, ClassVisitor classVisitor)Description copied from interface:ClazzAccepts the given class visitor in the class hierarchy.- Specified by:
 hierarchyAcceptin interfaceClazz- Parameters:
 visitThisClass- 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- theClassVisitorthat will visit the class hierarchy.
 
- 
subclassesAccept
public void subclassesAccept(ClassVisitor classVisitor)
Description copied from interface:ClazzLets the given class visitor visit all known subclasses.- Specified by:
 subclassesAcceptin interfaceClazz- Parameters:
 classVisitor- theClassVisitorthat will visit the subclasses.
 
- 
constantPoolEntriesAccept
public void constantPoolEntriesAccept(ConstantVisitor constantVisitor)
Description copied from interface:ClazzLets the given constant pool entry visitor visit all constant pool entries of this class.- Specified by:
 constantPoolEntriesAcceptin interfaceClazz
 
- 
constantPoolEntryAccept
public void constantPoolEntryAccept(int index, ConstantVisitor constantVisitor)Description copied from interface:ClazzLets the given constant pool entry visitor visit the constant pool entry at the specified index.- Specified by:
 constantPoolEntryAcceptin interfaceClazz
 
- 
thisClassConstantAccept
public void thisClassConstantAccept(ConstantVisitor constantVisitor)
Description copied from interface:ClazzLets the given constant pool entry visitor visit the class constant pool entry of this class.- Specified by:
 thisClassConstantAcceptin interfaceClazz
 
- 
superClassConstantAccept
public void superClassConstantAccept(ConstantVisitor constantVisitor)
Description copied from interface:ClazzLets the given constant pool entry visitor visit the class constant pool entry of the super class of this class, if there is one.- Specified by:
 superClassConstantAcceptin interfaceClazz
 
- 
interfaceConstantsAccept
public void interfaceConstantsAccept(ConstantVisitor constantVisitor)
Description copied from interface:ClazzLets the given constant pool entry visitor visit the class constant pool entries for all interfaces of this class.- Specified by:
 interfaceConstantsAcceptin interfaceClazz
 
- 
fieldsAccept
public void fieldsAccept(MemberVisitor memberVisitor)
Description copied from interface:ClazzLets the given member info visitor visit all fields of this class.- Specified by:
 fieldsAcceptin interfaceClazz
 
- 
fieldAccept
public void fieldAccept(java.lang.String name, java.lang.String descriptor, MemberVisitor memberVisitor)Description copied from interface:ClazzLets the given member info visitor visit the specified field.- Specified by:
 fieldAcceptin interfaceClazz
 
- 
methodsAccept
public void methodsAccept(MemberVisitor memberVisitor)
Description copied from interface:ClazzLets the given member info visitor visit all methods of this class.- Specified by:
 methodsAcceptin interfaceClazz
 
- 
methodAccept
public void methodAccept(java.lang.String name, java.lang.String descriptor, MemberVisitor memberVisitor)Description copied from interface:ClazzLets the given member info visitor visit the specified method.- Specified by:
 methodAcceptin interfaceClazz
 
- 
mayHaveImplementations
public boolean mayHaveImplementations(Method method)
Description copied from interface:ClazzReturns whether the given method may possibly have implementing or overriding methods down the class hierarchy. This can only be true if the class is not final, and the method is not private, static, or final, or a constructor.- Specified by:
 mayHaveImplementationsin interfaceClazz- Parameters:
 method- the method that may have implementations.- Returns:
 - whether it may have implementations.
 
 
- 
attributesAccept
public void attributesAccept(AttributeVisitor attributeVisitor)
Description copied from interface:ClazzLets the given attribute info visitor visit all attributes of this class.- Specified by:
 attributesAcceptin interfaceClazz
 
- 
attributeAccept
public void attributeAccept(java.lang.String name, AttributeVisitor attributeVisitor)Description copied from interface:ClazzLets the given attribute info visitor visit the specified attribute.- Specified by:
 attributeAcceptin interfaceClazz
 
- 
kotlinMetadataAccept
public void kotlinMetadataAccept(KotlinMetadataVisitor kotlinMetadataVisitor)
Description copied from interface:ClazzLets the given Kotlin metadata visitor visit the metadata of this class.- Specified by:
 kotlinMetadataAcceptin interfaceClazz
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -