Search in sources :

Example 36 with MetaClass

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

the class OwnedMetaClass method selectConstructorAndTransformArguments.

@Override
public int selectConstructorAndTransformArguments(int numberOfConstructors, Object[] arguments) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.selectConstructorAndTransformArguments(numberOfConstructors, arguments);
}
Also used : MetaClass(groovy.lang.MetaClass) DelegatingMetaClass(groovy.lang.DelegatingMetaClass) GroovyObject(groovy.lang.GroovyObject)

Example 37 with MetaClass

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

the class OwnedMetaClass method invokeMissingMethod.

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

Example 38 with MetaClass

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

the class OwnedMetaClass method hasProperty.

@Override
public MetaProperty hasProperty(Object obj, String name) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.hasProperty(owner, name);
}
Also used : MetaClass(groovy.lang.MetaClass) DelegatingMetaClass(groovy.lang.DelegatingMetaClass) GroovyObject(groovy.lang.GroovyObject)

Example 39 with MetaClass

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

the class OwnedMetaClass method invokeMissingProperty.

@Override
public Object invokeMissingProperty(Object instance, String propertyName, Object optionalValue, boolean isGetter) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.invokeMissingProperty(owner, propertyName, optionalValue, isGetter);
}
Also used : MetaClass(groovy.lang.MetaClass) DelegatingMetaClass(groovy.lang.DelegatingMetaClass) GroovyObject(groovy.lang.GroovyObject)

Example 40 with MetaClass

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

the class OwnedMetaClass method getProperty.

@Override
public Object getProperty(Object object, String property) {
    final Object owner = getOwner();
    final MetaClass ownerMetaClass = getOwnerMetaClass(owner);
    return ownerMetaClass.getProperty(owner, property);
}
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