ProGuard

proguard.classfile
Interface ClassFile

All Superinterfaces:
VisitorAccepter
All Known Implementing Classes:
LibraryClassFile, ProgramClassFile

public interface ClassFile
extends VisitorAccepter

This interface provides access to the data in a Java class file (*.class).


Method Summary
 void accept(ClassFileVisitor classFileVisitor)
          Accepts the given class file visitor.
 void addSubClass(ClassFile classFile)
          Notifies this ClassFile that it is being subclassed by another class.
 void attributesAccept(AttrInfoVisitor attrInfoVisitor)
          Lets the given attribute info visitor visit all attributes of this class.
 void constantPoolEntriesAccept(CpInfoVisitor cpInfoVisitor)
          Lets the given constant pool entry visitor visit all constant pool entries of this class.
 void constantPoolEntryAccept(CpInfoVisitor cpInfoVisitor, int index)
          Lets the given constant pool entry visitor visit the constant pool entry at the specified index.
 boolean extends_(ClassFile classFile)
          Returns whether this class extends the given class.
 void fieldAccept(MemberInfoVisitor memberInfoVisitor, String name, String descriptor)
          Lets the given member info visitor visit the specified field.
 void fieldsAccept(MemberInfoVisitor memberInfoVisitor)
          Lets the given member info visitor visit all fields of this class.
 FieldInfo findField(String name, String descriptor)
          Returns the field with the given name and descriptor.
 MethodInfo findMethod(String name, String descriptor)
          Returns the method with the given name and descriptor.
 int getAccessFlags()
          Returns the access flags of this class.
 String getCpClassNameString(int cpIndex)
          Returns the class name of ClassCpEntry at the specified index.
 String getCpNameString(int cpIndex)
          Returns the name of the NameAndTypeCpEntry at the specified index.
 String getCpString(int cpIndex)
          Returns the String value of the StringCpEntry at the specified index.
 int getCpTag(int cpIndex)
          Returns the tag value of the CpEntry at the specified index.
 String getCpTypeString(int cpIndex)
          Returns the type of the NameAndTypeCpEntry at the specified index.
 ClassFile getInterface(int index)
          Returns the interface at the given index.
 String getInterfaceName(int index)
          Returns the full internal name of the interface at the given index of this class.
 String getName()
          Returns the full internal name of this class.
 ClassFile getSuperClass()
          Returns the super class of this class.
 String getSuperName()
          Returns the full internal name of the super class of this class, or null if this class represents java.lang.Object.
 void hierarchyAccept(boolean visitThisClass, boolean visitSuperClass, boolean visitInterfaces, boolean visitSubclasses, ClassFileVisitor classFileVisitor)
          Accepts the given class file visitor in the class hierarchy.
 boolean implements_(ClassFile classFile)
          Returns whether this class implements the given class.
 void methodAccept(MemberInfoVisitor memberInfoVisitor, String name, String descriptor)
          Lets the given member info visitor visit the specified method.
 void methodsAccept(MemberInfoVisitor memberInfoVisitor)
          Lets the given member info visitor visit all methods of this class.
 
Methods inherited from interface proguard.classfile.VisitorAccepter
getVisitorInfo, setVisitorInfo
 

Method Detail

getAccessFlags

public int getAccessFlags()
Returns the access flags of this class.

See Also:
ClassConstants

getName

public String getName()
Returns the full internal name of this class.


getSuperName

public String getSuperName()
Returns the full internal name of the super class of this class, or null if this class represents java.lang.Object.


getInterfaceName

public String getInterfaceName(int index)
Returns the full internal name of the interface at the given index of this class.


getCpTag

public int getCpTag(int cpIndex)
Returns the tag value of the CpEntry at the specified index.


getCpString

public String getCpString(int cpIndex)
Returns the String value of the StringCpEntry at the specified index.


getCpClassNameString

public String getCpClassNameString(int cpIndex)
Returns the class name of ClassCpEntry at the specified index.


getCpNameString

public String getCpNameString(int cpIndex)
Returns the name of the NameAndTypeCpEntry at the specified index.


getCpTypeString

public String getCpTypeString(int cpIndex)
Returns the type of the NameAndTypeCpEntry at the specified index.


addSubClass

public void addSubClass(ClassFile classFile)
Notifies this ClassFile that it is being subclassed by another class.


getSuperClass

public ClassFile getSuperClass()
Returns the super class of this class.


getInterface

public ClassFile getInterface(int index)
Returns the interface at the given index.


extends_

public boolean extends_(ClassFile classFile)
Returns 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.


implements_

public boolean implements_(ClassFile classFile)
Returns whether this class implements the given class. A class is always considered to implement itself. Interfaces are considered to implement all their superinterfaces.


findField

public FieldInfo findField(String name,
                           String descriptor)
Returns the field with the given name and descriptor.


findMethod

public MethodInfo findMethod(String name,
                             String descriptor)
Returns the method with the given name and descriptor.


accept

public void accept(ClassFileVisitor classFileVisitor)
Accepts the given class file visitor.


hierarchyAccept

public void hierarchyAccept(boolean visitThisClass,
                            boolean visitSuperClass,
                            boolean visitInterfaces,
                            boolean visitSubclasses,
                            ClassFileVisitor classFileVisitor)
Accepts the given class file visitor in the class hierarchy.

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.
classFileVisitor - the ClassFileVisitor that will visit the class hierarchy.

constantPoolEntriesAccept

public void constantPoolEntriesAccept(CpInfoVisitor cpInfoVisitor)
Lets the given constant pool entry visitor visit all constant pool entries of this class.


constantPoolEntryAccept

public void constantPoolEntryAccept(CpInfoVisitor cpInfoVisitor,
                                    int index)
Lets the given constant pool entry visitor visit the constant pool entry at the specified index.


fieldsAccept

public void fieldsAccept(MemberInfoVisitor memberInfoVisitor)
Lets the given member info visitor visit all fields of this class.


fieldAccept

public void fieldAccept(MemberInfoVisitor memberInfoVisitor,
                        String name,
                        String descriptor)
Lets the given member info visitor visit the specified field.


methodsAccept

public void methodsAccept(MemberInfoVisitor memberInfoVisitor)
Lets the given member info visitor visit all methods of this class.


methodAccept

public void methodAccept(MemberInfoVisitor memberInfoVisitor,
                         String name,
                         String descriptor)
Lets the given member info visitor visit the specified method.


attributesAccept

public void attributesAccept(AttrInfoVisitor attrInfoVisitor)
Lets the given attribute info visitor visit all attributes of this class.


ProGuard