|
ProGuard | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectproguard.classfile.ProgramClassFile
This is a complete representation of the data in a Java class file. A ClassFile instance can be generated using the static create(DataInput) method, manipulated using various operators, and persisted back using the write(DataOutput) method.
| Field Summary | |
AttrInfo[] |
attributes
|
CpInfo[] |
constantPool
|
ProgramFieldInfo[] |
fields
|
ProgramMethodInfo[] |
methods
|
ClassFile[] |
subClasses
An extra field pointing to the subclasses of this class. |
int |
u2accessFlags
|
int |
u2attributesCount
|
int |
u2constantPoolCount
|
int |
u2fieldsCount
|
int[] |
u2interfaces
|
int |
u2interfacesCount
|
int |
u2majorVersion
|
int |
u2methodsCount
|
int |
u2minorVersion
|
int |
u2superClass
|
int |
u2thisClass
|
int |
u4magic
|
Object |
visitorInfo
An extra field in which visitors can store information. |
| 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. |
static ClassFile |
create(DataInput din)
Creates a new ClassFile from the class file format data in the DataInput stream. |
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. |
CpInfo |
getCpEntry(int cpIndex)
Returns the CpInfo at the given index in the constant pool. |
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. |
Object |
getVisitorInfo()
Gets the visitor information of the visitor accepter. |
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. |
void |
setVisitorInfo(Object visitorInfo)
Sets the visitor information of the visitor accepter. |
void |
write(DataOutput dout)
Exports the representation to a DataOutput stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public int u4magic
public int u2minorVersion
public int u2majorVersion
public int u2constantPoolCount
public CpInfo[] constantPool
public int u2accessFlags
public int u2thisClass
public int u2superClass
public int u2interfacesCount
public int[] u2interfaces
public int u2fieldsCount
public ProgramFieldInfo[] fields
public int u2methodsCount
public ProgramMethodInfo[] methods
public int u2attributesCount
public AttrInfo[] attributes
public ClassFile[] subClasses
ClassFileReferenceInitializer.
public Object visitorInfo
| Method Detail |
public static ClassFile create(DataInput din)
throws IOException
IOException - if class file is corrupt or incompletepublic CpInfo getCpEntry(int cpIndex)
public void write(DataOutput dout)
throws IOException
IOExceptionpublic int getAccessFlags()
ClassFile
getAccessFlags in interface ClassFileClassConstantspublic String getName()
ClassFile
getName in interface ClassFilepublic String getSuperName()
ClassFile
getSuperName in interface ClassFilepublic String getInterfaceName(int index)
ClassFile
getInterfaceName in interface ClassFilepublic int getCpTag(int cpIndex)
ClassFile
getCpTag in interface ClassFilepublic String getCpString(int cpIndex)
ClassFile
getCpString in interface ClassFilepublic String getCpClassNameString(int cpIndex)
ClassFile
getCpClassNameString in interface ClassFilepublic String getCpNameString(int cpIndex)
ClassFile
getCpNameString in interface ClassFilepublic String getCpTypeString(int cpIndex)
ClassFile
getCpTypeString in interface ClassFilepublic void addSubClass(ClassFile classFile)
ClassFile
addSubClass in interface ClassFilepublic ClassFile getSuperClass()
ClassFile
getSuperClass in interface ClassFilepublic ClassFile getInterface(int index)
ClassFile
getInterface in interface ClassFilepublic boolean extends_(ClassFile classFile)
ClassFile
extends_ in interface ClassFilepublic boolean implements_(ClassFile classFile)
ClassFile
implements_ in interface ClassFile
public FieldInfo findField(String name,
String descriptor)
ClassFile
findField in interface ClassFile
public MethodInfo findMethod(String name,
String descriptor)
ClassFile
findMethod in interface ClassFilepublic void accept(ClassFileVisitor classFileVisitor)
ClassFile
accept in interface ClassFile
public void hierarchyAccept(boolean visitThisClass,
boolean visitSuperClass,
boolean visitInterfaces,
boolean visitSubclasses,
ClassFileVisitor classFileVisitor)
ClassFile
hierarchyAccept in interface ClassFilevisitThisClass - 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.public void constantPoolEntriesAccept(CpInfoVisitor cpInfoVisitor)
ClassFile
constantPoolEntriesAccept in interface ClassFile
public void constantPoolEntryAccept(CpInfoVisitor cpInfoVisitor,
int index)
ClassFile
constantPoolEntryAccept in interface ClassFilepublic void fieldsAccept(MemberInfoVisitor memberInfoVisitor)
ClassFile
fieldsAccept in interface ClassFile
public void fieldAccept(MemberInfoVisitor memberInfoVisitor,
String name,
String descriptor)
ClassFile
fieldAccept in interface ClassFilepublic void methodsAccept(MemberInfoVisitor memberInfoVisitor)
ClassFile
methodsAccept in interface ClassFile
public void methodAccept(MemberInfoVisitor memberInfoVisitor,
String name,
String descriptor)
ClassFile
methodAccept in interface ClassFilepublic void attributesAccept(AttrInfoVisitor attrInfoVisitor)
ClassFile
attributesAccept in interface ClassFilepublic Object getVisitorInfo()
VisitorAccepter
getVisitorInfo in interface VisitorAccepterpublic void setVisitorInfo(Object visitorInfo)
VisitorAccepter
setVisitorInfo in interface VisitorAccepter
|
ProGuard | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||