jreversepro.parser
Class JAttribute

java.lang.Object
  extended by jreversepro.parser.JAttribute

public final class JAttribute
extends java.lang.Object

JAttribute has the ability to read the 'ATTRIBUTES' of the Field , Method and the Class as a whole.

Version:
1.00,
Author:
Karthik Kumar

Field Summary
static java.lang.String CODE
          Code attribute of a Method.
static java.lang.String CONSTANT_VALUE
          ConstantValue attribute of a Method.
static java.lang.String DEPRECATED
          Deprecated attribute of a Method.
static java.lang.String EXCEPTIONS
          Exceptions attribute of a Method.
static java.lang.String LINENUMBERTABLE
          LineNumberTable attribute of a Method.
static java.lang.String LOCALVARIABLETABLE
          LocalVariableTable attribute of a Method.
static java.lang.String SOURCEFILE
          SourceFile attribute of a Method.
static java.lang.String SYNTHETIC
          Synthetic attribute of a Method.
 
Constructor Summary
JAttribute()
           
 
Method Summary
static void manipCode(java.io.DataInputStream aDis, JMethod aLocalMethod, JConstantPool aCpInfo)
          Manipulates the 'Code' attribute of the Methods.
static java.lang.String manipConstantValue(java.io.DataInputStream aDis, JConstantPool aCpInfo)
          Manipulates the 'ConstantValue' attribute of the Fields.
static void manipDeprecated(java.io.DataInputStream aDis)
          Manipulates the 'Deprecated' attribute of the Fields.
static java.util.List<java.lang.String> manipExceptions(java.io.DataInputStream aDis, JConstantPool aCpInfo)
          Manipulates the Exceptions attribute.
static java.lang.String manipSourceFile(java.io.DataInputStream aDis, JConstantPool aCpInfo)
          Manipulates the 'SourceFile' attribute of the Fields.
static void manipSynthetic(java.io.DataInputStream aDis)
          Manipulates the 'Synthetic' attribute of the Fields.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONSTANT_VALUE

public static final java.lang.String CONSTANT_VALUE
ConstantValue attribute of a Method.

See Also:
Constant Field Values

DEPRECATED

public static final java.lang.String DEPRECATED
Deprecated attribute of a Method.

See Also:
Constant Field Values

SYNTHETIC

public static final java.lang.String SYNTHETIC
Synthetic attribute of a Method.

See Also:
Constant Field Values

CODE

public static final java.lang.String CODE
Code attribute of a Method.

See Also:
Constant Field Values

EXCEPTIONS

public static final java.lang.String EXCEPTIONS
Exceptions attribute of a Method.

See Also:
Constant Field Values

LINENUMBERTABLE

public static final java.lang.String LINENUMBERTABLE
LineNumberTable attribute of a Method.

See Also:
Constant Field Values

LOCALVARIABLETABLE

public static final java.lang.String LOCALVARIABLETABLE
LocalVariableTable attribute of a Method.

See Also:
Constant Field Values

SOURCEFILE

public static final java.lang.String SOURCEFILE
SourceFile attribute of a Method.

See Also:
Constant Field Values
Constructor Detail

JAttribute

public JAttribute()
Method Detail

manipConstantValue

public static java.lang.String manipConstantValue(java.io.DataInputStream aDis,
                                                  JConstantPool aCpInfo)
                                           throws java.io.IOException
Manipulates the 'ConstantValue' attribute of the Fields.

ConstantValue attribute
u2 attribute_name_index;
u4 attribute_length;
u2 constantvalue_index;

Parameters:
aDis - DataInputStream containing the bytes of the class.
aCpInfo - ConstantPool Information.
Returns:
a String containing the Constant value, of the field.
Throws:
java.io.IOException - Error in Class Stream of bytes.

manipDeprecated

public static void manipDeprecated(java.io.DataInputStream aDis)
                            throws java.io.IOException
Manipulates the 'Deprecated' attribute of the Fields.

Deprecated attribute
u2 attribute_name_index;
u4 attribute_length;

Parameters:
aDis - DataInputStream containing the bytes of the class.
Throws:
java.io.IOException - Error in Class Stream of bytes.

manipSynthetic

public static void manipSynthetic(java.io.DataInputStream aDis)
                           throws java.io.IOException
Manipulates the 'Synthetic' attribute of the Fields.

Synthetic attribute
u2 attribute_name_index;
u4 attribute_length;

Parameters:
aDis - DataInputStream containing the bytes of the class.
Throws:
java.io.IOException - Error in Class Stream of bytes.

manipCode

public static void manipCode(java.io.DataInputStream aDis,
                             JMethod aLocalMethod,
                             JConstantPool aCpInfo)
                      throws java.io.IOException
Manipulates the 'Code' attribute of the Methods.

Code attribute
u2 attribute_name_index;
u4 attribute_length;
u2 max_stack;
u2 max_locals;
u4 code_length;
u1 code[code_length];
u2 exception_table_length;
{
u2 start_pc; u2 end_pc; u2 handler_pc; u2 catch_type;
} exception_table[exception_table_length];
u2 attributes_count;
attribute_info attributes[attributes_count];

Parameters:
aDis - DataInputStream containing the bytes of the class.
aCpInfo - ConstantPool Information.
aLocalMethod - Reference to the current method for which the code is to be manipulated.
Throws:
java.io.IOException - Error in Class Stream of bytes.

manipSourceFile

public static java.lang.String manipSourceFile(java.io.DataInputStream aDis,
                                               JConstantPool aCpInfo)
                                        throws java.io.IOException
Manipulates the 'SourceFile' attribute of the Fields.

SourceFile attribute
u2 attribute_name_index;
u4 attribute_length;
u2 sourcefile_index;

Parameters:
aDis - DataInputStream containing the bytes of the class.
aCpInfo - ConstantPool Information.
Returns:
NO_STRING
Throws:
java.io.IOException - Error in Class Stream of bytes.

manipExceptions

public static java.util.List<java.lang.String> manipExceptions(java.io.DataInputStream aDis,
                                                               JConstantPool aCpInfo)
                                                        throws java.io.IOException
Manipulates the Exceptions attribute.

Exceptions_attribute
u2 attribute_name_index;
u4 attribute_length;
u2 number_of_exceptions;
u2 exception_index_table[number_of_exceptions];
Present , if there is a throws clause in the declaration of the method.

Parameters:
aDis - DataInputStream containing the bytes of the class.
aCpInfo - ConstantPool Information.
Returns:
Set of classes present in the 'throws' clause statement.
Throws:
java.io.IOException - Error in Class Stream of bytes.


Submit Feedback to akkumar@users.sourceforge.net