Browse Source

No need for separation between ConfigurationState and DefaultConfigurationState at this stage so push it all into one class

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271744 13f79535-47bb-0310-9956-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
6d5ce5b54d
3 changed files with 6 additions and 9 deletions
  1. +3
    -6
      proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/ConfigurationState.java
  2. +2
    -2
      proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/DefaultObjectConfigurer.java
  3. +1
    -1
      proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/DefaultPropertyConfigurer.java

proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/DefaultConfigurationState.java → proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/ConfigurationState.java View File

@@ -9,21 +9,18 @@ package org.apache.myrmidon.components.configurer;


/** /**
* A default configuration state implementation. Keeps track of which * A default configuration state implementation. Keeps track of which
* of the object's properties have been set. Also keeps track of the
* objects created by the creator methods, but not yet set by the adder
* methods.
* of the object's properties have been set.
* *
* @author Adam Murdoch * @author Adam Murdoch
* @version $Revision$ $Date$ * @version $Revision$ $Date$
*/ */
class DefaultConfigurationState
implements ConfigurationState
class ConfigurationState
{ {
private final int[] m_propertyCount; private final int[] m_propertyCount;
private final ObjectConfigurer m_configurer; private final ObjectConfigurer m_configurer;
private final Object m_object; private final Object m_object;


public DefaultConfigurationState( final ObjectConfigurer configurer,
public ConfigurationState( final ObjectConfigurer configurer,
final Object object, final Object object,
final int propertyCount ) final int propertyCount )
{ {

+ 2
- 2
proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/DefaultObjectConfigurer.java View File

@@ -251,7 +251,7 @@ class DefaultObjectConfigurer
public ConfigurationState startConfiguration( Object object ) public ConfigurationState startConfiguration( Object object )
throws ConfigurationException throws ConfigurationException
{ {
return new DefaultConfigurationState( this, object, m_allProps.size() );
return new ConfigurationState( this, object, m_allProps.size() );
} }


/** /**
@@ -262,7 +262,7 @@ class DefaultObjectConfigurer
throws ConfigurationException throws ConfigurationException
{ {
// Make sure there are no pending created objects // Make sure there are no pending created objects
final DefaultConfigurationState defState = (DefaultConfigurationState)state;
final ConfigurationState defState = (ConfigurationState)state;
return defState.getObject(); return defState.getObject();
} }




+ 1
- 1
proposal/myrmidon/src/java/org/apache/myrmidon/components/configurer/DefaultPropertyConfigurer.java View File

@@ -63,7 +63,7 @@ class DefaultPropertyConfigurer
public void addValue( final ConfigurationState state, final Object value ) public void addValue( final ConfigurationState state, final Object value )
throws ConfigurationException throws ConfigurationException
{ {
final DefaultConfigurationState defState = (DefaultConfigurationState)state;
final ConfigurationState defState = (ConfigurationState)state;


// Check the property count // Check the property count
if( defState.getPropertyCount( m_propIndex ) >= m_maxCount ) if( defState.getPropertyCount( m_propIndex ) >= m_maxCount )


Loading…
Cancel
Save