Package groovy.lang

Examples of groovy.lang.ExpandoMetaClass.initialize()


        checkInitialised();
        Class<?>[] allClasses = application.getAllClasses();
        if (allClasses != null) {
            for (Class<?> c : allClasses) {
                ExpandoMetaClass emc = new ExpandoMetaClass(c, true, true);
                emc.initialize();
            }
            for (GrailsPlugin plugin : pluginList) {
                plugin.doWithDynamicMethods(applicationContext);
            }
        }
View Full Code Here


            if (cls != null) {
                MetaClassRegistry registry = GroovySystem.getMetaClassRegistry();
                registry.removeMetaClass(cls);
                ExpandoMetaClass newMc = new ExpandoMetaClass(cls, true, true);
                newMc.initialize();
                registry.setMetaClass(cls, newMc);

                Enhanced en = AnnotationUtils.findAnnotation(cls,Enhanced.class);
                if (en != null) {
                    Class<?>[] mixinClasses = en.mixins();
View Full Code Here

        if (mc instanceof ExpandoMetaClass) {
            return (ExpandoMetaClass)mc;
        }

        ExpandoMetaClass emc = new ExpandoMetaClass(aClass, true, true);
        emc.initialize();
        registry.setMetaClass(aClass, emc);
        return emc;
    }

    public static MetaClass getMetaClass(Object instance) {
View Full Code Here

            if (o instanceof ThreadManagedMetaBeanProperty) {
                ThreadManagedMetaBeanProperty mbp = (ThreadManagedMetaBeanProperty)o;
                replacement.setProperty(mbp.getName(), mbp.getInitialValue());
            }
        }
        replacement.initialize();

        if (adapter == null) {
            if (LOG.isDebugEnabled()) {
                LOG.debug("Adding MetaClass for class ["+toClass+"] MetaClass ["+replacement+"]");
            }
View Full Code Here

    MetaClassRegistry registry = GroovySystem.getMetaClassRegistry();

    for (Class<?> clazz : classes) {
      originalMetaClasses.add(registry.getMetaClass(clazz));
      MetaClass temporaryMetaClass = new ExpandoMetaClass(clazz, true, true);
      temporaryMetaClass.initialize();
      registry.setMetaClass(clazz, temporaryMetaClass);
    }

    try {
      invocation.proceed();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.