Package org.apache.tapestry.ioc.util

Examples of org.apache.tapestry.ioc.util.BodyBuilder.clear()


                                                              new String[]
                                                                      {fieldType}, null), builder.toString());

        transformation.replaceWriteAccess(fieldName, writeMethodName);

        builder.clear();
        builder.begin();

        // Check to see if there's a recorded change for this component, this field.

        builder.addln("if (%s.hasFieldChange(\"%s\"))", resourcesFieldName, logicalFieldName);
View Full Code Here


            MethodSignature sig = mi.next();

            // TODO: Checks for methods that don't have at least one parameter, or don't have a
            // compatible 1st parameter. Currently, we'll get a Javassist exception.

            builder.clear();
            builder.begin();

            builder.addln("Object selector = $1;");
            builder.addln(
                    "%s adapter = (%<s) _registry.getByInstance(selector);",
View Full Code Here

        builder.end();

        if (writeOnly)
        {
            builder.clear();
            builder
                    .addln(
                            "throw new java.lang.RuntimeException(\"Expression %s for class %s is write-only.\");",
                            expression,
                            rootClass.getName());
View Full Code Here

        Method writeMethod = writeMethodForTerm(activeType, expression, terms[terms.length - 1]);

        if (writeMethod == null)
        {
            builder.clear();
            builder
                    .addln(
                            "throw new java.lang.RuntimeException(\"Expression %s for class %s is read-only.\");",
                            expression,
                            rootClass.getName());
View Full Code Here

                new String[]
                { fieldType }, null), builder.toString());

        transformation.replaceWriteAccess(fieldName, writeMethodName);

        builder.clear();
        builder.begin();

        // Check to see if there's a recorded change for this component, this field.

        builder.addln("if (%s.hasFieldChange(\"%s\"))", resourcesFieldName, logicalFieldName);
View Full Code Here

            MethodSignature sig = mi.next();

            // TODO: Checks for methods that don't have at least one parameter, or don't have a
            // compatible 1st parameter. Currently, we'll get a Javassist exception.

            builder.clear();
            builder.begin();

            builder.addln("Object selector = $1;");
            builder.addln(
                    "%s adapter = (%<s) _registry.getByInstance(selector);",
View Full Code Here

        // because (unless the binding is invariant), there's no value to get rid of (and if it is
        // invariant, there's no need to get rid of it).

        if (cache)
        {
            builder.clear();

            builder.addln("if (! %s)", invariantFieldName);
            builder.begin();
            builder.addln("%s = %s;", fieldName, defaultFieldName);
            builder.addln("%s = false;", cachedFieldName);
View Full Code Here

                new String[]
                { fieldType }, null), builder.toString());

        transformation.replaceWriteAccess(fieldName, writeMethodName);

        builder.clear();
        builder.begin();

        // Check to see if there's a recorded change for this component, this field.

        builder.addln("if (%s.hasFieldChange(\"%s\"))", resourcesFieldName, logicalFieldName);
View Full Code Here

        builder.end();

        if (writeOnly)
        {
            builder.clear();
            builder
                    .addln("throw new java.lang.RuntimeException(\"Expression %s for class %s is write-only.\");",
                           expression, rootClass.getName());
        }
View Full Code Here

        Method writeMethod = writeMethodForTerm(activeType, expression, terms[terms.length - 1]);

        if (writeMethod == null)
        {
            builder.clear();
            builder
                    .addln("throw new java.lang.RuntimeException(\"Expression %s for class %s is read-only.\");",
                           expression, rootClass.getName());
            classFab.addMethod(Modifier.PUBLIC, SET_SIGNATURE, 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.