1 35 package org.codehaus.groovy.runtime; 36 37 import groovy.lang.MetaClass; 38 39 46 public class TemporaryMethodKey extends MethodKey { 47 48 private Object [] parameterValues; 49 50 public TemporaryMethodKey(String name, Object [] parameterValues) { 51 super(name); 52 if (parameterValues == null) { 53 parameterValues = MetaClass.EMPTY_ARRAY; 54 } 55 this.parameterValues = parameterValues; 56 } 57 58 public int getParameterCount() { 59 return parameterValues.length; 60 } 61 62 public Class getParameterType(int index) { 63 Object value = parameterValues[index]; 64 65 if (value != null ) { 66 Class type = (Class )((value.getClass() == java.lang.Class .class) ? 67 value : 68 value.getClass()); 69 return type; 70 } 71 72 return Object .class; 73 } 74 } 75 | Popular Tags |