From 1b9c1c468f7b2178d9d7213dfd0a3e8a1da35cc1 Mon Sep 17 00:00:00 2001 From: jochen Date: Fri, 9 Apr 1999 07:58:54 +0000 Subject: [PATCH] getParameterClasses/getReturnClass MethodType(Class[], Class) git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@522 379699f6-c40d-0410-875b-85095c16579e --- jode/jode/type/MethodType.java | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/jode/jode/type/MethodType.java b/jode/jode/type/MethodType.java index 3e11e00..8d71d23 100644 --- a/jode/jode/type/MethodType.java +++ b/jode/jode/type/MethodType.java @@ -58,6 +58,20 @@ public class MethodType extends Type { returnType = Type.tType(signature.substring(index+1)); } + public MethodType(Class paramT[], Class returnT) { + super(TC_METHOD); + StringBuffer sig = new StringBuffer("("); + parameterTypes = new Type[paramT.length]; + for (int i=0; i< paramT.length; i++) { + parameterTypes[i] = Type.tType(paramT[i]); + sig.append(parameterTypes[i].getTypeSignature()); + } + sig.append(")"); + returnType = Type.tType(returnT); + sig.append(returnType.getTypeSignature()); + signature = sig.toString(); + } + public final int stackSize() { int size = returnType.stackSize(); for (int i=0; i= 0; ) + paramClasses[i] = parameterTypes[i].getTypeClass(); + return paramClasses; + } + public Type getReturnType() { return returnType; } + public Class getReturnClass() throws ClassNotFoundException { + return returnType.getTypeClass(); + } + public String getTypeSignature() { return signature; }