| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private Attribute[] | |
| private static final int | |
| private int | |
| private ConstantPool | |
| private DataInputStream | |
| private Field[] | |
| private final String | |
| private final boolean | |
| private int[] | |
| private final boolean | |
| private int | |
| private Method[] | |
| private int | |
| private int | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | ClassParser(final InputStream
Input stream inputStream, final String File name fileName)Parses class from the given stream. |
| public | |
| public | ClassParser(final String
ZIP file name zipFile, final String file name fileName)Parses class from given .class file in a ZIP-archive |
| Modifier and Type | Method and Description |
|---|---|
| public JavaClass | Returns: Class object representing the parsed class fileParses the given Java class file and return an object that represents the contained data, i.e., constants, methods, fields and commands. |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private void |
| accessFlags | back to summary |
|---|---|
| private int accessFlags | |
| attributes | back to summary |
|---|---|
| private Attribute[] attributes | |
| BUFSIZE | back to summary |
|---|---|
| private static final int BUFSIZE | |
| classNameIndex | back to summary |
|---|---|
| private int classNameIndex | |
| constantPool | back to summary |
|---|---|
| private ConstantPool constantPool | |
| dataInputStream | back to summary |
|---|---|
| private DataInputStream dataInputStream | |
| fields | back to summary |
|---|---|
| private Field[] fields | |
| fileName | back to summary |
|---|---|
| private final String fileName | |
| fileOwned | back to summary |
|---|---|
| private final boolean fileOwned | |
| interfaces | back to summary |
|---|---|
| private int[] interfaces | |
| isZip | back to summary |
|---|---|
| private final boolean isZip | |
| major | back to summary |
|---|---|
| private int major | |
| methods | back to summary |
|---|---|
| private Method[] methods | |
| minor | back to summary |
|---|---|
| private int minor | |
| superclassNameIndex | back to summary |
|---|---|
| private int superclassNameIndex | |
| zipFile | back to summary |
|---|---|
| private String zipFile | |
| ClassParser | back to summary |
|---|---|
| public ClassParser(final InputStream inputStream, final String fileName) Parses class from the given stream.
| |
| ClassParser | back to summary |
|---|---|
| public ClassParser(final String fileName) Parses class from given .class file.
| |
| ClassParser | back to summary |
|---|---|
| public ClassParser(final String zipFile, final String fileName) Parses class from given .class file in a ZIP-archive | |
| parse | back to summary |
|---|---|
| public JavaClass parse() throws IOException, ClassFormatException Parses the given Java class file and return an object that represents the contained data, i.e., constants, methods, fields and commands. A ClassFormatException is raised, if the file is not a valid .class file. (This does not include verification of the byte code as it is performed by the Java interpreter).
| |
| readAttributes | back to summary |
|---|---|
| private void readAttributes() throws IOException, ClassFormatException Reads information about the attributes of the class.
| |
| readClassInfo | back to summary |
|---|---|
| private void readClassInfo() throws IOException, ClassFormatException Reads information about the class and its super class.
| |
| readConstantPool | back to summary |
|---|---|
| private void readConstantPool() throws IOException, ClassFormatException Reads constant pool entries.
| |
| readFields | back to summary |
|---|---|
| private void readFields() throws IOException, ClassFormatException Reads information about the fields of the class, i.e., its variables.
| |
| readID | back to summary |
|---|---|
| private void readID() throws IOException, ClassFormatException Checks whether the header of the file is ok. Of course, this has to be the first action on successive file reads.
| |
| readInterfaces | back to summary |
|---|---|
| private void readInterfaces() throws IOException, ClassFormatException Reads information about the interfaces implemented by this class.
| |
| readMethods | back to summary |
|---|---|
| private void readMethods() throws IOException Reads information about the methods of the class.
| |
| readVersion | back to summary |
|---|---|
| private void readVersion() throws IOException, ClassFormatException Reads major and minor version of compiler which created the file.
| |