Package de.inetsoftware.classparser
Class Code
java.lang.Object
de.inetsoftware.classparser.Code
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Attributes
private final byte[]
private final ConstantPool
private final TryCatchFinally[]
private LineNumberTable
private LocalVariableTable
private final int
private final int
private static final TryCatchFinally[]
-
Constructor Summary
ConstructorsConstructorDescriptionCode
(DataInputStream input, ConstantPool constantPool) The code of a method attribute. -
Method Summary
Modifier and TypeMethodDescriptionGet the stream of Java Byte code instruction of this method.int
Get the last position of the code.Get the constant pool of this code.Get exception table of this code block.int
Get the line number table.Get the local variable table of this method.private static TryCatchFinally[]
readExceptionTable
(DataInputStream input, ConstantPool constantPool) Read the exception table and correct some problems.
-
Field Details
-
NO_TRY_CATCHES
-
constantPool
-
maxStack
private final int maxStack -
maxLocals
private final int maxLocals -
codeData
private final byte[] codeData -
exceptionTable
-
attributes
-
lineNumberTable
-
localVariableTable
-
-
Constructor Details
-
Code
Code(DataInputStream input, @Nonnull ConstantPool constantPool) throws IOException The code of a method attribute. http://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html#jvms-4.7.3 http://docs.oracle.com/javase/specs/jvms/se5.0/html/ClassFile.doc.html#1546- Parameters:
input
- the stream of the code attributeconstantPool
- the ConstantPool of the class- Throws:
IOException
- if an I/O error occurs
-
-
Method Details
-
readExceptionTable
private static TryCatchFinally[] readExceptionTable(DataInputStream input, @Nonnull ConstantPool constantPool) throws IOException Read the exception table and correct some problems.- Parameters:
input
- the stream of the code attributeconstantPool
- the ConstantPool of the class- Returns:
- the exception table
- Throws:
IOException
- if an I/O error occurs
-
getConstantPool
Get the constant pool of this code.- Returns:
- the ConstantPool of the class
-
getExceptionTable
Get exception table of this code block.- Returns:
- the table, can be empty
-
getLineNumberTable
Get the line number table. is null if the code was optimized.- Returns:
- the table or null
- Throws:
IOException
- if any I/O error occur
-
getLocalVariableTable
Get the local variable table of this method.- Returns:
- the variables
- Throws:
IOException
- if any I/O error occur
-
getFirstLineNr
- Throws:
IOException
-
getByteCode
Get the stream of Java Byte code instruction of this method.- Returns:
- the stream
-
getCodeSize
public int getCodeSize()Get the last position of the code.- Returns:
- the size.
-