tapestry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From joshcanfi...@apache.org
Subject svn commit: r1140012 - in /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5: internal/services/ internal/transform/ services/
Date Mon, 27 Jun 2011 03:49:56 GMT
Author: joshcanfield
Date: Mon Jun 27 03:49:55 2011
New Revision: 1140012

URL: http://svn.apache.org/viewvc?rev=1140012&view=rev
Log:
TAP5-1561 - migrating from ClassTransformer to ClassTransformer2

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BlockInjectionProvider.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentResourcesInjectionProvider.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ComponentWorker.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/EnvironmentalWorker.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectComponentWorker.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectContainerWorker.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectPageWorker.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/MixinWorker.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ReadOnlyFieldValueConduit.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BlockInjectionProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BlockInjectionProvider.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BlockInjectionProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/BlockInjectionProvider.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2007, 2008, 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -68,12 +68,18 @@ public class BlockInjectionProvider impl
         {
             public FieldValueConduit get(final ComponentResources resources)
             {
-                return new ReadOnlyFieldValueConduit(resources, fieldName)
+                return new FieldValueConduit()
                 {
                     public Object get()
                     {
                         return resources.getBlock(blockId);
                     }
+
+                    public void set(Object newValue)
+                    {
+                        String componentClassName = resources.getComponentModel().getComponentClassName();
+                        throw new RuntimeException(String.format("Field %s.%s is read only.", componentClassName, fieldName));
+                    }
                 };
             }
         };

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentResourcesInjectionProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentResourcesInjectionProvider.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentResourcesInjectionProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ComponentResourcesInjectionProvider.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -51,12 +51,19 @@ public class ComponentResourcesInjection
         {
             public FieldValueConduit get(final ComponentResources resources)
             {
-                return new ReadOnlyFieldValueConduit(resources, fieldName)
+                return new FieldValueConduit()
                 {
                     public Object get()
                     {
                         return resources;
                     }
+
+                    public void set(Object newValue)
+                    {
+                        String componentClassName = resources.getComponentModel().getComponentClassName();
+                        throw new RuntimeException(String.format("Field %s.%s is read only.",
+                                componentClassName, fieldName));
+                    }
                 };
             }
         };

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java Mon Jun 27 03:49:55 2011
@@ -14,23 +14,26 @@
 
 package org.apache.tapestry5.internal.transform;
 
-import java.util.List;
-
 import org.apache.tapestry5.annotations.SessionState;
+import org.apache.tapestry5.func.F;
 import org.apache.tapestry5.func.Predicate;
 import org.apache.tapestry5.internal.services.ComponentClassCache;
-import org.apache.tapestry5.ioc.services.FieldValueConduit;
 import org.apache.tapestry5.model.MutableComponentModel;
+import org.apache.tapestry5.plastic.FieldConduit;
+import org.apache.tapestry5.plastic.InstanceContext;
+import org.apache.tapestry5.plastic.PlasticClass;
+import org.apache.tapestry5.plastic.PlasticField;
 import org.apache.tapestry5.services.ApplicationStateManager;
-import org.apache.tapestry5.services.ClassTransformation;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
+
+import java.util.List;
 
 /**
- * Looks for the {@link ApplicationState} and {@link org.apache.tapestry5.annotations.SessionState} annotations and
+ * Looks for the {@link org.apache.tapestry5.annotations.SessionState} annotations and
  * converts read and write access on such fields into calls to the {@link ApplicationStateManager}.
  */
-public class ApplicationStateWorker implements ComponentClassTransformWorker
+public class ApplicationStateWorker implements ComponentClassTransformWorker2
 {
     private final ApplicationStateManager applicationStateManager;
 
@@ -43,31 +46,31 @@ public class ApplicationStateWorker impl
         this.componentClassCache = componentClassCache;
     }
 
-    public void transform(ClassTransformation transformation, MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
     {
-        for (TransformField field : transformation.matchFieldsWithAnnotation(SessionState.class))
+        for (PlasticField field : plasticClass.getFieldsWithAnnotation(SessionState.class))
         {
             SessionState annotation = field.getAnnotation(SessionState.class);
 
-            transform(transformation, field, annotation.create());
+            transform(plasticClass, field, annotation.create());
 
             field.claim(annotation);
         }
     }
 
     @SuppressWarnings("unchecked")
-    private void transform(ClassTransformation transformation, TransformField field, final boolean create)
+    private void transform(PlasticClass transformation, PlasticField field, final boolean create)
     {
-        final Class fieldClass = componentClassCache.forName(field.getType());
+        final Class fieldClass = componentClassCache.forName(field.getTypeName());
 
-        field.replaceAccess(new FieldValueConduit()
+        field.setConduit(new FieldConduit()
         {
-            public void set(Object newValue)
+            public void set(Object instance, InstanceContext context, Object newValue)
             {
                 applicationStateManager.set(fieldClass, newValue);
             }
 
-            public Object get()
+            public Object get(Object instance, InstanceContext context)
             {
                 return create ? applicationStateManager.get(fieldClass) : applicationStateManager
                         .getIfExists(fieldClass);
@@ -76,25 +79,25 @@ public class ApplicationStateWorker impl
 
         final String expectedName = field.getName() + "Exists";
 
-        List<TransformField> fields = transformation.matchFields(new Predicate<TransformField>()
+        List<PlasticField> fields = F.flow(transformation.getAllFields()).filter(new Predicate<PlasticField>()
         {
-            public boolean accept(TransformField field)
+            public boolean accept(PlasticField field)
             {
-                return field.getType().equals("boolean") && field.getName().equalsIgnoreCase(expectedName);
+                return field.getTypeName().equals("boolean") && field.getName().equalsIgnoreCase(expectedName);
             }
-        });
+        }).toList();
 
-        for (TransformField existsField : fields)
+        for (PlasticField existsField : fields)
         {
             existsField.claim(this);
 
-            String className = transformation.getClassName();
+            final String className = transformation.getClassName();
 
-            String fieldName = existsField.getName();
+            final String fieldName = existsField.getName();
 
-            existsField.replaceAccess(new ReadOnlyFieldValueConduit(className, fieldName)
+            existsField.setConduit(new ReadOnlyFieldValueConduit(className, fieldName)
             {
-                public Object get()
+                public Object get(Object instance, InstanceContext context)
                 {
                     return applicationStateManager.exists(fieldClass);
                 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ComponentWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ComponentWorker.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ComponentWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ComponentWorker.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2009, 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -31,11 +31,14 @@ import org.apache.tapestry5.ioc.services
 import org.apache.tapestry5.model.ComponentModel;
 import org.apache.tapestry5.model.MutableComponentModel;
 import org.apache.tapestry5.model.MutableEmbeddedComponentModel;
+import org.apache.tapestry5.plastic.*;
 import org.apache.tapestry5.services.ClassTransformation;
 import org.apache.tapestry5.services.ComponentClassResolver;
 import org.apache.tapestry5.services.ComponentClassTransformWorker;
 import org.apache.tapestry5.services.ComponentValueProvider;
 import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
 
 /**
  * Finds fields with the {@link org.apache.tapestry5.annotations.Component} annotation and updates
@@ -43,7 +46,7 @@ import org.apache.tapestry5.services.Tra
  * checks for the {@link Mixins} and {@link MixinClasses} annotations and uses them to update the {@link ComponentModel}
  * .
  */
-public class ComponentWorker implements ComponentClassTransformWorker
+public class ComponentWorker implements ComponentClassTransformWorker2
 {
     private final ComponentClassResolver resolver;
 
@@ -52,15 +55,15 @@ public class ComponentWorker implements 
         this.resolver = resolver;
     }
 
-    public void transform(ClassTransformation transformation, MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
     {
-        for (TransformField field : transformation.matchFieldsWithAnnotation(Component.class))
+        for (PlasticField field : plasticClass.getFieldsWithAnnotation(Component.class))
         {
-            transformField(transformation, model, field);
+            transformField(plasticClass, model, field);
         }
     }
 
-    private void transformField(ClassTransformation transformation, MutableComponentModel model, TransformField field)
+    private void transformField(PlasticClass transformation, MutableComponentModel model, PlasticField field)
     {
         Component annotation = field.getAnnotation(Component.class);
 
@@ -72,7 +75,7 @@ public class ComponentWorker implements 
 
         String id = InternalUtils.isNonBlank(annotationId) ? annotationId : InternalUtils.stripMemberName(fieldName);
 
-        String type = field.getType();
+        String type = field.getTypeName();
 
         Location location = new StringLocation(String.format("%s.%s", transformation.getClassName(), fieldName), 0);
 
@@ -89,25 +92,27 @@ public class ComponentWorker implements 
         addMixinTypes(field, embedded);
     }
 
-    private void convertAccessToField(ClassTransformation transformation, TransformField field, String id)
+    private void convertAccessToField(PlasticClass plasticClass, PlasticField field, String id)
     {
         String fieldName = field.getName();
 
-        ComponentValueProvider<FieldValueConduit> provider = createProviderForEmbeddedComponentConduit(fieldName, id);
+        ComputedValue<FieldConduit<?>> provider = createProviderForEmbeddedComponentConduit(fieldName, id);
 
-        field.replaceAccess(provider);
+        field.setComputedConduit(provider);
     }
 
-    private ComponentValueProvider<FieldValueConduit> createProviderForEmbeddedComponentConduit(final String fieldName,
+    private ComputedValue<FieldConduit<?>> createProviderForEmbeddedComponentConduit(final String fieldName,
             final String id)
     {
-        return new ComponentValueProvider<FieldValueConduit>()
+        return new ComputedValue<FieldConduit<?>>()
         {
-            public FieldValueConduit get(final ComponentResources resources)
+            public FieldConduit get(InstanceContext context)
             {
+                final ComponentResources resources = context.get(ComponentResources.class);
+
                 return new ReadOnlyFieldValueConduit(resources, fieldName)
                 {
-                    public Object get()
+                    public Object get(Object instance, InstanceContext context)
                     {
                         return resources.getEmbeddedComponent(id);
                     }
@@ -124,7 +129,7 @@ public class ComponentWorker implements 
             embedded.setPublishedParameters(CollectionFactory.newList(TapestryInternalUtils.splitAtCommas(names)));
     }
 
-    private void addMixinClasses(TransformField field, MutableEmbeddedComponentModel model)
+    private void addMixinClasses(PlasticField field, MutableEmbeddedComponentModel model)
     {
         MixinClasses annotation = field.getAnnotation(MixinClasses.class);
 
@@ -146,7 +151,7 @@ public class ComponentWorker implements 
         }
     }
 
-    private void addMixinTypes(TransformField field, MutableEmbeddedComponentModel model)
+    private void addMixinTypes(PlasticField field, MutableEmbeddedComponentModel model)
     {
         Mixins annotation = field.getAnnotation(Mixins.class);
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/EnvironmentalWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/EnvironmentalWorker.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/EnvironmentalWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/EnvironmentalWorker.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -14,48 +14,55 @@
 
 package org.apache.tapestry5.internal.transform;
 
-import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.annotations.Environmental;
 import org.apache.tapestry5.internal.services.ComponentClassCache;
-import org.apache.tapestry5.ioc.services.FieldValueConduit;
 import org.apache.tapestry5.model.MutableComponentModel;
-import org.apache.tapestry5.services.ClassTransformation;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.ComponentValueProvider;
+import org.apache.tapestry5.plastic.*;
 import org.apache.tapestry5.services.Environment;
-import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
 
 /**
  * Obtains a value from the {@link Environment} service based on the field type. This is triggered by the presence of
  * the {@link Environmental} annotation.
  */
 @SuppressWarnings("rawtypes")
-public class EnvironmentalWorker implements ComponentClassTransformWorker
+public class EnvironmentalWorker implements ComponentClassTransformWorker2
 {
     private final Environment environment;
 
     private final ComponentClassCache classCache;
 
+
     @SuppressWarnings("unchecked")
-    private final class EnvironmentalConduit extends ReadOnlyFieldValueConduit
+    private final class EnvironmentalConduit implements FieldConduit
     {
+        private final String componentClassName;
+
+        private final String fieldName;
+
         private final Class environmentalType;
 
         private final boolean required;
 
-        private EnvironmentalConduit(ComponentResources resources, String fieldName, final Class environmentalType,
+        private EnvironmentalConduit(String componentClassName, String fieldName, final Class environmentalType,
                 boolean required)
         {
-            super(resources, fieldName);
-
+            this.componentClassName = componentClassName;
+            this.fieldName = fieldName;
             this.environmentalType = environmentalType;
             this.required = required;
         }
 
-        public Object get()
+        public Object get(Object instance, InstanceContext context)
         {
             return required ? environment.peekRequired(environmentalType) : environment.peek(environmentalType);
         }
+
+        public void set(Object instance, InstanceContext context, Object newValue)
+        {
+            throw new RuntimeException(String.format("Field %s.%s is read only.", componentClassName, fieldName));
+        }
     }
 
     public EnvironmentalWorker(Environment environment, ComponentClassCache classCache)
@@ -65,15 +72,15 @@ public class EnvironmentalWorker impleme
         this.classCache = classCache;
     }
 
-    public void transform(ClassTransformation transformation, MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
     {
-        for (TransformField field : transformation.matchFieldsWithAnnotation(Environmental.class))
+        for (PlasticField field : plasticClass.getFieldsWithAnnotation(Environmental.class))
         {
-            transform(field);
+            transform(model.getComponentClassName(), field);
         }
     }
 
-    private void transform(TransformField field)
+    private void transform(final String componentClassName, PlasticField field)
     {
         Environmental annotation = field.getAnnotation(Environmental.class);
 
@@ -81,19 +88,25 @@ public class EnvironmentalWorker impleme
 
         final String fieldName = field.getName();
 
-        final Class fieldType = classCache.forName(field.getType());
+        final Class fieldType = classCache.forName(field.getTypeName());
 
         final boolean required = annotation.value();
 
-        ComponentValueProvider<FieldValueConduit> provider = new ComponentValueProvider<FieldValueConduit>()
+        ComputedValue<FieldConduit<?>> provider = new ComputedValue<FieldConduit<?>>()
         {
-            public FieldValueConduit get(ComponentResources resources)
+            public FieldConduit<?> get(InstanceContext context)
+            {
+                return new EnvironmentalConduit(componentClassName, fieldName, fieldType, required);
+            }
+
+            public void set(Object instance, InstanceContext context, Object newValue)
             {
-                return new EnvironmentalConduit(resources, fieldName, fieldType, required);
+                throw new RuntimeException(
+                        String.format("Field %s of component %s is read only.", fieldName, componentClassName));
             }
         };
 
-        field.replaceAccess(provider);
+        field.setComputedConduit(provider);
     }
 
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectComponentWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectComponentWorker.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectComponentWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectComponentWorker.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2008, 2010 The Apache Software Foundation
+// Copyright 2008, 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -18,21 +18,19 @@ import org.apache.tapestry5.ComponentRes
 import org.apache.tapestry5.annotations.InjectComponent;
 import org.apache.tapestry5.internal.services.ComponentClassCache;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
-import org.apache.tapestry5.ioc.services.FieldValueConduit;
 import org.apache.tapestry5.model.MutableComponentModel;
+import org.apache.tapestry5.plastic.*;
 import org.apache.tapestry5.runtime.Component;
 import org.apache.tapestry5.runtime.PageLifecycleAdapter;
-import org.apache.tapestry5.services.ClassTransformation;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.ComponentValueProvider;
-import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
 
 /**
  * Recognizes the {@link org.apache.tapestry5.annotations.InjectComponent} annotation, and converts the field into a
  * read-only field containing the component. The id of the component may be explicitly stated or will be determined
  * from the field name.
  */
-public class InjectComponentWorker implements ComponentClassTransformWorker
+public class InjectComponentWorker implements ComponentClassTransformWorker2
 {
     private final class InjectedComponentFieldValueConduit extends ReadOnlyFieldValueConduit
     {
@@ -58,7 +56,7 @@ public class InjectComponentWorker imple
                     load();
 
                     resources.removePageLifecycleListener(this);
-                };
+                }
             });
         }
 
@@ -77,7 +75,7 @@ public class InjectComponentWorker imple
                                                 .getName(), fieldType.getName()));
         }
 
-        public Object get()
+        public Object get(Object instance, InstanceContext context)
         {
             return embedded;
         }
@@ -90,34 +88,36 @@ public class InjectComponentWorker imple
         this.classCache = classCache;
     }
 
-    public void transform(ClassTransformation transformation, MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
     {
-        for (TransformField field : transformation.matchFieldsWithAnnotation(InjectComponent.class))
+        for (PlasticField field : plasticClass.getFieldsWithAnnotation(InjectComponent.class))
         {
             InjectComponent annotation = field.getAnnotation(InjectComponent.class);
 
             field.claim(annotation);
 
-            final String type = field.getType();
+            final String type = field.getTypeName();
 
             final String componentId = getComponentId(field, annotation);
 
             final String fieldName = field.getName();
 
-            ComponentValueProvider<FieldValueConduit> provider = new ComponentValueProvider<FieldValueConduit>()
+            ComputedValue<FieldConduit<?>> provider = new ComputedValue<FieldConduit<?>>()
             {
-                public FieldValueConduit get(final ComponentResources resources)
+                public FieldConduit<?> get(InstanceContext context)
                 {
+                    ComponentResources resources = context.get(ComponentResources.class);
+
                     return new InjectedComponentFieldValueConduit(resources, fieldName, type, componentId);
                 }
             };
 
-            field.replaceAccess(provider);
+            field.setComputedConduit(provider);
         }
 
     }
 
-    private String getComponentId(TransformField field, InjectComponent annotation)
+    private String getComponentId(PlasticField field, InjectComponent annotation)
     {
         String id = annotation.value();
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectContainerWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectContainerWorker.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectContainerWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectContainerWorker.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -17,20 +17,18 @@ package org.apache.tapestry5.internal.tr
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.annotations.InjectContainer;
 import org.apache.tapestry5.internal.services.ComponentClassCache;
-import org.apache.tapestry5.ioc.services.FieldValueConduit;
 import org.apache.tapestry5.model.MutableComponentModel;
+import org.apache.tapestry5.plastic.*;
 import org.apache.tapestry5.runtime.Component;
-import org.apache.tapestry5.services.ClassTransformation;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.ComponentValueProvider;
-import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
 
 /**
  * Identifies the {@link org.apache.tapestry5.annotations.InjectContainer} annotation and adds code
  * to initialize it to
  * the core component.
  */
-public class InjectContainerWorker implements ComponentClassTransformWorker
+public class InjectContainerWorker implements ComponentClassTransformWorker2
 {
     private final ComponentClassCache cache;
 
@@ -39,42 +37,42 @@ public class InjectContainerWorker imple
         this.cache = cache;
     }
 
-    public void transform(ClassTransformation transformation, MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
     {
-        for (final TransformField field : transformation.matchFieldsWithAnnotation(InjectContainer.class))
+        for (final PlasticField field : plasticClass.getFieldsWithAnnotation(InjectContainer.class))
         {
-            transformField(model, field);
+            transformField(field);
         }
     }
 
-    private void transformField(MutableComponentModel model, TransformField field)
+    private void transformField(PlasticField field)
     {
         InjectContainer annotation = field.getAnnotation(InjectContainer.class);
 
         field.claim(annotation);
 
-        ComponentValueProvider<FieldValueConduit> provider = createFieldValueConduitProvider(field);
+        ComputedValue<FieldConduit<?>> provider = createFieldValueConduitProvider(field);
 
-        field.replaceAccess(provider);
+        field.setComputedConduit(provider);
     }
 
-    private ComponentValueProvider<FieldValueConduit> createFieldValueConduitProvider(TransformField field)
+    private ComputedValue<FieldConduit<?>> createFieldValueConduitProvider(PlasticField field)
     {
 
         final String fieldName = field.getName();
 
-        final String fieldTypeName = field.getType();
+        final String fieldTypeName = field.getTypeName();
 
-        return new ComponentValueProvider<FieldValueConduit>()
+        return new ComputedValue<FieldConduit<?>> ()
         {
-            public FieldValueConduit get(final ComponentResources resources)
+            public FieldConduit<?> get(InstanceContext context)
             {
                 final Class fieldType = cache.forName(fieldTypeName);
+                final ComponentResources resources = context.get(ComponentResources.class);
 
                 return new ReadOnlyFieldValueConduit(resources, fieldName)
                 {
-
-                    public Object get()
+                    public Object get(Object instance, InstanceContext context)
                     {
                         Component container = resources.getContainer();
 

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectPageWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectPageWorker.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectPageWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/InjectPageWorker.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -17,22 +17,20 @@ package org.apache.tapestry5.internal.tr
 import org.apache.tapestry5.ComponentResources;
 import org.apache.tapestry5.annotations.InjectPage;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
-import org.apache.tapestry5.ioc.services.FieldValueConduit;
 import org.apache.tapestry5.model.MutableComponentModel;
+import org.apache.tapestry5.plastic.*;
 import org.apache.tapestry5.runtime.PageLifecycleAdapter;
-import org.apache.tapestry5.services.ClassTransformation;
 import org.apache.tapestry5.services.ComponentClassResolver;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
 import org.apache.tapestry5.services.ComponentSource;
-import org.apache.tapestry5.services.ComponentValueProvider;
-import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
 
 /**
  * Peforms transformations that allow pages to be injected into components.
  * 
  * @see org.apache.tapestry5.annotations.InjectPage
  */
-public class InjectPageWorker implements ComponentClassTransformWorker
+public class InjectPageWorker implements ComponentClassTransformWorker2
 {
     private final class InjectedPageConduit extends ReadOnlyFieldValueConduit
     {
@@ -57,7 +55,7 @@ public class InjectPageWorker implements
             });
         }
 
-        public Object get()
+        public Object get(Object instance, InstanceContext context)
         {
             if (page == null)
                 page = componentSource.getPage(injectedPageName);
@@ -76,15 +74,15 @@ public class InjectPageWorker implements
         this.resolver = resolver;
     }
 
-    public void transform(ClassTransformation transformation, MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
     {
-        for (TransformField field : transformation.matchFieldsWithAnnotation(InjectPage.class))
+        for (PlasticField field : plasticClass.getFieldsWithAnnotation(InjectPage.class))
         {
             addInjectedPage(field);
         }
     }
 
-    private void addInjectedPage(TransformField field)
+    private void addInjectedPage(PlasticField field)
     {
         InjectPage annotation = field.getAnnotation(InjectPage.class);
 
@@ -95,16 +93,17 @@ public class InjectPageWorker implements
         final String fieldName = field.getName();
 
         final String injectedPageName = InternalUtils.isBlank(pageName) ? resolver
-                .resolvePageClassNameToPageName(field.getType()) : pageName;
+                .resolvePageClassNameToPageName(field.getTypeName()) : pageName;
 
-        ComponentValueProvider<FieldValueConduit> provider = new ComponentValueProvider<FieldValueConduit>()
+        ComputedValue<FieldConduit<?>> provider = new ComputedValue<FieldConduit<?>>()
         {
-            public FieldValueConduit get(ComponentResources resources)
+            public FieldConduit<?> get(InstanceContext context)
             {
+                ComponentResources resources = context.get(ComponentResources.class);
                 return new InjectedPageConduit(resources, fieldName, injectedPageName);
             }
         };
 
-        field.replaceAccess(provider);
+        field.setComputedConduit(provider);
     }
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/MixinWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/MixinWorker.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/MixinWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/MixinWorker.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2008, 2009, 2010 The Apache Software Foundation
+// Copyright 2006, 2008, 2009, 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -18,13 +18,11 @@ import org.apache.tapestry5.ComponentRes
 import org.apache.tapestry5.annotations.Mixin;
 import org.apache.tapestry5.internal.InternalComponentResources;
 import org.apache.tapestry5.ioc.internal.util.InternalUtils;
-import org.apache.tapestry5.ioc.services.FieldValueConduit;
 import org.apache.tapestry5.model.MutableComponentModel;
-import org.apache.tapestry5.services.ClassTransformation;
+import org.apache.tapestry5.plastic.*;
 import org.apache.tapestry5.services.ComponentClassResolver;
-import org.apache.tapestry5.services.ComponentClassTransformWorker;
-import org.apache.tapestry5.services.ComponentValueProvider;
-import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
+import org.apache.tapestry5.services.transform.TransformationSupport;
 
 /**
  * Supports the {@link org.apache.tapestry5.annotations.Mixin} annotation, which allows a mixin to
@@ -33,7 +31,7 @@ import org.apache.tapestry5.services.Tra
  * and contain a
  * reference to the mixin instance.
  */
-public class MixinWorker implements ComponentClassTransformWorker
+public class MixinWorker implements ComponentClassTransformWorker2
 {
     private final ComponentClassResolver resolver;
 
@@ -42,15 +40,15 @@ public class MixinWorker implements Comp
         this.resolver = resolver;
     }
 
-    public void transform(ClassTransformation transformation, MutableComponentModel model)
+    public void transform(PlasticClass plasticClass, TransformationSupport support, MutableComponentModel model)
     {
-        for (TransformField field : transformation.matchFieldsWithAnnotation(Mixin.class))
+        for (PlasticField field : plasticClass.getFieldsWithAnnotation(Mixin.class))
         {
             replaceFieldWithMixin(model, field);
         }
     }
 
-    private void replaceFieldWithMixin(MutableComponentModel model, TransformField field)
+    private void replaceFieldWithMixin(MutableComponentModel model, PlasticField field)
     {
         Mixin annotation = field.getAnnotation(Mixin.class);
 
@@ -60,7 +58,7 @@ public class MixinWorker implements Comp
 
         String[] order = annotation.order();
 
-        String fieldType = field.getType();
+        String fieldType = field.getTypeName();
 
         String mixinClassName = InternalUtils.isBlank(mixinType) ? fieldType : resolver
                 .resolveMixinTypeToClassName(mixinType);
@@ -70,25 +68,26 @@ public class MixinWorker implements Comp
         replaceFieldAccessWithMixin(field, mixinClassName);
     }
 
-    private void replaceFieldAccessWithMixin(TransformField field, String mixinClassName)
+    private void replaceFieldAccessWithMixin(PlasticField field, String mixinClassName)
     {
-        ComponentValueProvider<FieldValueConduit> provider = createMixinFieldProvider(field.getName(), mixinClassName);
+        ComputedValue<FieldConduit<?>> provider = createMixinFieldProvider(field.getName(), mixinClassName);
 
-        field.replaceAccess(provider);
+        field.setComputedConduit(provider);
     }
 
-    private ComponentValueProvider<FieldValueConduit> createMixinFieldProvider(final String fieldName,
+    private ComputedValue<FieldConduit<?>> createMixinFieldProvider(final String fieldName,
             final String mixinClassName)
     {
-        return new ComponentValueProvider<FieldValueConduit>()
+        return new ComputedValue<FieldConduit<?>>()
         {
-            public FieldValueConduit get(ComponentResources resources)
+            public FieldConduit get(InstanceContext context)
             {
+                ComponentResources resources = context.get(ComponentResources.class);
                 final InternalComponentResources icr = (InternalComponentResources) resources;
 
                 return new ReadOnlyFieldValueConduit(resources, fieldName)
                 {
-                    public Object get()
+                    public Object get(Object instance, InstanceContext context)
                     {
                         return icr.getMixinByClassName(mixinClassName);
                     }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ReadOnlyFieldValueConduit.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ReadOnlyFieldValueConduit.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ReadOnlyFieldValueConduit.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ReadOnlyFieldValueConduit.java Mon Jun 27 03:49:55 2011
@@ -1,4 +1,4 @@
-// Copyright 2010 The Apache Software Foundation
+// Copyright 2010, 2011 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
@@ -15,15 +15,16 @@
 package org.apache.tapestry5.internal.transform;
 
 import org.apache.tapestry5.ComponentResources;
-import org.apache.tapestry5.ioc.services.FieldValueConduit;
+import org.apache.tapestry5.plastic.FieldConduit;
+import org.apache.tapestry5.plastic.InstanceContext;
 
 /**
- * An implementation of {@link FieldValueConduit} for a read-only component field. Subclasses
- * provide an implementation of the {@link #get()} method.
- * 
+ * An implementation of {@link FieldConduit} for a read-only component field. Subclasses
+ * provide an implementation of the {@link #get(Object, org.apache.tapestry5.plastic.InstanceContext)} method.
+ *
  * @since 5.2.0
  */
-public abstract class ReadOnlyFieldValueConduit implements FieldValueConduit
+public abstract class ReadOnlyFieldValueConduit implements FieldConduit
 {
     private final String qualifiedFieldName;
 
@@ -42,7 +43,7 @@ public abstract class ReadOnlyFieldValue
         this(resources.getComponentModel().getComponentClassName(), fieldName);
     }
 
-    public final void set(Object newValue)
+    public void set(Object instance, InstanceContext context, Object newValue)
     {
         throw new RuntimeException(String.format("Field %s is read only.", qualifiedFieldName));
     }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=1140012&r1=1140011&r2=1140012&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Mon Jun 27 03:49:55 2011
@@ -14,103 +14,24 @@
 
 package org.apache.tapestry5.services;
 
-import java.io.IOException;
-import java.lang.annotation.Annotation;
-import java.math.BigDecimal;
-import java.math.BigInteger;
-import java.net.URL;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.regex.Pattern;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.tapestry5.Asset;
-import org.apache.tapestry5.BindingConstants;
-import org.apache.tapestry5.Block;
-import org.apache.tapestry5.ComponentResources;
-import org.apache.tapestry5.EventContext;
-import org.apache.tapestry5.Field;
-import org.apache.tapestry5.FieldValidationSupport;
-import org.apache.tapestry5.FieldValidator;
-import org.apache.tapestry5.Link;
-import org.apache.tapestry5.MarkupWriter;
-import org.apache.tapestry5.MetaDataConstants;
-import org.apache.tapestry5.NullFieldStrategy;
-import org.apache.tapestry5.OptimizedSessionPersistedObject;
-import org.apache.tapestry5.PersistenceConstants;
-import org.apache.tapestry5.PropertyOverrides;
-import org.apache.tapestry5.RenderSupport;
-import org.apache.tapestry5.Renderable;
-import org.apache.tapestry5.SelectModel;
-import org.apache.tapestry5.StreamResponse;
-import org.apache.tapestry5.SymbolConstants;
-import org.apache.tapestry5.TapestryConstants;
-import org.apache.tapestry5.Translator;
-import org.apache.tapestry5.ValidationDecorator;
-import org.apache.tapestry5.Validator;
-import org.apache.tapestry5.VersionUtils;
+import org.apache.tapestry5.*;
 import org.apache.tapestry5.ajax.MultiZoneUpdate;
-import org.apache.tapestry5.annotations.ActivationRequestParameter;
+import org.apache.tapestry5.annotations.*;
 import org.apache.tapestry5.annotations.ContentType;
-import org.apache.tapestry5.annotations.HeartbeatDeferred;
-import org.apache.tapestry5.annotations.Import;
-import org.apache.tapestry5.annotations.Meta;
-import org.apache.tapestry5.annotations.PageAttached;
-import org.apache.tapestry5.annotations.PageDetached;
-import org.apache.tapestry5.annotations.PageLoaded;
-import org.apache.tapestry5.annotations.PageReset;
-import org.apache.tapestry5.annotations.Path;
-import org.apache.tapestry5.annotations.Secure;
-import org.apache.tapestry5.annotations.Service;
 import org.apache.tapestry5.beaneditor.Validate;
 import org.apache.tapestry5.corelib.ClientValidation;
 import org.apache.tapestry5.grid.GridDataSource;
-import org.apache.tapestry5.internal.AssetConstants;
-import org.apache.tapestry5.internal.DefaultNullFieldStrategy;
-import org.apache.tapestry5.internal.DefaultValidationDecorator;
-import org.apache.tapestry5.internal.InternalConstants;
-import org.apache.tapestry5.internal.InternalSymbols;
-import org.apache.tapestry5.internal.PropertyOverridesImpl;
-import org.apache.tapestry5.internal.TapestryInternalUtils;
-import org.apache.tapestry5.internal.ZeroNullFieldStrategy;
+import org.apache.tapestry5.internal.*;
 import org.apache.tapestry5.internal.beaneditor.EnvironmentMessages;
 import org.apache.tapestry5.internal.beaneditor.MessagesConstraintGenerator;
 import org.apache.tapestry5.internal.beaneditor.PrimitiveFieldConstraintGenerator;
 import org.apache.tapestry5.internal.beaneditor.ValidateAnnotationConstraintGenerator;
-import org.apache.tapestry5.internal.bindings.AssetBindingFactory;
-import org.apache.tapestry5.internal.bindings.BlockBindingFactory;
-import org.apache.tapestry5.internal.bindings.ComponentBindingFactory;
-import org.apache.tapestry5.internal.bindings.ContextBindingFactory;
-import org.apache.tapestry5.internal.bindings.LiteralBindingFactory;
-import org.apache.tapestry5.internal.bindings.MessageBindingFactory;
-import org.apache.tapestry5.internal.bindings.NullFieldStrategyBindingFactory;
-import org.apache.tapestry5.internal.bindings.PropBindingFactory;
-import org.apache.tapestry5.internal.bindings.RenderVariableBindingFactory;
-import org.apache.tapestry5.internal.bindings.SymbolBindingFactory;
-import org.apache.tapestry5.internal.bindings.TranslateBindingFactory;
-import org.apache.tapestry5.internal.bindings.ValidateBindingFactory;
+import org.apache.tapestry5.internal.bindings.*;
 import org.apache.tapestry5.internal.dynamic.DynamicTemplateParserImpl;
 import org.apache.tapestry5.internal.grid.CollectionGridDataSource;
 import org.apache.tapestry5.internal.grid.NullDataSource;
 import org.apache.tapestry5.internal.gzip.GZipFilter;
-import org.apache.tapestry5.internal.renderers.AvailableValuesRenderer;
-import org.apache.tapestry5.internal.renderers.ComponentResourcesRenderer;
-import org.apache.tapestry5.internal.renderers.EventContextRenderer;
-import org.apache.tapestry5.internal.renderers.ListRenderer;
-import org.apache.tapestry5.internal.renderers.LocationRenderer;
-import org.apache.tapestry5.internal.renderers.ObjectArrayRenderer;
-import org.apache.tapestry5.internal.renderers.RequestRenderer;
+import org.apache.tapestry5.internal.renderers.*;
 import org.apache.tapestry5.internal.services.*;
 import org.apache.tapestry5.internal.services.ajax.AjaxFormUpdateFilter;
 import org.apache.tapestry5.internal.services.ajax.JavaScriptSupportImpl;
@@ -130,87 +51,17 @@ import org.apache.tapestry5.internal.ser
 import org.apache.tapestry5.internal.services.meta.MetaWorkerImpl;
 import org.apache.tapestry5.internal.services.templates.DefaultTemplateLocator;
 import org.apache.tapestry5.internal.services.templates.PageTemplateLocator;
-import org.apache.tapestry5.internal.transform.ActivationRequestParameterWorker;
-import org.apache.tapestry5.internal.transform.ApplicationStateWorker;
-import org.apache.tapestry5.internal.transform.BindParameterWorker;
-import org.apache.tapestry5.internal.transform.CCTWToCCTW2Coercion;
-import org.apache.tapestry5.internal.transform.CachedWorker;
-import org.apache.tapestry5.internal.transform.ComponentWorker;
-import org.apache.tapestry5.internal.transform.DiscardAfterWorker;
-import org.apache.tapestry5.internal.transform.EnvironmentalWorker;
-import org.apache.tapestry5.internal.transform.HeartbeatDeferredWorker;
-import org.apache.tapestry5.internal.transform.ImportWorker;
-import org.apache.tapestry5.internal.transform.InjectComponentWorker;
-import org.apache.tapestry5.internal.transform.InjectContainerWorker;
-import org.apache.tapestry5.internal.transform.InjectNamedWorker;
-import org.apache.tapestry5.internal.transform.InjectPageWorker;
-import org.apache.tapestry5.internal.transform.InjectServiceWorker;
-import org.apache.tapestry5.internal.transform.InjectWorker;
-import org.apache.tapestry5.internal.transform.InvokePostRenderCleanupOnResourcesWorker;
-import org.apache.tapestry5.internal.transform.LogWorker;
-import org.apache.tapestry5.internal.transform.MixinAfterWorker;
-import org.apache.tapestry5.internal.transform.MixinWorker;
-import org.apache.tapestry5.internal.transform.OnEventWorker;
-import org.apache.tapestry5.internal.transform.PageActivationContextWorker;
-import org.apache.tapestry5.internal.transform.PageLifecycleAnnotationWorker;
-import org.apache.tapestry5.internal.transform.PageResetAnnotationWorker;
-import org.apache.tapestry5.internal.transform.ParameterWorker;
-import org.apache.tapestry5.internal.transform.PersistWorker;
-import org.apache.tapestry5.internal.transform.PropertyWorker;
-import org.apache.tapestry5.internal.transform.RenderCommandWorker;
-import org.apache.tapestry5.internal.transform.RenderPhaseMethodWorker;
-import org.apache.tapestry5.internal.transform.RetainWorker;
-import org.apache.tapestry5.internal.transform.SessionAttributeWorker;
-import org.apache.tapestry5.internal.transform.SupportsInformalParametersWorker;
-import org.apache.tapestry5.internal.transform.UnclaimedFieldWorker;
+import org.apache.tapestry5.internal.transform.*;
 import org.apache.tapestry5.internal.translator.NumericTranslator;
 import org.apache.tapestry5.internal.translator.NumericTranslatorSupport;
 import org.apache.tapestry5.internal.translator.StringTranslator;
 import org.apache.tapestry5.internal.util.RenderableAsBlock;
 import org.apache.tapestry5.internal.util.StringRenderable;
 import org.apache.tapestry5.internal.validator.ValidatorMacroImpl;
-import org.apache.tapestry5.ioc.AnnotationProvider;
-import org.apache.tapestry5.ioc.Configuration;
-import org.apache.tapestry5.ioc.Location;
-import org.apache.tapestry5.ioc.MappedConfiguration;
-import org.apache.tapestry5.ioc.Messages;
-import org.apache.tapestry5.ioc.MethodAdviceReceiver;
-import org.apache.tapestry5.ioc.ObjectLocator;
-import org.apache.tapestry5.ioc.ObjectProvider;
-import org.apache.tapestry5.ioc.OrderedConfiguration;
-import org.apache.tapestry5.ioc.Resource;
-import org.apache.tapestry5.ioc.ScopeConstants;
-import org.apache.tapestry5.ioc.ServiceBinder;
-import org.apache.tapestry5.ioc.annotations.Autobuild;
-import org.apache.tapestry5.ioc.annotations.Contribute;
-import org.apache.tapestry5.ioc.annotations.Inject;
-import org.apache.tapestry5.ioc.annotations.InjectService;
-import org.apache.tapestry5.ioc.annotations.Local;
-import org.apache.tapestry5.ioc.annotations.Marker;
-import org.apache.tapestry5.ioc.annotations.Match;
-import org.apache.tapestry5.ioc.annotations.Primary;
-import org.apache.tapestry5.ioc.annotations.Scope;
-import org.apache.tapestry5.ioc.annotations.SubModule;
-import org.apache.tapestry5.ioc.annotations.Symbol;
+import org.apache.tapestry5.ioc.*;
+import org.apache.tapestry5.ioc.annotations.*;
 import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
-import org.apache.tapestry5.ioc.services.Builtin;
-import org.apache.tapestry5.ioc.services.ChainBuilder;
-import org.apache.tapestry5.ioc.services.ClassFactory;
-import org.apache.tapestry5.ioc.services.Coercion;
-import org.apache.tapestry5.ioc.services.CoercionTuple;
-import org.apache.tapestry5.ioc.services.LazyAdvisor;
-import org.apache.tapestry5.ioc.services.MasterObjectProvider;
-import org.apache.tapestry5.ioc.services.PerThreadValue;
-import org.apache.tapestry5.ioc.services.PerthreadManager;
-import org.apache.tapestry5.ioc.services.PipelineBuilder;
-import org.apache.tapestry5.ioc.services.PlasticProxyFactory;
-import org.apache.tapestry5.ioc.services.PropertyAccess;
-import org.apache.tapestry5.ioc.services.PropertyShadowBuilder;
-import org.apache.tapestry5.ioc.services.ServiceOverride;
-import org.apache.tapestry5.ioc.services.StrategyBuilder;
-import org.apache.tapestry5.ioc.services.SymbolSource;
-import org.apache.tapestry5.ioc.services.ThreadLocale;
-import org.apache.tapestry5.ioc.services.TypeCoercer;
+import org.apache.tapestry5.ioc.services.*;
 import org.apache.tapestry5.ioc.util.AvailableValues;
 import org.apache.tapestry5.ioc.util.IdAllocator;
 import org.apache.tapestry5.ioc.util.StrategyRegistry;
@@ -224,8 +75,8 @@ import org.apache.tapestry5.services.aja
 import org.apache.tapestry5.services.assets.AssetPathConstructor;
 import org.apache.tapestry5.services.assets.AssetRequestHandler;
 import org.apache.tapestry5.services.assets.AssetsModule;
-import org.apache.tapestry5.services.dynamic.DynamicTemplateParser;
 import org.apache.tapestry5.services.dynamic.DynamicTemplate;
+import org.apache.tapestry5.services.dynamic.DynamicTemplateParser;
 import org.apache.tapestry5.services.javascript.JavaScriptStack;
 import org.apache.tapestry5.services.javascript.JavaScriptStackSource;
 import org.apache.tapestry5.services.javascript.JavaScriptSupport;
@@ -242,17 +93,22 @@ import org.apache.tapestry5.services.pag
 import org.apache.tapestry5.services.templates.ComponentTemplateLocator;
 import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2;
 import org.apache.tapestry5.util.StringToEnumCoercion;
-import org.apache.tapestry5.validator.Email;
-import org.apache.tapestry5.validator.Max;
-import org.apache.tapestry5.validator.MaxLength;
-import org.apache.tapestry5.validator.Min;
-import org.apache.tapestry5.validator.MinLength;
-import org.apache.tapestry5.validator.None;
-import org.apache.tapestry5.validator.Regexp;
-import org.apache.tapestry5.validator.Required;
-import org.apache.tapestry5.validator.ValidatorMacro;
+import org.apache.tapestry5.validator.*;
 import org.slf4j.Logger;
 
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.lang.annotation.Annotation;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.net.URL;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.regex.Pattern;
+
 /**
  * The root module for Tapestry.
  */
@@ -645,7 +501,9 @@ public final class TapestryModule
      * </ul>
      */
     @Contribute(ComponentClassTransformWorker2.class)
-    public static void provideTransformWorkers(OrderedConfiguration<ComponentClassTransformWorker2> configuration)
+    public static void provideTransformWorkers(
+            OrderedConfiguration<ComponentClassTransformWorker2> configuration,
+            ComponentClassResolver resolver)
     {
         configuration.add("Property", new PropertyWorker());
         configuration.addInstance("Import", ImportWorker.class, "after:SetupRender");
@@ -657,6 +515,17 @@ public final class TapestryModule
         configuration.addInstance("UnclaimedField", UnclaimedFieldWorker.class, "after:*");
 
         configuration.addInstance("OnEvent", OnEventWorker.class);
+
+        // These must come after Property, since they actually delete fields
+        // that may still have the annotation
+        configuration.addInstance("ApplicationState", ApplicationStateWorker.class, "after:Property");
+        configuration.addInstance("Environment", EnvironmentalWorker.class, "after:Property");
+
+        configuration.add("Component", new ComponentWorker(resolver));
+        configuration.add("Mixin", new MixinWorker(resolver));
+        configuration.addInstance("InjectPage", InjectPageWorker.class);
+        configuration.addInstance("InjectComponent", InjectComponentWorker.class);
+        configuration.addInstance("InjectContainer", InjectContainerWorker.class);
     }
 
     /**
@@ -725,14 +594,10 @@ public final class TapestryModule
         configuration.addInstance("InjectNamed", InjectNamedWorker.class);
 
         configuration.add("MixinAfter", new MixinAfterWorker());
-        configuration.add("Component", new ComponentWorker(resolver));
-        configuration.add("Mixin", new MixinWorker(resolver));
         configuration
                 .addInstance("ActivationRequestParameter", ActivationRequestParameterWorker.class, "after:OnEvent");
         configuration.add("SupportsInformalParameters", new SupportsInformalParametersWorker());
-        configuration.addInstance("InjectPage", InjectPageWorker.class);
-        configuration.addInstance("InjectContainer", InjectContainerWorker.class);
-        configuration.addInstance("InjectComponent", InjectComponentWorker.class);
+
         configuration.add("RenderCommand", new RenderCommandWorker());
 
         // Default values for parameters are often some form of injection, so
@@ -765,10 +630,6 @@ public final class TapestryModule
 
         configuration.add("InvokePostRenderCleanupOnResources", new InvokePostRenderCleanupOnResourcesWorker());
 
-        // These must come after Property, since they actually delete fields
-        // that may still have the annotation
-        configuration.addInstance("ApplicationState", ApplicationStateWorker.class, "after:Property");
-        configuration.addInstance("Environment", EnvironmentalWorker.class, "after:Property");
 
         configuration.addInstance("Log", LogWorker.class);
 
@@ -1470,8 +1331,8 @@ public final class TapestryModule
 
     /**
      * Analyzes properties to determine the data types, used to
-     * {@linkplain #contributeBeanBlockSource(org.apache.tapestry5.ioc.Configuration)} locale
-     * display and edit blocks} for properties. The default behaviors
+     * {@linkplain #provideDefaultBeanBlocks(org.apache.tapestry5.ioc.Configuration)} locale
+     * display and edit blocks for properties. The default behaviors
      * look for a {@link org.apache.tapestry5.beaneditor.DataType} annotation
      * before deriving the data type from the property type.
      */



Mime
View raw message