Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.ComponentMethodAdvice


    private void captureDefaultValueFromDefaultMethod(ClassTransformation transformation,
            TransformMethod defaultMethod, final FieldAccess conduitAccess)
    {
        final MethodAccess access = defaultMethod.getAccess();

        ComponentMethodAdvice advice = new InvokeParameterDefaultMethod(conduitAccess, access);

        addPageLoadAdvice(transformation, advice);
    }
View Full Code Here


            final MutableComponentModel model)
    {
        for (final TransformMethod method : transformation
                .matchMethodsWithAnnotation(CommitAfter.class))
        {
            method.addAdvice(new ComponentMethodAdvice()
            {

                public void advise(final ComponentMethodInvocation invocation)
                {
                    advice.advise(invocation);
View Full Code Here

        ensureNotOverride(transformation, setter);

        final FieldAccess access = field.getAccess();

        transformation.getOrCreateMethod(setter).addAdvice(new ComponentMethodAdvice()
        {
            public void advise(ComponentMethodInvocation invocation)
            {
                access.write(invocation.getInstance(), invocation.getParameter(0));
            }
View Full Code Here

        ensureNotOverride(transformation, getter);

        final FieldAccess access = field.getAccess();

        transformation.getOrCreateMethod(getter).addAdvice(new ComponentMethodAdvice()
        {
            public void advise(ComponentMethodInvocation invocation)
            {
                invocation.overrideResult(access.read(invocation.getInstance()));
            }
View Full Code Here

    }

    private void adviseDispatchComponentEventMethod(ClassTransformation transformation,
            List<EventHandlerMethodInvoker> invokers)
    {
        ComponentMethodAdvice advice = createDispatchComponentEventAdvice(invokers);

        transformation.getOrCreateMethod(TransformConstants.DISPATCH_COMPONENT_EVENT).addAdvice(advice);
    }
View Full Code Here

        transformation.getOrCreateMethod(TransformConstants.DISPATCH_COMPONENT_EVENT).addAdvice(advice);
    }

    private ComponentMethodAdvice createDispatchComponentEventAdvice(final List<EventHandlerMethodInvoker> invokers)
    {
        return new ComponentMethodAdvice()
        {
            public void advise(ComponentMethodInvocation invocation)
            {
                // Invoke the super-class implementation first. If no super-class,
                // this will do nothing and return false.
View Full Code Here

    {
        validateMethodSignature(method);

        final MethodAccess access = method.getAccess();

        ComponentMethodAdvice advice = createAdviceToInvokeMethod(access);

        transformation.getOrCreateMethod(lifecycleMethodSignature).addAdvice(advice);
    }
View Full Code Here

        transformation.getOrCreateMethod(lifecycleMethodSignature).addAdvice(advice);
    }

    private ComponentMethodAdvice createAdviceToInvokeMethod(final MethodAccess access)
    {
        return new ComponentMethodAdvice()
        {
            public void advise(ComponentMethodInvocation invocation)
            {
                invocation.proceed();
View Full Code Here

        {
            invokeAdvisedMethod();
            return;
        }

        ComponentMethodAdvice advice = info.getAdvice(adviceIndex++);

        // When this advice invokes proceed(), we can advance to the next advice,
        // and then ultimately to the advised method.

        advice.advise(this);
    }
View Full Code Here

    }

    private void mapMethodsToRenderPhase(ClassTransformation transformation, MutableComponentModel model,
            Class annotationType, List<TransformMethod> methods)
    {
        ComponentMethodAdvice renderPhaseAdvice = createAdviceForMethods(annotationType, methods);

        TransformMethodSignature renderPhaseSignature = annotationToSignature.get(annotationType);

        transformation.getOrCreateMethod(renderPhaseSignature).addAdvice(renderPhaseAdvice);
View Full Code Here

TOP

Related Classes of org.apache.tapestry5.services.ComponentMethodAdvice

Copyright © 2018 www.massapicom. 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.