Search in sources :

Example 86 with MetaClass

use of groovy.lang.MetaClass in project groovy by apache.

the class OwnedMetaClass method getAttribute.

@Override
public Object getAttribute(Class sender, Object receiver, String messageName, boolean useSuper) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.getAttribute(sender, receiver, messageName, useSuper);
}
Also used : MetaClass(groovy.lang.MetaClass) DelegatingMetaClass(groovy.lang.DelegatingMetaClass) GroovyObject(groovy.lang.GroovyObject)

Example 87 with MetaClass

use of groovy.lang.MetaClass in project groovy by apache.

the class OwnedMetaClass method getStaticMetaMethod.

@Override
public MetaMethod getStaticMetaMethod(String name, Class[] argTypes) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.getStaticMetaMethod(name, argTypes);
}
Also used : MetaClass(groovy.lang.MetaClass) DelegatingMetaClass(groovy.lang.DelegatingMetaClass) GroovyObject(groovy.lang.GroovyObject)

Example 88 with MetaClass

use of groovy.lang.MetaClass in project groovy by apache.

the class OwnedMetaClass method getStaticMetaMethod.

@Override
public MetaMethod getStaticMetaMethod(String name, Object[] args) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.getStaticMetaMethod(name, args);
}
Also used : MetaClass(groovy.lang.MetaClass) DelegatingMetaClass(groovy.lang.DelegatingMetaClass) GroovyObject(groovy.lang.GroovyObject)

Example 89 with MetaClass

use of groovy.lang.MetaClass in project groovy by apache.

the class OwnedMetaClass method invokeMethod.

@Override
public Object invokeMethod(Object object, String methodName, Object arguments) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.invokeMethod(owner, methodName, arguments);
}
Also used : MetaClass(groovy.lang.MetaClass) DelegatingMetaClass(groovy.lang.DelegatingMetaClass) GroovyObject(groovy.lang.GroovyObject)

Example 90 with MetaClass

use of groovy.lang.MetaClass in project groovy by apache.

the class OwnedMetaClass method getMetaMethod.

@Override
public MetaMethod getMetaMethod(String name, Object[] args) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.getMetaMethod(name, args);
}
Also used : MetaClass(groovy.lang.MetaClass) DelegatingMetaClass(groovy.lang.DelegatingMetaClass) GroovyObject(groovy.lang.GroovyObject)

Aggregations

MetaClass (groovy.lang.MetaClass)141 DelegatingMetaClass (groovy.lang.DelegatingMetaClass)62 GroovyObject (groovy.lang.GroovyObject)62 ExpandoMetaClass (groovy.lang.ExpandoMetaClass)40 MetaClassImpl (groovy.lang.MetaClassImpl)18 MetaProperty (groovy.lang.MetaProperty)12 GroovyRuntimeException (groovy.lang.GroovyRuntimeException)11 MetaMethod (groovy.lang.MetaMethod)11 ArrayList (java.util.ArrayList)11 MixinInMetaClass (org.codehaus.groovy.reflection.MixinInMetaClass)11 AdaptingMetaClass (groovy.lang.AdaptingMetaClass)9 MetaClassRegistry (groovy.lang.MetaClassRegistry)9 Map (java.util.Map)9 GString (groovy.lang.GString)7 CachedClass (org.codehaus.groovy.reflection.CachedClass)7 ClassInfo (org.codehaus.groovy.reflection.ClassInfo)7 MissingMethodException (groovy.lang.MissingMethodException)6 MissingPropertyException (groovy.lang.MissingPropertyException)6 IOException (java.io.IOException)6 Method (java.lang.reflect.Method)6