Package org.apache.tapestry5.ioc.util

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


                builder.addln("%s = $1;", name);
            }

            builder.addln("%s.set(($w) $1);", conduitFieldName);

            builder.end();

            addNewMethod(writeSig, builder.toString());

            replaceWriteAccess(writeMethodName);
        }
View Full Code Here


        builder.begin();

        for (TransformMethodSignature method : methods)
            addCodeForMethod(builder, method, transformation, model);

        builder.end(); // try

        // Runtime exceptions pass right through.

        builder.addln("catch (RuntimeException ex) { throw ex; }");
View Full Code Here

        // Wrap others in a RuntimeException to communicate them up.

        builder.addln("catch (Exception ex) { throw new RuntimeException(ex); } ");

        builder.end();

        transformation.extendMethod(TransformConstants.DISPATCH_COMPONENT_EVENT, builder.toString());
    }

View Full Code Here

        // Store the current value of the field into the default field. This value will
        // be used to reset the field after rendering.

        builder.addln("%s = %s;", defaultFieldName, fieldName);
        builder.end();

        transformation.extendMethod(TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE, builder
                .toString());

        // Now, when the component completes rendering, ensure that any variant parameters are
View Full Code Here

            builder.addln("if (! %s.isInvariant())", accessFieldName);
            builder.begin();
            builder.addln("%s = %s;", fieldName, defaultFieldName);
            builder.addln("%s = false;", cachedFieldName);
            builder.end();

            // Clean up after the component renders.

            String body = builder.toString();
View Full Code Here

        builder.addln("if (! %s.isLoaded())", resourcesFieldName);
        builder.begin();
        builder.addln("%s = $1;", fieldName);
        builder.addln("return;");
        builder.end();

        // Always start by updating the parameter; this will implicitly check for
        // read-only or unbound parameters. $1 is the single parameter
        // to the method.
View Full Code Here

        builder.addln("%s = $1;", fieldName);

        if (cache) builder.addln("%s = %s.isRendering();", cachedFieldName, resourcesFieldName);

        builder.end();

        String methodName = transformation.newMemberName("update_parameter", parameterName);

        TransformMethodSignature signature = new TransformMethodSignature(Modifier.PRIVATE, "void", methodName,
                                                                          new String[] {fieldType}, null);
View Full Code Here

        builder.addln(")");
        builder.begin();
        builder.addln("%s = result;", fieldName);
        builder.addln("%s = true;", cachedFieldName);
        builder.end();

        builder.addln("return result;");
        builder.end();

        String methodName = transformation.newMemberName("read_parameter", parameterName);
View Full Code Here

        builder.addln("%s = result;", fieldName);
        builder.addln("%s = true;", cachedFieldName);
        builder.end();

        builder.addln("return result;");
        builder.end();

        String methodName = transformation.newMemberName("read_parameter", parameterName);

        TransformMethodSignature signature = new TransformMethodSignature(Modifier.PRIVATE, fieldType, methodName, null,
                                                                          null);
View Full Code Here

        // In reverse order in a a subclass, invoke the super method last.

        if (reverse && !model.isRootClass()) builder.addln("super.%s($$);", lifecycleMethodName);


        builder.end(); // try

        // Let runtime exceptions work up (they'll be caught at a higher level.
        // Wrap checked exceptions for later reporting.

        builder.addln("catch (RuntimeException ex) { throw ex; }");
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.