"

2013 FRC Java API

"

com.sun.squawk
Class ClassFileMethod

java.lang.Object
  extended by com.sun.squawk.ClassFileMember
      extended by com.sun.squawk.ClassFileMethod

public final class ClassFileMethod
extends ClassFileMember

An instance of ClassFileMethod encapsulates all the symbolic information of a method declaration in a class file. This class is provided for a subsystem (such as the translator) that loads a class definition from a class file.


Field Summary
static ClassFileMethod[] NO_METHODS
          A zero-length array of ClassFileMethods.
 
Constructor Summary
ClassFileMethod(String name, int modifiers, Klass returnType, Klass[] parameterTypes, int pragmas)
          Creates a new ClassFileMethod instance.
 
Method Summary
 byte[] getCode()
          Gets the byte array corresponding to the "Code" attribute in the class file.
 Klass[] getParameterTypes()
          Gets the parameter types of this method.
 int getPragmas()
          Gets the pragmas that apply to the method
 Klass getReturnType()
          Gets the return type of this method.
 boolean isAbstract()
          Determines if this is a abstract method.
 boolean isClinit()
          Determines if this method is .
 boolean isDefaultConstructor()
          Determines if this method is .
 boolean isMain()
          Determines if this method is a static void main(String[]).
 boolean isNative()
          Determines if this is a native method.
 boolean isProtected()
          Determines if this is a protected method.
 void setCode(byte[] code)
          Sets the byte array corresponding to the "Code" attribute in the class file.
 
Methods inherited from class com.sun.squawk.ClassFileMember
getFullyQualifiedName, getModifiers, getName, isStatic
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_METHODS

public static final ClassFileMethod[] NO_METHODS
A zero-length array of ClassFileMethods.

Constructor Detail

ClassFileMethod

public ClassFileMethod(String name,
                       int modifiers,
                       Klass returnType,
                       Klass[] parameterTypes,
                       int pragmas)
Creates a new ClassFileMethod instance.

Parameters:
name - the name of the method
modifiers - the modifiers of the method
returnType - the return type of the method
parameterTypes - the parameters types of the method
pragmas - a mask of values denoting the pragmas (if any) that apply to the method
Method Detail

getReturnType

public Klass getReturnType()
Gets the return type of this method.

Returns:
the return type of this method

getParameterTypes

public Klass[] getParameterTypes()
Gets the parameter types of this method.

Returns:
the parameter types of this method

getCode

public byte[] getCode()
Gets the byte array corresponding to the "Code" attribute in the class file. This can only be called for a non-native, non-abstract method.

Returns:
the data in the "Code" attribute for this method

setCode

public void setCode(byte[] code)
Sets the byte array corresponding to the "Code" attribute in the class file. This can only be called for a non-native, non-abstract method.

Parameters:
code - the data in the "Code" attribute for this method

getPragmas

public int getPragmas()
Gets the pragmas that apply to the method

Returns:
a mask of the constants defined in PragmaException

isNative

public boolean isNative()
Determines if this is a native method.

Returns:
true if this is a native method

isAbstract

public boolean isAbstract()
Determines if this is a abstract method.

Returns:
true if this is a abstract method

isProtected

public boolean isProtected()
Determines if this is a protected method.

Returns:
true if this is a protected method

isDefaultConstructor

public boolean isDefaultConstructor()
Determines if this method is .

Returns:
true if it is

isClinit

public boolean isClinit()
Determines if this method is .

Returns:
true if it is

isMain

public boolean isMain()
Determines if this method is a static void main(String[]).

Returns:
true if it is

"

2013 FRC Java API

"

"
For updated information see the Java FRC site
"