MCPcopy Index your code
hub / github.com/apache/groovy / MetaClassImpl

Method MetaClassImpl

src/main/java/groovy/lang/MetaClassImpl.java:233–248  ·  view source on GitHub ↗

Constructor @param theClass The class this is the metaclass for @param add The methods for this class

(final Class theClass, final MetaMethod[] add)

Source from the content-addressed store, hash-verified

231 * @param add The methods for this class
232 */
233 public MetaClassImpl(final Class theClass, final MetaMethod[] add) {
234 this.theClass = theClass;
235 theCachedClass = ReflectionCache.getCachedClass(theClass);
236 this.isGroovyObject = GroovyObject.class.isAssignableFrom(theClass);
237 this.isMap = Map.class.isAssignableFrom(theClass);
238 this.registry = GroovySystem.getMetaClassRegistry();
239 metaMethodIndex = new MetaMethodIndex(theCachedClass);
240 final MetaMethod[] metaMethods = theCachedClass.getNewMetaMethods();
241 if (add != null && add.length != 0) {
242 myNewMetaMethods = concat(metaMethods, add);
243 additionalMetaMethods = metaMethods;
244 } else {
245 myNewMetaMethods = metaMethods;
246 additionalMetaMethods = MetaMethod.EMPTY_ARRAY;
247 }
248 }
249
250 /**
251 * Constructor that sets the methods to null

Callers

nothing calls this directly

Calls 6

getCachedClassMethod · 0.95
getMetaClassRegistryMethod · 0.95
getConstructorsMethod · 0.80
isAssignableFromMethod · 0.45
getNewMetaMethodsMethod · 0.45
concatMethod · 0.45

Tested by

no test coverage detected