Package org.apache.tapestry5.services

Examples of org.apache.tapestry5.services.ClassTransformation.makeReadOnly()


        train_getFieldAnnotation(ct, barneyFieldName, Id.class, barneyId);

        train_value(barneyId, "barney");

        ct.makeReadOnly(barneyFieldName);

        train_extendMethod(
                ct,
                TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE,
                "_barneyBlock = rez.getBlock(\"barney\");");
View Full Code Here


        train_getResourcesFieldName(ct, "rez");

        train_getFieldAnnotation(ct, barneyFieldName, Id.class, null);

        ct.makeReadOnly(barneyFieldName);

        train_extendMethod(
                ct,
                TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE,
                "_barney = rez.getBlock(\"barney\");");
View Full Code Here

        train_findFieldsWithAnnotation(ct, InjectComponent.class, "myfield");
        train_getFieldAnnotation(ct, "myfield", InjectComponent.class, annotation);
        train_getFieldType(ct, "myfield", CLASS_NAME);
        train_getResourcesFieldName(ct, "resources");
        expect(annotation.value()).andReturn("");
        ct.makeReadOnly("myfield");

        ct.extendMethod(same(TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE),
                        contains(
                                "myfield = (" + CLASS_NAME + ") resources.getEmbeddedComponent(\"myfield\");"));
View Full Code Here

        train_findFieldsWithAnnotation(ct, InjectComponent.class, "myfield");
        train_getFieldAnnotation(ct, "myfield", InjectComponent.class, annotation);
        train_getFieldType(ct, "myfield", CLASS_NAME);
        train_getResourcesFieldName(ct, "resources");
        expect(annotation.value()).andReturn("id_provided_as_annotation").atLeastOnce();
        ct.makeReadOnly("myfield");

        ct.extendMethod(same(TransformConstants.CONTAINING_PAGE_DID_LOAD_SIGNATURE),
                        contains(
                                "myfield = (" + CLASS_NAME + ") resources.getEmbeddedComponent(\"id_provided_as_annotation\");"));
View Full Code Here

        // tests for that.

        ct
                .extendConstructor("myField = (java.lang.Object) as.getAsset(br, \"foo.gif\", rez.getLocale());");

        ct.makeReadOnly(fieldName);

        replay();

        InjectionProvider provider = new AssetInjectionProvider(symbolSource, assetSource);
View Full Code Here

        train_resolveMixinTypeToClassName(resolver, "Bar", "foo.bar.BazMixin");

        model.addMixinClassName("foo.bar.BazMixin");

        transformation.makeReadOnly("fred");

        train_getResourcesFieldName(transformation, "rez");

        train_extendMethod(
                transformation,
View Full Code Here

        train_getFieldAnnotation(transformation, "fred", Mixin.class, annotation);
        train_getFieldType(transformation, "fred", "foo.bar.Baz");

        model.addMixinClassName("foo.bar.Baz");

        transformation.makeReadOnly("fred");

        train_getResourcesFieldName(transformation, "rez");

        train_extendMethod(
                transformation,
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.