Examples of EnhancementOperationImpl


Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

            if (result == null)
            {
                Class baseClass = _classResolver.findClass(className);

                EnhancementOperationImpl eo = new EnhancementOperationImpl(_classResolver,
                        specification, baseClass, _classFactory, _log);

                // Invoking on the chain is the same as invoking on every
                // object in the chain (because method performEnhancement() is type void).

                _chain.performEnhancement(eo, specification);

                result = eo.getConstructor();

                // TODO: This should be optional to work around that IBM JVM bug.

                _validator.validate(baseClass, result.getComponentClass(), specification);
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

    private ComponentConstructor createComponentConstructor(Class inputClass)
    {
        if (inputClass.isInterface() || inputClass.isPrimitive() || inputClass.isArray())
            throw new IllegalArgumentException(ScriptMessages.wrongTypeForEnhancement(inputClass));

        EnhancementOperationImpl op = new EnhancementOperationImpl(_classResolver,
                new ComponentSpecification(), inputClass, _classFactory, null);

        IComponentSpecification spec = new ComponentSpecification();
        spec.setLocation(_creatorLocation);

        Iterator i = _workers.iterator();
        while (i.hasNext())
        {
            EnhancementWorker worker = (EnhancementWorker) i.next();

            worker.performEnhancement(op, spec);
        }

        return op.getConstructor();
    }
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

    private ComponentConstructor createComponentConstructor(Class inputClass)
    {
        if (inputClass.isInterface() || inputClass.isPrimitive() || inputClass.isArray())
            throw new IllegalArgumentException(ScriptMessages.wrongTypeForEnhancement(inputClass));

        EnhancementOperationImpl op = new EnhancementOperationImpl(_classResolver,
                new ComponentSpecification(), inputClass, _classFactory);

        Iterator i = _workers.iterator();
        while (i.hasNext())
        {
            EnhancementWorker worker = (EnhancementWorker) i.next();

            worker.performEnhancement(op, null);
        }

        return op.getConstructor();
    }
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

        if (result == null)
        {
            Class baseClass = _classResolver.findClass(className);

            EnhancementOperationImpl eo = new EnhancementOperationImpl(_classResolver,
                    specification, baseClass, _classFactory);

            // Invoking on the chain is the same as invoking on every
            // object in the chain (because method performEnhancement() is type void).

            _chain.performEnhancement(eo, specification);

            result = eo.getConstructor();

            // TODO: This should be optional to work around that IBM JVM bug.
            // Also, to some degree, it should be passed into EnhancementOperationImpl,
            // as it generally only needs to be done if a enhanced class
            // is fabricated.
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

    private IPage newPage(IComponentSpecification specification, ComponentMessagesSource source, Locale locale)
    {
        ClassFactory classFactory = new ClassFactoryImpl();

        EnhancementOperationImpl op = new EnhancementOperationImpl(new DefaultClassResolver(),
                specification, BasePage.class, classFactory);

        InjectMessagesWorker injectMessages = new InjectMessagesWorker();
        injectMessages.setComponentMessagesSource(source);
       
        injectMessages.performEnhancement(op, specification);
       
        new InjectSpecificationWorker().performEnhancement(op, specification);
           
        IPage result = (IPage) op.getConstructor().newInstance();

        result.setLocale(locale);
        result.setPage(result);

        return result;
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

        AbstractPropertyWorker w = new AbstractPropertyWorker();

        w.setErrorLog(new ErrorLogImpl(new DefaultErrorHandler(), LOG));

        EnhancementOperationImpl op = new EnhancementOperationImpl(_classResolver,
                new ComponentSpecification(), inputClass, _classFactory);

        w.performEnhancement(op, null);

        return op.getConstructor();
    }
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

        if (result == null)
        {
            Class baseClass = _classResolver.findClass(className);

            EnhancementOperationImpl eo = new EnhancementOperationImpl(_classResolver,
                    specification, baseClass, _classFactory);

            // Invoking on the chain is the same as invoking on every
            // object in the chain (because method performEnhancement() is type void).

            _chain.performEnhancement(eo, specification);

            result = eo.getConstructor();

            // TODO: This should be optional to work around that IBM JVM bug.
            // Also, to some degree, it should be passed into EnhancementOperationImpl,
            // as it generally only needs to be done if a enhanced class
            // is fabricated.
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

    private Object construct(Class baseClass, String methodName, Messages messages)
    {
        Location l = newLocation();

        ComponentSpecification spec = new ComponentSpecification();
        EnhancementOperationImpl op = new EnhancementOperationImpl(getClassResolver(), spec,
                baseClass, new ClassFactoryImpl(), null);

        op.addInjectedField("_messages", Messages.class, messages);

        EnhanceUtils.createSimpleAccessor(op, "_messages", "messages", Messages.class, l);

        Method method = findMethod(baseClass, methodName);

        new MessageAnnotationWorker().performEnhancement(op, spec, method, l);

        ComponentConstructor cc = op.getConstructor();

        return cc.newInstance();
    }
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

           
            if (result == null) {
               
                Class baseClass = _classResolver.findClass(className);
               
                EnhancementOperationImpl eo = new EnhancementOperationImpl(_classResolver,
                        specification, baseClass, _classFactory, _log);
               
                // Invoking on the chain is the same as invoking on every
                // object in the chain (because method performEnhancement() is type void).
               
                _chain.performEnhancement(eo, specification);
               
                result = eo.getConstructor();
               
                // TODO: This should be optional to work around that IBM JVM bug.
               
                _validator.validate(baseClass, result.getComponentClass(), specification);
               
View Full Code Here

Examples of org.apache.tapestry.enhance.EnhancementOperationImpl

    private IPage newPage(IComponentSpecification specification, ComponentMessagesSource source,
            Locale locale)
    {
        ClassFactory classFactory = new ClassFactoryImpl();

        EnhancementOperationImpl op = new EnhancementOperationImpl(new DefaultClassResolver(),
                specification, BasePage.class, classFactory, null);

        InjectMessagesWorker injectMessages = new InjectMessagesWorker();
        injectMessages.setComponentMessagesSource(source);

        injectMessages.performEnhancement(op, specification);

        new InjectSpecificationWorker().performEnhancement(op, specification);

        IPage result = (IPage) op.getConstructor().newInstance();

        result.setLocale(locale);
        result.setPage(result);

        return result;
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.