1 46 47 package groovy.lang; 48 49 import groovy.lang.GString; 50 import groovy.lang.MetaClass; 51 52 53 59 public class DummyGString extends GString { 60 61 private String [] strings; 62 private MetaClass metaClass; 63 64 public DummyGString(Object [] values) { 65 this(values, new String [] { "Hello ", "!" }); 66 } 67 68 public DummyGString(Object [] values, String [] strings) { 69 super(values); 70 this.strings = strings; 71 } 72 73 public String [] getStrings() { 74 return strings; 75 } 76 77 public MetaClass getMetaClass() { 78 return metaClass; 79 } 80 81 public void setMetaClass(MetaClass metaClass) { 82 this.metaClass = metaClass; 83 } 84 85 public Object invokeMethod(String name, Object arguments) { 86 return metaClass.invokeMethod(this, name, arguments); 87 } 88 } 89 | Popular Tags |