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

Method setMetaClass

src/main/java/groovy/util/Node.java:299–303  ·  view source on GitHub ↗

Extension point for subclasses to override the metaclass. The default one supports the property and @ attribute notations. @param metaClass the original metaclass @param nodeClass the class whose metaclass we wish to override (this class or a subclass)

(final MetaClass metaClass, final Class nodeClass)

Source from the content-addressed store, hash-verified

297 * @param nodeClass the class whose metaclass we wish to override (this class or a subclass)
298 */
299 protected static void setMetaClass(final MetaClass metaClass, final Class nodeClass) {
300 // TODO Is protected static a bit of a smell?
301 // TODO perhaps set nodeClass to be Class<? extends Node>
302 GroovySystem.getMetaClassRegistry().setMetaClass(nodeClass, new NodeMetaClass(metaClass));
303 }
304
305 private static final class NodeMetaClass extends DelegatingMetaClass {
306 private NodeMetaClass(final MetaClass metaClass) {

Callers 1

NodeClass · 0.95

Calls 2

getMetaClassRegistryMethod · 0.95
setMetaClassMethod · 0.65

Tested by

no test coverage detected