| 24 | import org.codehaus.groovy.runtime.InvokerHelper; |
| 25 | |
| 26 | public class Tt1gi extends Tt1 implements GroovyObject, GroovyInterceptable { |
| 27 | |
| 28 | private MetaClass metaClass = InvokerHelper.getMetaClass(getClass()); |
| 29 | |
| 30 | public MetaClass getMetaClass() { |
| 31 | return this.metaClass; |
| 32 | } |
| 33 | |
| 34 | public Object getProperty(final String property) { |
| 35 | if ("x".equals(property)) { |
| 36 | return "dynamic property"; |
| 37 | } else { |
| 38 | return this.metaClass.getProperty(this, property); |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | public Object invokeMethod(final String name, final Object args) { |
| 43 | if ("x".equals(name)) { |
| 44 | return "dynamic method"; |
| 45 | } else { |
| 46 | return this.metaClass.invokeMethod(this, name, args); |
| 47 | } |
| 48 | } |
| 49 | |
| 50 | public void setMetaClass(final MetaClass metaClass) { |
| 51 | this.metaClass = metaClass; |
| 52 | } |
| 53 | |
| 54 | public void setProperty(final String property, final Object newValue) { |
| 55 | this.metaClass.setProperty(this, property, newValue); |
| 56 | } |
| 57 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…