X-Git-Url: http://git.megacz.com/?p=org.ibex.classgen.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fclassgen%2FMethodRef.java;h=75d58f3523f143bba58e39c8d7a91c8991f5d733;hp=c866adca9f3074ad72978285784aa96f36b4556f;hb=94cebd4c12247ae7fd0a4b0cc66609fead0efece;hpb=fb8a2dfe2f45b27710921562df968b86f2faceee diff --git a/src/org/ibex/classgen/MethodRef.java b/src/org/ibex/classgen/MethodRef.java index c866adc..75d58f3 100644 --- a/src/org/ibex/classgen/MethodRef.java +++ b/src/org/ibex/classgen/MethodRef.java @@ -1,9 +1,21 @@ package org.ibex.classgen; +/** This class represents Method references. It is used as an argument to the + INVOKESTATIC, INVOKEVIRTUAL, INVOKESPEICAL, and INVOKEINTERFACE bytecodes + @see CGConst#INVOKESTATIC + @see CGConst#INVOKEVIRTUAL + @see CGConst#INVOKESPECIAL + @see CGConst#INVOKEINTERFACE +*/ public class MethodRef extends ClassGen.FieldOrMethodRef { + /** Create a reference to method name of class c with the return type ret and the + arguments args */ public MethodRef(Type.Object c, String name, Type ret, Type[] args) { super(c,name,getDescriptor(ret,args)); } + /** Equivalent to MethodRef(new Type.Object(s),...) + @see #MethodRef(Type.Object,String,Type,Type[]) + */ public MethodRef(String s, String name, Type ret, Type[] args) { this(new Type.Object(s),name,ret,args); } @@ -18,6 +30,10 @@ public class MethodRef extends ClassGen.FieldOrMethodRef { return sb.toString(); } + /** MethodRef class used for the INVOKEINTERFACE bytecode. Although this contains the same + data as a normal MethodRef, these are treated differently in the byte code format. In general, + users don't need to be concerned with this though because MethodRef's are automatically converted + to MethodRef.I's when they are applied to an INVOKEINTERFACE bytecode */ public static class I extends MethodRef { public I(Type.Object c, String name, Type ret, Type[] args) { super(c,name,ret,args); } public I(String s, String name, Type ret, Type[] args) { super(s,name,ret,args); }