public boolean equals(Object o) { if (o == null) return false; if (!(o instanceof MethodInfo)) return false; return getSignature().equals(((MethodInfo)o).getSignature()); }
public Signature getImplSignature(MethodInfo method) { return rename(method.getSignature(), ((Integer)positions.get(method)).intValue()); } public void emitLoadArgsAndInvoke(CodeEmitter e, MethodInfo method) {
public boolean equals(Object o) { if (o == null) return false; if (!(o instanceof MethodInfo)) return false; return getSignature().equals(((MethodInfo)o).getSignature()); }
public Type[] getParameterTypes(MethodInfo member) { Type[] types = (Type[])cache.get(member); if (types == null) { cache.put(member, types = member.getSignature().getArgumentTypes()); } return types; } };
public String toString() { // TODO: include modifiers, exceptions return getSignature().toString(); } }
public Object transform(Object value) { return ((MethodInfo)value).getSignature().getName(); } });
public static boolean isConstructor(MethodInfo method) { return method.getSignature().getName().equals(Constants.CONSTRUCTOR_NAME); }
public int hashCode() { return getSignature().hashCode(); }
public Type[] getParameterTypes(MethodInfo member) { Type[] types = (Type[])cache.get(member); if (types == null) { cache.put(member, types = member.getSignature().getArgumentTypes()); } return types; } };
public static CodeEmitter begin_method(ClassEmitter e, MethodInfo method, int access) { return e.begin_method(access, method.getSignature(), method.getExceptionTypes()); } }
public AddInitTransformer(Method method) { info = ReflectUtils.getMethodInfo(method); Type[] types = info.getSignature().getArgumentTypes(); if (types.length != 1 || !types[0].equals(Constants.TYPE_OBJECT) || !info.getSignature().getReturnType().equals(Type.VOID_TYPE)) { throw new IllegalArgumentException(method + " illegal signature"); } }
public static CodeEmitter begin_method(ClassEmitter e, MethodInfo method, int access) { return e.begin_method(access, method.getSignature(), method.getExceptionTypes()); } }
public AddStaticInitTransformer(Method classInit) { info = ReflectUtils.getMethodInfo(classInit); if (!TypeUtils.isStatic(info.getModifiers())) { throw new IllegalArgumentException(classInit + " is not static"); } Type[] types = info.getSignature().getArgumentTypes(); if (types.length != 1 || !types[0].equals(Constants.TYPE_CLASS) || !info.getSignature().getReturnType().equals(Type.VOID_TYPE)) { throw new IllegalArgumentException(classInit + " illegal signature"); } }
public void processCase(Object key, Label end) { PropertyDescriptor pd = (PropertyDescriptor)getters.get(key); MethodInfo method = ReflectUtils.getMethodInfo(pd.getReadMethod()); e.invoke(method); e.box(method.getSignature().getReturnType()); e.return_value(); } public void processDefault() {
public AddStaticInitTransformer(Method classInit) { info = ReflectUtils.getMethodInfo(classInit); if (!TypeUtils.isStatic(info.getModifiers())) { throw new IllegalArgumentException(classInit + " is not static"); } Type[] types = info.getSignature().getArgumentTypes(); if (types.length != 1 || !types[0].equals(Constants.TYPE_CLASS) || !info.getSignature().getReturnType().equals(Type.VOID_TYPE)) { throw new IllegalArgumentException(classInit + " illegal signature"); } }
public void processCase(Object key, Label end) { PropertyDescriptor pd = (PropertyDescriptor)getters.get(key); MethodInfo method = ReflectUtils.getMethodInfo(pd.getReadMethod()); e.invoke(method); e.box(method.getSignature().getReturnType()); e.return_value(); } public void processDefault() {
public void processCase(Object key, Label end) { MethodInfo constructor = (MethodInfo)key; Type types[] = constructor.getSignature().getArgumentTypes(); for (int i = 0; i < types.length; i++) { e.load_arg(1); e.push(i); e.aaload(); e.unbox(types[i]); } e.invoke_constructor(thisType, constructor.getSignature()); e.goTo(end); } public void processDefault() {
public static void load_method(CodeEmitter e, MethodInfo method) { load_class(e, method.getClassInfo().getType()); e.push(method.getSignature().getName()); push_object(e, method.getSignature().getArgumentTypes()); e.invoke_virtual(Constants.TYPE_CLASS, GET_DECLARED_METHOD); }
public static void load_method(CodeEmitter e, MethodInfo method) { load_class(e, method.getClassInfo().getType()); e.push(method.getSignature().getName()); push_object(e, method.getSignature().getArgumentTypes()); e.invoke_virtual(Constants.TYPE_CLASS, GET_DECLARED_METHOD); }
public void invoke(MethodInfo method, Type virtualType) { ClassInfo classInfo = method.getClassInfo(); Type type = classInfo.getType(); Signature sig = method.getSignature(); if (sig.getName().equals(Constants.CONSTRUCTOR_NAME)) { invoke_constructor(type, sig); } else if (TypeUtils.isInterface(classInfo.getModifiers())) { invoke_interface(type, sig); } else if (TypeUtils.isStatic(method.getModifiers())) { invoke_static(type, sig); } else { invoke_virtual(virtualType, sig); } }