MCPcopy
hub / github.com/apache/groovy / Tt1gi

Class Tt1gi

src/test/groovy/gls/ch06/s05/testClasses/Tt1gi.java:26–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24import org.codehaus.groovy.runtime.InvokerHelper;
25
26public 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}

Callers

nothing calls this directly

Calls 2

getMetaClassMethod · 0.95
getClassMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…