com.caucho.bytecode
Class CodeAttribute

java.lang.Object
  extended by com.caucho.bytecode.Attribute
      extended by com.caucho.bytecode.CodeAttribute
Direct Known Subclasses:
CodeWriterAttribute

public class CodeAttribute
extends Attribute

Represents a generic attribute


Nested Class Summary
static class CodeAttribute.ExceptionItem
           
static class CodeAttribute.ExportAnalyzer
           
 
Constructor Summary
CodeAttribute()
           
 
Method Summary
 void addAttribute(Attribute attr)
          Adds an attribute.
 void addException(ClassConstant type, int start, int end, int handler)
          Returns the exceptions.
 Attribute export(JavaClass source, JavaClass target)
          Clones the attribute
 void exportCode(JavaClass source, JavaClass target)
          Exports code.
 java.util.ArrayList<Attribute> getAttributes()
          Returns the exceptions.
 byte[] getCode()
          Gets the code value.
 java.util.ArrayList<CodeAttribute.ExceptionItem> getExceptions()
          Returns the exceptions.
 JavaClass getJavaClass()
           
 int getMaxLocals()
          Returns the max locals.
 int getMaxStack()
          Returns the max stack.
 void read(ByteCodeParser in)
          Writes the field to the output.
 Attribute removeAttribute(java.lang.String name)
          Removes an attribute.
 void setAttributes(java.util.ArrayList<Attribute> attributes)
          Returns the exceptions.
 void setCode(byte[] code)
          Sets the code value.
 void setJavaClass(JavaClass jClass)
           
 void setMaxLocals(int max)
          Sets the max locals.
 void setMaxStack(int max)
          Sets the max stack.
 java.lang.String toString()
           
 void write(ByteCodeWriter out)
          Writes the field to the output.
 
Methods inherited from class com.caucho.bytecode.Attribute
addConstants, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CodeAttribute

public CodeAttribute()
Method Detail

setJavaClass

public void setJavaClass(JavaClass jClass)

getJavaClass

public JavaClass getJavaClass()

getMaxLocals

public int getMaxLocals()
Returns the max locals.


setMaxLocals

public void setMaxLocals(int max)
Sets the max locals.


getMaxStack

public int getMaxStack()
Returns the max stack.


setMaxStack

public void setMaxStack(int max)
Sets the max stack.


setCode

public void setCode(byte[] code)
Sets the code value.


getCode

public byte[] getCode()
Gets the code value.


addAttribute

public void addAttribute(Attribute attr)
Adds an attribute.


getAttributes

public java.util.ArrayList<Attribute> getAttributes()
Returns the exceptions.


setAttributes

public void setAttributes(java.util.ArrayList<Attribute> attributes)
Returns the exceptions.


removeAttribute

public Attribute removeAttribute(java.lang.String name)
Removes an attribute.


getExceptions

public java.util.ArrayList<CodeAttribute.ExceptionItem> getExceptions()
Returns the exceptions.


addException

public void addException(ClassConstant type,
                         int start,
                         int end,
                         int handler)
Returns the exceptions.


read

public void read(ByteCodeParser in)
          throws java.io.IOException
Writes the field to the output.

Throws:
java.io.IOException

write

public void write(ByteCodeWriter out)
           throws java.io.IOException
Writes the field to the output.

Specified by:
write in class Attribute
Throws:
java.io.IOException

export

public Attribute export(JavaClass source,
                        JavaClass target)
Clones the attribute

Overrides:
export in class Attribute

exportCode

public void exportCode(JavaClass source,
                       JavaClass target)
                throws java.lang.Exception
Exports code.

Throws:
java.lang.Exception

toString

public java.lang.String toString()
Overrides:
toString in class Attribute