org.codehaus.groovy.grails.commons.metaclass
Class CachingMetaClass

java.lang.Object
  extended by groovy.lang.DelegatingMetaClass
      extended by org.codehaus.groovy.grails.commons.metaclass.CachingMetaClass
All Implemented Interfaces:
groovy.lang.MetaClass, groovy.lang.MetaObjectProtocol, groovy.lang.MutableMetaClass

public class CachingMetaClass
extends groovy.lang.DelegatingMetaClass

A MetaClass that intercepts and caches invocations

Since:
0.5
Author:
Marc Palmer (marc@anyware.co.uk)

Field Summary
protected  Map methodInfoCache
           
protected  Map propertyInfoCache
           
 
Fields inherited from class groovy.lang.DelegatingMetaClass
delegate
 
Constructor Summary
CachingMetaClass(Class aClass)
           
CachingMetaClass(groovy.lang.MetaClass metaClass)
           
 
Method Summary
protected  Object getCachedFeatureInfo(String name, Object[] args, Map cache)
           
protected  boolean hasClosure(Object object, String name)
           
 boolean hasMethod(Object object, String name, Object[] args)
           
 boolean hasProperty(Object object, String name)
           
protected  void toggleFeature(String name, boolean found, Map cache)
           
 
Methods inherited from class groovy.lang.DelegatingMetaClass
addMetaBeanProperty, addMetaMethod, addNewInstanceMethod, addNewStaticMethod, equals, getAttribute, getAttribute, getClassNode, getMetaMethod, getMetaMethod, getMetaMethods, getMetaProperty, getMethods, getProperties, getProperty, getProperty, getStaticMetaMethod, getStaticMetaMethod, getTheClass, hashCode, initialize, invokeConstructor, invokeMethod, invokeMethod, invokeMethod, invokeMissingMethod, invokeMissingProperty, invokeStaticMethod, isGroovyObject, isModified, pickMethod, selectConstructorAndTransformArguments, setAdaptee, setAttribute, setAttribute, setProperty, setProperty, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

methodInfoCache

protected Map methodInfoCache

propertyInfoCache

protected Map propertyInfoCache
Constructor Detail

CachingMetaClass

public CachingMetaClass(groovy.lang.MetaClass metaClass)

CachingMetaClass

public CachingMetaClass(Class aClass)
Method Detail

hasMethod

public boolean hasMethod(Object object,
                         String name,
                         Object[] args)

hasClosure

protected boolean hasClosure(Object object,
                             String name)

toggleFeature

protected void toggleFeature(String name,
                             boolean found,
                             Map cache)

getCachedFeatureInfo

protected Object getCachedFeatureInfo(String name,
                                      Object[] args,
                                      Map cache)

hasProperty

public boolean hasProperty(Object object,
                           String name)


Copyright (c) 2005-2006 The Grails project