Package de.ufinke.cubaja.cafebabe
Class GenMethod
- java.lang.Object
-
- de.ufinke.cubaja.cafebabe.GenMethod
-
- All Implemented Interfaces:
AccessFlags
public class GenMethod extends Object implements AccessFlags
Wrapper for a generated method. An instance is created byGenClass.createMethod(int, de.ufinke.cubaja.cafebabe.Type, java.lang.String, de.ufinke.cubaja.cafebabe.Type...)orGenClass.createConstructor(int, de.ufinke.cubaja.cafebabe.Type...).- Author:
- Uwe Finke
-
-
Field Summary
-
Fields inherited from interface de.ufinke.cubaja.cafebabe.AccessFlags
ACC_ABSTRACT, ACC_ANNOTATION, ACC_BRIDGE, ACC_ENUM, ACC_FINAL, ACC_INTERFACE, ACC_NATIVE, ACC_PRIVATE, ACC_PROTECTED, ACC_PUBLIC, ACC_STATIC, ACC_STRICT, ACC_SUPER, ACC_SYNCHRONIZED, ACC_SYNTHETIC, ACC_TRANSIENT, ACC_VARARGS, ACC_VOLATILE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddException(Type exception)Adds an exception.voidcreateGenericBridge(Type genericReturnType, Type... genericArgs)Creates a bridge method which calls this method.voidgenerate(DataOutputStream out)CodeAttributegetCode()Gives access to the methods code.
-
-
-
Method Detail
-
getCode
public CodeAttribute getCode()
Gives access to the methods code.- Returns:
- code attribute
-
addException
public void addException(Type exception)
Adds an exception. This corresponds to an entry in thethrowsclause of the method.- Parameters:
exception- an exception type
-
createGenericBridge
public void createGenericBridge(Type genericReturnType, Type... genericArgs)
Creates a bridge method which calls this method. The bridge method is added to the class. In a bridge method, the generic arguments are casted to the argument types of the original method.- Parameters:
genericReturnType- casted return typegenericArgs- casted argument types
-
generate
public void generate(DataOutputStream out) throws Exception
- Throws:
Exception
-
-