koala.dynamicjava.classfile
Class MethodInfo

java.lang.Object
  extended bykoala.dynamicjava.classfile.BytecodeComponent
      extended bykoala.dynamicjava.classfile.AttributeOwnerComponent
          extended bykoala.dynamicjava.classfile.MethodInfo

public class MethodInfo
extends AttributeOwnerComponent

This class allows the creation of JVM bytecode method format outputs


Field Summary
 
Fields inherited from class koala.dynamicjava.classfile.AttributeOwnerComponent
accessFlags, attributes
 
Fields inherited from class koala.dynamicjava.classfile.BytecodeComponent
constantPool, nameIndex
 
Constructor Summary
MethodInfo(ConstantPool cp, java.lang.String rt, java.lang.String nm, java.lang.String[] pt)
          Creates a new method info The type names must be fully qualified.
 
Method Summary
 CodeAttribute createCodeAttribute()
          Creates the code attribute for this method
 ExceptionsAttribute createExceptionsAttribute()
          Creates the exception attribute for this method
 boolean isAbstract()
          Tests if the method is abstract
 boolean isStatic()
          Tests if the method is static
 void setAbstract()
          Sets the abstract flag for this class
 void setFinal()
          Sets the final flag for this class
 void setNative()
          Sets the native flag for this class
 void setPrivate()
          Sets the private flag for this class
 void setProtected()
          Sets the protected flag for this class
 void setPublic()
          Sets the public flag for this class
 void setStatic()
          Sets the static flag for this class
 void setStrict()
          Sets the strict flag for this class
 void setSynchronized()
          Sets the synchronized flag for this class
 void write(java.io.DataOutputStream out)
          Writes the method info to the given output stream
 
Methods inherited from class koala.dynamicjava.classfile.AttributeOwnerComponent
setAccessFlags, setSyntheticAttribute
 
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

MethodInfo

public MethodInfo(ConstantPool cp,
                  java.lang.String rt,
                  java.lang.String nm,
                  java.lang.String[] pt)
Creates a new method info The type names must be fully qualified.

The following strings are valid class names:

Parameters:
cp - the constant pool where constants are stored
rt - the return type of this method
nm - the name of this method
pt - the parameters type names
Method Detail

write

public void write(java.io.DataOutputStream out)
           throws java.io.IOException
Writes the method info to the given output stream

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

isStatic

public boolean isStatic()
Tests if the method is static


isAbstract

public boolean isAbstract()
Tests if the method is abstract


setPublic

public void setPublic()
Sets the public flag for this class


setPrivate

public void setPrivate()
Sets the private flag for this class


setProtected

public void setProtected()
Sets the protected flag for this class


setStatic

public void setStatic()
Sets the static flag for this class


setFinal

public void setFinal()
Sets the final flag for this class


setSynchronized

public void setSynchronized()
Sets the synchronized flag for this class


setNative

public void setNative()
Sets the native flag for this class


setAbstract

public void setAbstract()
Sets the abstract flag for this class


setStrict

public void setStrict()
Sets the strict flag for this class


createExceptionsAttribute

public ExceptionsAttribute createExceptionsAttribute()
Creates the exception attribute for this method


createCodeAttribute

public CodeAttribute createCodeAttribute()
Creates the code attribute for this method



Copyright © 2001 Stephane Hillion. All Rights Reserved.