Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.TransformMethod


            {
                transformation.addImplementedInterface(Runnable.class);

                TransformMethodSignature targetMethodSignature = new TransformMethodSignature(Modifier.PROTECTED,
                        "void", "protectedVoidNoArgs", null, null);
                TransformMethod pvna = transformation.getOrCreateMethod(targetMethodSignature);

                final MethodAccess pvnaAccess = pvna.getAccess();

                transformation.getOrCreateMethod(RUN).addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
View Full Code Here


                transformation.addImplementedInterface(Runnable.class);

                TransformMethodSignature targetMethodSignature = new TransformMethodSignature(Modifier.PUBLIC, "void",
                        "publicVoidThrowsException", null, new String[]
                        { SQLException.class.getName() });
                TransformMethod targetMethod = transformation.getOrCreateMethod(targetMethodSignature);

                final MethodAccess targetAccess = targetMethod.getAccess();

                transformation.getOrCreateMethod(RUN).addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
View Full Code Here

        {
            public void transform(ClassTransformation transformation, MutableComponentModel model)
            {
                transformation.addImplementedInterface(ProcessInteger.class);

                TransformMethod incrementer = transformation.getOrCreateMethod(new TransformMethodSignature(
                        Modifier.PUBLIC, "int", "incrementer", new String[]
                        { "int" }, null));

                final MethodAccess incrementerAccess = incrementer.getAccess();

                TransformMethodSignature operateSig = new TransformMethodSignature(Modifier.PUBLIC, "int", "operate",
                        new String[]
                        { "int" }, null);

                TransformMethod operate = transformation.getOrCreateMethod(operateSig);

                operate.addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
                        // This advice *replaces* the original do-nothing method, because
                        // it never calls invocation.proceed().
View Full Code Here

        {
            public void transform(ClassTransformation transformation, MutableComponentModel model)
            {
                transformation.addImplementedInterface(ProcessStringAndInteger.class);

                TransformMethod targetMethod = transformation.getOrCreateMethod(new TransformMethodSignature(
                        Modifier.PRIVATE, "java.lang.String", "privateMethod", new String[]
                        { "java.lang.String", "int" }, null));

                final MethodAccess targetMethodAccess = targetMethod.getAccess();

                TransformMethodSignature processSig = new TransformMethodSignature(Modifier.PUBLIC, "java.lang.String",
                        "process", new String[]
                        { "java.lang.String", "int" }, null);

                TransformMethod process = transformation.getOrCreateMethod(processSig);

                process.addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
                        // Don't even bother with proceed() this time, which is OK (but
                        // somewhat rare).
View Full Code Here

        // methods, and if it matches, we know the name of the method.

        if (matches.isEmpty())
            return;

        TransformMethod defaultMethod = matches.get(0);

        captureDefaultValueFromDefaultMethod(transformation, defaultMethod, conduitAccess);
    }
View Full Code Here

        { "java.lang.Exception" }), "as it throws checked exceptions");
    }

    private void testFailure(TransformMethodSignature transformMethodSignature, String messageFragment)
    {
        TransformMethod method = newMock(TransformMethod.class);

        expect(method.getSignature()).andReturn(transformMethodSignature).atLeastOnce();

        expect(method.getMethodIdentifier()).andReturn("<MethodId>");

        replay();

        try
        {
View Full Code Here

        // do anything extra for a subclass; the root class will invoke the cleanup method.
       
        if (!transformation.isRootTransformation())
            return;

        TransformMethod method = transformation.getOrCreateMethod(TransformConstants.POST_RENDER_CLEANUP_SIGNATURE);

        method.addAdvice(advice);
    }
View Full Code Here

            {
                transformation.addImplementedInterface(Runnable.class);

                TransformMethodSignature targetMethodSignature = new TransformMethodSignature(Modifier.PROTECTED,
                        "void", "protectedVoidNoArgs", null, null);
                TransformMethod pvna = transformation.getOrCreateMethod(targetMethodSignature);

                final MethodAccess pvnaAccess = pvna.getAccess();

                transformation.getOrCreateMethod(RUN).addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
View Full Code Here

                transformation.addImplementedInterface(Runnable.class);

                TransformMethodSignature targetMethodSignature = new TransformMethodSignature(Modifier.PUBLIC, "void",
                        "publicVoidThrowsException", null, new String[]
                        { SQLException.class.getName() });
                TransformMethod targetMethod = transformation.getOrCreateMethod(targetMethodSignature);

                final MethodAccess targetAccess = targetMethod.getAccess();

                transformation.getOrCreateMethod(RUN).addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
View Full Code Here

        {
            public void transform(ClassTransformation transformation, MutableComponentModel model)
            {
                transformation.addImplementedInterface(ProcessInteger.class);

                TransformMethod incrementer = transformation.getOrCreateMethod(new TransformMethodSignature(
                        Modifier.PUBLIC, "int", "incrementer", new String[]
                        { "int" }, null));

                final MethodAccess incrementerAccess = incrementer.getAccess();

                TransformMethodSignature operateSig = new TransformMethodSignature(Modifier.PUBLIC, "int", "operate",
                        new String[]
                        { "int" }, null);

                TransformMethod operate = transformation.getOrCreateMethod(operateSig);

                operate.addAdvice(new ComponentMethodAdvice()
                {
                    public void advise(ComponentMethodInvocation invocation)
                    {
                        // This advice *replaces* the original do-nothing method, because
                        // it never calls invocation.proceed().
View Full Code Here

TOP

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

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.