1 46 package groovy.lang; 47 48 import org.codehaus.groovy.runtime.InvokerHelper; 49 50 56 public abstract class GroovyObjectSupport implements GroovyObject { 57 58 private MetaClass metaClass; 59 60 public GroovyObjectSupport() { 61 this.metaClass = InvokerHelper.getMetaClass(this); 62 } 63 64 public Object getProperty(String property) { 65 return metaClass.getProperty(this, property); 66 } 67 68 public void setProperty(String property, Object newValue) { 69 metaClass.setProperty(this, property, newValue); 70 } 71 72 public Object invokeMethod(String name, Object args) { 73 return metaClass.invokeMethod(this, name, args); 74 } 75 76 public MetaClass getMetaClass() { 77 return metaClass; 78 } 79 80 public void setMetaClass(MetaClass metaClass) { 81 this.metaClass = metaClass; 82 } 83 } 84 | Popular Tags |