public Object getAttribute(Class sender, Object object, String attribute, boolean useSuper, boolean fromInsideClass) {
        checkInitalised();

        boolean isStatic = theClass != Class.class && object instanceof Class;
        if (isStatic && object != theClass) {
            MetaClass mc = registry.getMetaClass((Class) object);
            return mc.getAttribute(sender, object, attribute, useSuper);
        }

        MetaProperty mp = getMetaProperty(sender, attribute, useSuper, isStatic);

        if (mp != null) {
            if (mp instanceof MetaBeanProperty) {
                MetaBeanProperty mbp = (MetaBeanProperty) mp;
                mp = mbp.getField();
            }
            try {
                // delegate the get operation to the metaproperty
                if (mp != null) return mp.getProperty(object);
            } catch (Exception e) {
                throw new GroovyRuntimeException("Cannot read field: " + attribute, e);
            }
        }

        throw new MissingFieldException(attribute, theClass);
    }
public Object getAttribute ( Class sender , Object object , String attribute , boolean useSuper , boolean fromInsideClass ) { checkInitalised ( ) ; boolean isStatic = theClass != Class . class && object instanceof Class ; if ( isStatic && object != theClass ) { MetaClass mc = registry . getMetaClass ( ( Class ) object ) ; return mc . getAttribute ( sender , object , attribute , useSuper ) ; } MetaProperty mp = getMetaProperty ( sender , attribute , useSuper , isStatic ) ; if ( mp != null ) { if ( mp instanceof MetaBeanProperty ) { MetaBeanProperty mbp = ( MetaBeanProperty ) mp ; mp = mbp . getField ( ) ; } try { if ( mp != null ) return mp . getProperty ( object ) ; } catch ( Exception e ) { throw new GroovyRuntimeException ( "Cannot read field: " + attribute , e ) ; } } throw new MissingFieldException ( attribute , theClass ) ; }
Retrieves the value of an attribute (field). This method is to support the Groovy runtime and not for general client API usage.

@param sender The class of the object that requested the attribute
@param object The instance the attribute is to be retrieved from
@param attribute The name of the attribute
@param useSuper Whether to look-up on the super class or not
@param fromInsideClass Whether the call was invoked from the inside or the outside of the class.

@return The attribute value