private MetaMethod[] getNewMetaMethods(CachedClass c) { if (theCachedClass != c) return c.getNewMetaMethods(); return myNewMetaMethods; }
/** * Constructor * * @param theClass The class this is the metaclass dor * @param add The methods for this class */ public MetaClassImpl(final Class theClass, MetaMethod[] add) { this.theClass = theClass; theCachedClass = ReflectionCache.getCachedClass(theClass); this.isGroovyObject = GroovyObject.class.isAssignableFrom(theClass); this.isMap = Map.class.isAssignableFrom(theClass); this.registry = GroovySystem.getMetaClassRegistry(); metaMethodIndex = new MetaMethodIndex(theCachedClass); final MetaMethod[] metaMethods = theCachedClass.getNewMetaMethods(); if (add != null && !(add.length == 0)) { List<MetaMethod> arr = new ArrayList<MetaMethod>(); arr.addAll(Arrays.asList(metaMethods)); arr.addAll(Arrays.asList(add)); myNewMetaMethods = arr.toArray(new MetaMethod[0]); additionalMetaMethods = metaMethods; } else { myNewMetaMethods = metaMethods; additionalMetaMethods = EMPTY; } }
private MetaMethod[] getNewMetaMethods(CachedClass c) { if (theCachedClass != c) return c.getNewMetaMethods(); return myNewMetaMethods; }
private MetaMethod[] getNewMetaMethods(CachedClass c) { if (theCachedClass != c) return c.getNewMetaMethods(); return myNewMetaMethods; }
private MetaMethod[] getNewMetaMethods(CachedClass c) { if (theCachedClass != c) return c.getNewMetaMethods(); return myNewMetaMethods; }
public MetaClassImpl(final Class theClass, MetaMethod [] add) { this.theClass = theClass; theCachedClass = ReflectionCache.getCachedClass(theClass); this.isGroovyObject = GroovyObject.class.isAssignableFrom(theClass); this.isMap = Map.class.isAssignableFrom(theClass); this.registry = GroovySystem.getMetaClassRegistry(); metaMethodIndex = new MetaMethodIndex(theCachedClass); final MetaMethod[] metaMethods = theCachedClass.getNewMetaMethods(); if (add != null && !(add.length == 0)) { ArrayList<MetaMethod> arr = new ArrayList<MetaMethod>(); arr.addAll(Arrays.asList(metaMethods)); arr.addAll(Arrays.asList(add)); myNewMetaMethods = arr.toArray(new MetaMethod[arr.size()]); additionalMetaMethods = metaMethods; } else { myNewMetaMethods = metaMethods; additionalMetaMethods = EMPTY; } }
public MetaClassImpl(final Class theClass, MetaMethod [] add) { this.theClass = theClass; theCachedClass = ReflectionCache.getCachedClass(theClass); this.isGroovyObject = GroovyObject.class.isAssignableFrom(theClass); this.isMap = Map.class.isAssignableFrom(theClass); this.registry = GroovySystem.getMetaClassRegistry(); metaMethodIndex = new MetaMethodIndex(theCachedClass); final MetaMethod[] metaMethods = theCachedClass.getNewMetaMethods(); if (add != null && !(add.length == 0)) { ArrayList<MetaMethod> arr = new ArrayList<MetaMethod>(); arr.addAll(Arrays.asList(metaMethods)); arr.addAll(Arrays.asList(add)); myNewMetaMethods = arr.toArray(new MetaMethod[arr.size()]); additionalMetaMethods = metaMethods; } else { myNewMetaMethods = metaMethods; additionalMetaMethods = EMPTY; } }
private void inheritInterfaceNewMetaMethods(Set interfaces) { // add methods declared by DGM for interfaces for (Iterator it = interfaces.iterator(); it.hasNext(); ) { CachedClass cls = (CachedClass) it.next(); MetaMethod methods [] = cls.getNewMetaMethods(); for (int i = 0; i < methods.length; i++) { MetaMethod method = methods[i]; if (!newGroovyMethodsSet.contains(method)) { newGroovyMethodsSet.add(method); } MetaMethodIndex.Entry e = metaMethodIndex.getOrPutMethods(method.getName(), mainClassMethodHeader); e.methods = metaMethodIndex.addMethodToList(e.methods, method); } } }
public MetaClassImpl(final Class theClass, MetaMethod [] add) { this.theClass = theClass; theCachedClass = ReflectionCache.getCachedClass(theClass); this.isGroovyObject = GroovyObject.class.isAssignableFrom(theClass); this.isMap = Map.class.isAssignableFrom(theClass); this.registry = GroovySystem.getMetaClassRegistry(); metaMethodIndex = new MetaMethodIndex(theCachedClass); final MetaMethod[] metaMethods = theCachedClass.getNewMetaMethods(); if (add != null && !(add.length == 0)) { ArrayList arr = new ArrayList(); arr.addAll(Arrays.asList(metaMethods)); arr.addAll(Arrays.asList(add)); myNewMetaMethods = (MetaMethod[])arr.toArray(new MetaMethod[arr.size()]); additionalMetaMethods = metaMethods; } else { myNewMetaMethods = metaMethods; additionalMetaMethods = EMPTY; } }
MetaMethod[] cachedMethods1 = c.getNewMetaMethods(); for (int i = 0; i < cachedMethods1.length; i++) { final MetaMethod method = cachedMethods1[i]; MetaMethod[] cachedMethods1 = c.getNewMetaMethods(); for (int i = 0; i < cachedMethods1.length; i++) { final MetaMethod method = cachedMethods1[i];