DynamicJava Javadoc: Class CodeAttribute

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## koala.dynamicjava.classfile
Class CodeAttribute

    java.lang.Object
      |
      +--koala.dynamicjava.classfile.BytecodeComponent
            |
            +--koala.dynamicjava.classfile.AttributeInfo
                  |
                  +--koala.dynamicjava.classfile.CodeAttribute

public class CodeAttribute
extends AttributeInfo

This class represents a method code attribute

Fields inherited from class koala.dynamicjava.classfile.AttributeInfo
`length`

Fields inherited from class koala.dynamicjava.classfile.BytecodeComponent
`constantPool, nameIndex`

Constructor Summary
`CodeAttribute(ConstantPool cp)` Creates a new empty (not valid) code attribute

Method Summary
`void` | `addExceptionTableEntry(short spc, short epc, short tpc, java.lang.String ex)` Adds an exception entry in the exception table
`void` | `setCode(byte[] code, short nl, short ms)` Sets the code for this code attribute
`void` | `write(java.io.DataOutputStream out)` Writes the code info to the given output stream.

Methods inherited from class koala.dynamicjava.classfile.BytecodeComponent
`getConstantPool, write`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### CodeAttribute

    public CodeAttribute(ConstantPool cp)

  Creates a new empty (not valid) code attribute
  Parameters:
    `cp` - the constant pool

Method Detail

### write

    public void write(java.io.DataOutputStream out)
               throws java.io.IOException

  Writes the code info to the given output stream.
  Overrides:
    `write` in class `BytecodeComponent`

### setCode

    public void setCode(byte[] code,
                        short nl,
                        short ms)

  Sets the code for this code attribute
  Parameters:
    `code` - the byte code array
    `nl` - the number of local variables
    `ms` - the max stack size

### addExceptionTableEntry

    public void addExceptionTableEntry(short spc,
                                       short epc,
                                       short tpc,
                                       java.lang.String ex)

  Adds an exception entry in the exception table
  Parameters:
    `spc` - the start of the try statement
    `epc` - the end of the try statement
    `tpc` - the handler position
    `ex` - the name of the exception

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Stephane Hillion. All Rights Reserved.