1 35 36 package org.codehaus.groovy.classgen; 37 38 import java.util.List ; 39 40 import groovy.lang.MetaMethod; 41 42 import org.codehaus.groovy.runtime.Reflector; 43 44 51 public class DummyReflector extends Reflector { 52 53 public DummyReflector() { 54 } 55 56 78 79 public Object invoke(MetaMethod method, Object object, Object [] arguments) { 80 switch (method.getMethodIndex()) { 81 case 1 : 82 return ((String ) object).toCharArray(); 83 case 2 : 84 return new Boolean (((List ) object).contains(arguments[0])); 85 default : 86 return noSuchMethod(method, object, arguments); 87 } 88 } 89 90 public Object invokeConstructor(Object constructor, Object [] arguments) { 91 return null; } 93 94 char[] blah() { 95 return "foo".toCharArray(); 96 } 97 98 } 99 | Popular Tags |