cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance TestEnhancementOperation.java TestInjectMessagesWorker.java TestSpecifiedPropertyWorker.java TestInjectSpecificationWorker.java TestInjectScriptWorker.java TestInjectObjectWorker.

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

cvs commit: jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance TestEnhancementOperation.java TestInjectMessagesWorker.java TestSpecifiedPropertyWorker.java TestInjectSpecificationWorker.java TestInjectScriptWorker.java TestInjectObjectWorker.

hlship
hlship      2005/05/16 05:34:08

  Modified:    framework/src/java/org/apache/tapestry/enhance
                        InjectSpecificationWorker.java
                        EnhancementOperation.java InjectStateWorker.java
                        InjectMetaWorker.java InjectObjectWorker.java
                        EnhancementOperationImpl.java
                        InjectScriptWorker.java
                        SpecifiedPropertyWorker.java
                        InjectMessagesWorker.java
               framework/src/test/org/apache/tapestry/enhance
                        TestEnhancementOperation.java
                        TestInjectMessagesWorker.java
                        TestSpecifiedPropertyWorker.java
                        TestInjectSpecificationWorker.java
                        TestInjectScriptWorker.java
                        TestInjectObjectWorker.java
                        TestInjectStateWorker.java
                        TestInjectMetaWorker.java
  Log:
  Rename method EnhancementOperation.addFinalField() to addInjectedField().
 
  Revision  Changes    Path
  1.4       +1 -1      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectSpecificationWorker.java
 
  Index: InjectSpecificationWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectSpecificationWorker.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- InjectSpecificationWorker.java 12 May 2005 18:18:18 -0000 1.3
  +++ InjectSpecificationWorker.java 16 May 2005 12:34:08 -0000 1.4
  @@ -47,7 +47,7 @@
       {
           op.claimProperty(SPECIFICATION_PROPERTY_NAME);
   
  -        String fieldName = op.addFinalField("_$" + SPECIFICATION_PROPERTY_NAME, spec);
  +        String fieldName = op.addInjectedField("_$" + SPECIFICATION_PROPERTY_NAME, spec);
   
           EnhanceUtils.createSimpleAccessor(
                   op,
 
 
 
  1.15      +8 -9      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/EnhancementOperation.java
 
  Index: EnhancementOperation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/EnhancementOperation.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- EnhancementOperation.java 12 May 2005 18:18:18 -0000 1.14
  +++ EnhancementOperation.java 16 May 2005 12:34:08 -0000 1.15
  @@ -53,21 +53,20 @@
       public void addField(String name, Class type);
   
       /**
  -     * Adds a field containing an initial value. The EnhancementOperation will ensure that the value
  -     * is passed into the enhanced class' constructor and assigned. This method may be called
  -     * multiple times with the same value and will return the name variable name (an identity map is
  -     * kept internally).
  +     * Adds a field containing an initial value, which is injected into the class via its fabricated
  +     * constructor. This method may be called multiple times with the same value and will return the
  +     * same variable name (an identity map is kept internally).
        *
        * @param fieldName
  -     *            The name of the field, used if a new field (and contructor argument) is being
  -     *            created. Only used if a field for the value doesn't exist.
  +     *            The default name for the field, used if a new field (and contructor argument) is
  +     *            being created. Only used if a field for the value doesn't exist.
        * @param value
        *            the value to be referenced, which may not be null
  -     * @return the name of the field (which may be fieldName, or maybe not, if some other
  -     *         enhancement worker created the field first).
  +     * @return the name of the field containing the value. This may or may not match fieldName. The
  +     *         provided fieldName may be modified to prevent naming conflicts.
        */
   
  -    public String addFinalField(String fieldName, Object value);
  +    public String addInjectedField(String fieldName, Object value);
   
       /**
        * Converts a type name (an object class name, a primtive name, or an array) into the
 
 
 
  1.5       +1 -1      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectStateWorker.java
 
  Index: InjectStateWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectStateWorker.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- InjectStateWorker.java 12 May 2005 18:18:18 -0000 1.4
  +++ InjectStateWorker.java 16 May 2005 12:34:08 -0000 1.5
  @@ -50,7 +50,7 @@
   
           op.addField(fieldName, propertyType);
   
  -        String managerField = op.addFinalField(
  +        String managerField = op.addInjectedField(
                   "_$applicationStateManager",
                   _applicationStateManager);
   
 
 
 
  1.2       +2 -2      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectMetaWorker.java
 
  Index: InjectMetaWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectMetaWorker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InjectMetaWorker.java 15 May 2005 22:56:36 -0000 1.1
  +++ InjectMetaWorker.java 16 May 2005 12:34:08 -0000 1.2
  @@ -59,7 +59,7 @@
   
           op.claimProperty(propertyName);
   
  -        String sourceName = op.addFinalField(SOURCE_NAME, _source);
  +        String sourceName = op.addInjectedField(SOURCE_NAME, _source);
   
           MethodSignature sig = new MethodSignature(propertyType, op
                   .getAccessorMethodName(propertyName), null, null);
  @@ -115,7 +115,7 @@
       private void addObject(EnhancementOperation op, InjectSpecification spec, String propertyName,
               Class propertyType, MethodSignature sig, String sourceName)
       {
  -        String valueConverterName = op.addFinalField("_$valueConverter", _valueConverter);
  +        String valueConverterName = op.addInjectedField("_$valueConverter", _valueConverter);
           String classRef = op.getClassReference(propertyType);
   
           BodyBuilder builder = new BodyBuilder();
 
 
 
  1.2       +1 -1      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectObjectWorker.java
 
  Index: InjectObjectWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectObjectWorker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InjectObjectWorker.java 12 May 2005 18:18:18 -0000 1.1
  +++ InjectObjectWorker.java 16 May 2005 12:34:08 -0000 1.2
  @@ -57,7 +57,7 @@
                       injectedValue,
                       propertyType), is.getLocation(), null);
   
  -        op.addFinalField(fieldName, injectedValue);
  +        op.addInjectedField(fieldName, injectedValue);
   
           String methodName = EnhanceUtils.createAccessorMethodName(name);
   
 
 
 
  1.19      +3 -3      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/EnhancementOperationImpl.java
 
  Index: EnhancementOperationImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/EnhancementOperationImpl.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- EnhancementOperationImpl.java 13 May 2005 11:41:40 -0000 1.18
  +++ EnhancementOperationImpl.java 16 May 2005 12:34:08 -0000 1.19
  @@ -95,7 +95,7 @@
       private BodyBuilder _constructorBuilder;
   
       /**
  -     * Makes sure that names created by {@link #addFinalField(String, Object)} have unique names.
  +     * Makes sure that names created by {@link #addInjectedField(String, Object)} have unique names.
        */
   
       private final IdAllocator _idAllocator = new IdAllocator();
  @@ -231,7 +231,7 @@
           _classFab.addField(name, type);
       }
   
  -    public String addFinalField(String fieldName, Object value)
  +    public String addInjectedField(String fieldName, Object value)
       {
           Defense.notNull(fieldName, "fieldName");
           Defense.notNull(value, "value");
  @@ -371,7 +371,7 @@
   
           String fieldName = buffer.toString();
   
  -        return addFinalField(fieldName, clazz);
  +        return addInjectedField(fieldName, clazz);
       }
   
       /**
 
 
 
  1.2       +1 -1      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectScriptWorker.java
 
  Index: InjectScriptWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectScriptWorker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- InjectScriptWorker.java 15 May 2005 22:56:36 -0000 1.1
  +++ InjectScriptWorker.java 16 May 2005 12:34:08 -0000 1.2
  @@ -48,7 +48,7 @@
   
           DeferredScript script = new DeferredScriptImpl(resource, _source, spec.getLocation());
   
  -        String fieldName = op.addFinalField("_$script", script);
  +        String fieldName = op.addInjectedField("_$script", script);
   
           MethodSignature sig = new MethodSignature(propertyType, methodName, null, null);
   
 
 
 
  1.11      +1 -1      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/SpecifiedPropertyWorker.java
 
  Index: SpecifiedPropertyWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/SpecifiedPropertyWorker.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- SpecifiedPropertyWorker.java 12 May 2005 18:18:18 -0000 1.10
  +++ SpecifiedPropertyWorker.java 16 May 2005 12:34:08 -0000 1.11
  @@ -131,7 +131,7 @@
           InitialValueBindingCreator creator = new InitialValueBindingCreator(_bindingSource,
                   description, initialValue, location);
   
  -        String creatorField = op.addFinalField(fieldName + "$initialValueBindingCreator", creator);
  +        String creatorField = op.addInjectedField(fieldName + "$initialValueBindingCreator", creator);
   
           String bindingField = fieldName + "$initialValueBinding";
           op.addField(bindingField, IBinding.class);
 
 
 
  1.4       +1 -1      jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectMessagesWorker.java
 
  Index: InjectMessagesWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/java/org/apache/tapestry/enhance/InjectMessagesWorker.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- InjectMessagesWorker.java 12 May 2005 18:18:18 -0000 1.3
  +++ InjectMessagesWorker.java 16 May 2005 12:34:08 -0000 1.4
  @@ -47,7 +47,7 @@
           {
               op.claimProperty(MESSAGES_PROPERTY);
   
  -            String sourceField = op.addFinalField("_$componentMessagesSource", _componentMessagesSource);
  +            String sourceField = op.addInjectedField("_$componentMessagesSource", _componentMessagesSource);
   
               op.addField("_$messages", Messages.class);
   
 
 
 
  1.15      +3 -3      jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestEnhancementOperation.java
 
  Index: TestEnhancementOperation.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestEnhancementOperation.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- TestEnhancementOperation.java 13 May 2005 11:41:40 -0000 1.14
  +++ TestEnhancementOperation.java 16 May 2005 12:34:08 -0000 1.15
  @@ -375,7 +375,7 @@
           verifyControls();
       }
   
  -    public void testAddFinalField()
  +    public void testAddInjectedField()
       {
           IComponentSpecification spec = newSpec();
   
  @@ -398,7 +398,7 @@
           EnhancementOperationImpl eo = new EnhancementOperationImpl(new DefaultClassResolver(),
                   spec, BaseComponent.class, cf);
   
  -        assertEquals("fred", eo.addFinalField("fred", "FRED_VALUE"));
  +        assertEquals("fred", eo.addInjectedField("fred", "FRED_VALUE"));
   
           verifyControls();
   
  @@ -408,7 +408,7 @@
   
           replayControls();
   
  -        assertEquals("fred$0", eo.addFinalField("fred", map));
  +        assertEquals("fred$0", eo.addInjectedField("fred", map));
   
           verifyControls();
   
 
 
 
  1.4       +1 -1      jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectMessagesWorker.java
 
  Index: TestInjectMessagesWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectMessagesWorker.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestInjectMessagesWorker.java 12 May 2005 18:18:19 -0000 1.3
  +++ TestInjectMessagesWorker.java 16 May 2005 12:34:08 -0000 1.4
  @@ -56,7 +56,7 @@
           EnhancementOperation op = (EnhancementOperation) control.getMock();
   
           op.claimProperty(w.MESSAGES_PROPERTY);
  -        op.addFinalField("_$componentMessagesSource", source);
  +        op.addInjectedField("_$componentMessagesSource", source);
           control.setReturnValue("fred");
   
           BodyBuilder builder = new BodyBuilder();
 
 
 
  1.11      +1 -1      jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestSpecifiedPropertyWorker.java
 
  Index: TestSpecifiedPropertyWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestSpecifiedPropertyWorker.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TestSpecifiedPropertyWorker.java 12 May 2005 18:18:19 -0000 1.10
  +++ TestSpecifiedPropertyWorker.java 16 May 2005 12:34:08 -0000 1.11
  @@ -183,7 +183,7 @@
           op.addMethod(Modifier.PUBLIC, new MethodSignature(void.class, "setFred", new Class[]
           { List.class }, null), "{\n  _$fred = $1;\n}\n");
   
  -        op.addFinalField("_$fred$initialValueBindingCreator",
  +        op.addInjectedField("_$fred$initialValueBindingCreator",
   
           expectedCreator);
           opc.setReturnValue("_$fred$initialValueBindingCreator");
 
 
 
  1.4       +1 -1      jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectSpecificationWorker.java
 
  Index: TestInjectSpecificationWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectSpecificationWorker.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TestInjectSpecificationWorker.java 12 May 2005 18:18:19 -0000 1.3
  +++ TestInjectSpecificationWorker.java 16 May 2005 12:34:08 -0000 1.4
  @@ -47,7 +47,7 @@
   
           op.claimProperty("specification");
   
  -        op.addFinalField("_$specification",  spec);
  +        op.addInjectedField("_$specification",  spec);
           control.setReturnValue("_$specification");
   
           op.getAccessorMethodName("specification");
 
 
 
  1.2       +1 -1      jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectScriptWorker.java
 
  Index: TestInjectScriptWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectScriptWorker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestInjectScriptWorker.java 15 May 2005 22:56:36 -0000 1.1
  +++ TestInjectScriptWorker.java 16 May 2005 12:34:08 -0000 1.2
  @@ -57,7 +57,7 @@
           op.getAccessorMethodName("foo");
           opc.setReturnValue("getFoo");
   
  -        op.addFinalField("_$script", new DeferredScriptImpl(scriptResource, source,
  +        op.addInjectedField("_$script", new DeferredScriptImpl(scriptResource, source,
                   injectSpecLocation));
           opc.setMatcher(new AggregateArgumentsMatcher(new ArgumentMatcher[]
           { null, new ArgumentMatcher()
 
 
 
  1.2       +2 -2      jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectObjectWorker.java
 
  Index: TestInjectObjectWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectObjectWorker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestInjectObjectWorker.java 12 May 2005 18:18:19 -0000 1.1
  +++ TestInjectObjectWorker.java 16 May 2005 12:34:08 -0000 1.2
  @@ -68,7 +68,7 @@
   
           pc.setReturnValue(injectedValue);
   
  -        op.addFinalField("_$fred", injectedValue);
  +        op.addInjectedField("_$fred", injectedValue);
           opc.setReturnValue("_$fred");
   
           op.addMethod(
  @@ -107,7 +107,7 @@
           p.obtainValue("service:betty", l);
           pc.setReturnValue(injectedValue);
   
  -        op.addFinalField("_$wilma", injectedValue);
  +        op.addInjectedField("_$wilma", injectedValue);
           opc.setReturnValue("_$wilma");
   
           op.addMethod(Modifier.PUBLIC, new MethodSignature(IEngineService.class, "getWilma", null,
 
 
 
  1.5       +1 -1      jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectStateWorker.java
 
  Index: TestInjectStateWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectStateWorker.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestInjectStateWorker.java 12 May 2005 18:18:19 -0000 1.4
  +++ TestInjectStateWorker.java 16 May 2005 12:34:08 -0000 1.5
  @@ -65,7 +65,7 @@
           op.claimProperty("fred");
           op.addField("_$fred", Map.class);
   
  -        op.addFinalField("_$applicationStateManager", asm);
  +        op.addInjectedField("_$applicationStateManager", asm);
           opc.setReturnValue("_$applicationStateManager");
   
           op.getAccessorMethodName("fred");
 
 
 
  1.2       +4 -4      jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectMetaWorker.java
 
  Index: TestInjectMetaWorker.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tapestry/framework/src/test/org/apache/tapestry/enhance/TestInjectMetaWorker.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestInjectMetaWorker.java 15 May 2005 22:56:36 -0000 1.1
  +++ TestInjectMetaWorker.java 16 May 2005 12:34:08 -0000 1.2
  @@ -64,7 +64,7 @@
   
           MethodSignature sig = new MethodSignature(int.class, "getFooBar", null, null);
   
  -        op.addFinalField(InjectMetaWorker.SOURCE_NAME, source);
  +        op.addInjectedField(InjectMetaWorker.SOURCE_NAME, source);
           control.setReturnValue("_source");
   
           op.getAccessorMethodName("fooBar");
  @@ -105,7 +105,7 @@
   
           MethodSignature sig = new MethodSignature(char.class, "getFooBar", null, null);
   
  -        op.addFinalField(InjectMetaWorker.SOURCE_NAME, source);
  +        op.addInjectedField(InjectMetaWorker.SOURCE_NAME, source);
           control.setReturnValue("_source");
   
           op.getAccessorMethodName("fooBar");
  @@ -147,13 +147,13 @@
   
           MethodSignature sig = new MethodSignature(Object.class, "getFooBar", null, null);
   
  -        op.addFinalField(InjectMetaWorker.SOURCE_NAME, source);
  +        op.addInjectedField(InjectMetaWorker.SOURCE_NAME, source);
           control.setReturnValue("_source");
   
           op.getAccessorMethodName("fooBar");
           control.setReturnValue("getFooBar");
   
  -        op.addFinalField("_$valueConverter", converter);
  +        op.addInjectedField("_$valueConverter", converter);
           control.setReturnValue("vc");
   
           op.getClassReference(Object.class);
 
 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]