ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer ConfigurationState.java DefaultConfigurer.java ObjectConfigurer.java
Date Tue, 25 Jun 2002 00:35:20 GMT
donaldp     2002/06/24 17:35:20

  Modified:    container/src/java/org/apache/myrmidon/components/configurer
                        ConfigurationState.java DefaultConfigurer.java
                        ObjectConfigurer.java
  Log:
  Simplify a little given changes in architecture
  
  Revision  Changes    Path
  1.9       +3 -18     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ConfigurationState.java
  
  Index: ConfigurationState.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ConfigurationState.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ConfigurationState.java	23 Jun 2002 08:52:25 -0000	1.8
  +++ ConfigurationState.java	25 Jun 2002 00:35:20 -0000	1.9
  @@ -16,17 +16,14 @@
    */
   class ConfigurationState
   {
  -    private final int[] m_propertyCount;
       private final ObjectConfigurer m_configurer;
       private final Object m_object;
   
  -    public ConfigurationState( final ObjectConfigurer configurer,
  -                               final Object object,
  -                               final int propertyCount )
  +    ConfigurationState( final ObjectConfigurer configurer,
  +                               final Object object )
       {
           m_configurer = configurer;
           m_object = object;
  -        m_propertyCount = new int[ propertyCount ];
       }
   
       /**
  @@ -41,17 +38,5 @@
       public Object getObject()
       {
           return m_object;
  -    }
  -
  -    /** Returns a property count. */
  -    public int getPropertyCount( final int index )
  -    {
  -        return m_propertyCount[ index ];
  -    }
  -
  -    /** Increments a property count. */
  -    public void incPropertyCount( final int index )
  -    {
  -        m_propertyCount[ index ]++;
       }
   }
  
  
  
  1.57      +9 -5      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/DefaultConfigurer.java
  
  Index: DefaultConfigurer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/DefaultConfigurer.java,v
  retrieving revision 1.56
  retrieving revision 1.57
  diff -u -r1.56 -r1.57
  --- DefaultConfigurer.java	23 Jun 2002 08:52:25 -0000	1.56
  +++ DefaultConfigurer.java	25 Jun 2002 00:35:20 -0000	1.57
  @@ -112,7 +112,8 @@
               // Start configuration of the object
               final String elemName = model.getName();
               final ObjectConfigurer configurer = getConfigurer( clazz );
  -            final ConfigurationState state = configurer.startConfiguration( object );
  +            final ConfigurationState state =
  +                new ConfigurationState( configurer, object );
   
               // Set each of the attributes
               final String[] attributes = model.getAttributeNames();
  @@ -191,7 +192,8 @@
               }
   
               // Finish configuring the object
  -            configurer.finishConfiguration( state );
  +            // Make sure there are no pending created objects
  +            state.getObject();
           }
       }
   
  @@ -237,7 +239,8 @@
           final ObjectConfigurer configurer = getConfigurer( clazz );
   
           // TODO - this ain't right, the validation is going to be screwed up
  -        final ConfigurationState state = configurer.startConfiguration( object );
  +        final ConfigurationState state =
  +            new ConfigurationState( configurer, object );
   
           // Set the attribute value
           try
  @@ -254,7 +257,8 @@
           }
   
           // Finish up
  -        configurer.finishConfiguration( state );
  +        // Make sure there are no pending created objects
  +        state.getObject();
       }
   
       /**
  
  
  
  1.12      +1 -41     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ObjectConfigurer.java
  
  Index: ObjectConfigurer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/configurer/ObjectConfigurer.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ObjectConfigurer.java	25 Jun 2002 00:20:15 -0000	1.11
  +++ ObjectConfigurer.java	25 Jun 2002 00:35:20 -0000	1.12
  @@ -55,11 +55,6 @@
       private PropertyConfigurer m_contentConfigurer;
   
       /**
  -     * Total number of properties.
  -     */
  -    private int m_propCount;
  -
  -    /**
        * Creates an object configurer for a particular class.  The newly
        * created configurer will not handle any attributes, elements, or content.
        * Use the various <code>enable</code> methods to enable handling of these.
  @@ -245,11 +240,6 @@
           return methods.values();
       }
   
  -    private int getPropertyCount()
  -    {
  -        return m_propCount++;
  -    }
  -
       /**
        * Locates the configurer for a particular class.
        */
  @@ -259,36 +249,6 @@
           final ObjectConfigurer configurer = new ObjectConfigurer( classInfo );
           configurer.enableAll();
           return configurer;
  -    }
  -
  -    /**
  -     * Starts the configuration of an object.
  -     *
  -     * @param object The object about to be configured.
  -     * @return  The state object, used to track type-specific state during
  -     *          configuration.
  -     * @throws  ModelException On error starting the configuration.
  -     */
  -    public ConfigurationState startConfiguration( Object object )
  -        throws ModelException
  -    {
  -        return new ConfigurationState( this, object, getPropertyCount() );
  -    }
  -
  -    /**
  -     * Finishes the configuration of an object, performing any final
  -     * validation and type conversion.
  -     *
  -     * @param state The state object.
  -     * @return The configured object.
  -     * @throws ModelException On error finishing the configurtion.
  -     */
  -    public Object finishConfiguration( final ConfigurationState state )
  -        throws ModelException
  -    {
  -        // Make sure there are no pending created objects
  -        final ConfigurationState defState = (ConfigurationState)state;
  -        return defState.getObject();
       }
   
       /**
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message