Package org.apache.tapestry5.ioc.util

Examples of org.apache.tapestry5.ioc.util.BodyBuilder.end()


            addRootVariable(builder);

            builder.addln("return %s;", createListConstructor(builder, node));

            builder.end();

            classFab.addMethod(Modifier.PUBLIC, GET_SIGNATURE, builder.toString());
        }

        private String createListConstructor(BodyBuilder builder, Tree node)
View Full Code Here


            String propertyTypeName = ClassFabUtils.toJavaClassName(info.getType());

            builder.addln("target.%s(%s);", method.getName(), ClassFabUtils.castReference("$2", propertyTypeName));

            builder.end();

            classFab.addMethod(Modifier.PUBLIC, SET_SIGNATURE, builder.toString());
        }

        private void createNoOpSetter()
View Full Code Here

            builder.addln("if (target == null) return null;");

            builder.addln("return ($w) target.%s;", createMethodInvocation(builder, node, method));

            builder.end();

            classFab.addMethod(Modifier.PUBLIC, GET_SIGNATURE, builder.toString());
        }

View Full Code Here

        }
        else
        {
            builder.addln("return %s;", result.getFinalStepVariable());

            builder.end();
        }

        classFab.addMethod(Modifier.PUBLIC, GET_SIGNATURE, builder.toString());

View Full Code Here

        // Invoke the method.

        builder.addln("%s.%s(value);", result.getFinalStepVariable(), writeMethod.getName());

        builder.end();

        classFab.addMethod(Modifier.PUBLIC, SET_SIGNATURE, builder.toString());

        return writeMethod;
    }
View Full Code Here

        }

        builder.addln(
                "throw new IllegalStateException(\"Impossible exception thrown from intercepted invocation.\");");

        builder.end(); // if fail

        builder.addln("return ($r) invocation.getResult();");

        builder.end();
View Full Code Here

        builder.end(); // if fail

        builder.addln("return ($r) invocation.getResult();");

        builder.end();

        interceptorFab.addMethod(Modifier.PUBLIC, new MethodSignature(method), builder.toString());

        remainingMethods.remove(method);
        advisedMethods.add(method);
View Full Code Here

        addProceed(method, invocationFab);
        addGetParameter(method, invocationFab);
        addOverride(method, invocationFab);

        constructorBuilder.end(); // constructor

        Class[] typesArray = constructorTypes.toArray(new Class[constructorTypes.size()]);

        invocationFab.addConstructor(typesArray, null, constructorBuilder.toString());
View Full Code Here

            builder.add("overrideResult(($w) result);");
        }

        if (hasChecked)
        {
            builder.end();   // try

            for (Class exception : exceptionTypes)
            {
                builder.addln("catch (%s ex) { overrideThrown(ex); }", exception.getName());
            }
View Full Code Here

            {
                builder.addln("catch (%s ex) { overrideThrown(ex); }", exception.getName());
            }
        }

        builder.end(); // method

        MethodSignature sig = new MethodSignature(void.class, "proceed", null, null);

        fab.addMethod(Modifier.PUBLIC, sig, builder.toString());
    }
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.