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/proposal/myrmidon/src/java/org/apache/ant/modules/basic Property.java
Date Mon, 04 Jun 2001 12:47:11 GMT
donaldp     01/06/04 05:47:11

  Modified:    proposal/myrmidon/src/java/org/apache/ant/modules/basic
                        Property.java
  Log:
  Update class to use new configuration of attribute method.
  
  Revision  Changes    Path
  1.14      +3 -31     jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Property.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- Property.java	2001/06/03 13:11:39	1.13
  +++ Property.java	2001/06/04 12:47:11	1.14
  @@ -52,48 +52,20 @@
           throws ConfigurationException
       {
           final String[] attributes = configuration.getAttributeNames();
  -
           for( int i = 0; i < attributes.length; i++ )
           {
               final String name = attributes[ i ];
               final String value = configuration.getAttribute( name );
  -
  -            final Object object = resolve( value );
  -
  -            if( name.equals( "name" ) )
  -            {
  -                final String convertedValue = (String)convert( String.class, object );
  -                setName( convertedValue );
  -            }
  -            else if( name.equals( "value" ) )
  -            {
  -                try { setValue( object ); }
  -                catch( final TaskException te )
  -                {
  -                    throw new ConfigurationException( "Error setting value: " + value,
te );
  -                }
  -            }
  -            else if( name.equals( "local-scope" ) )
  -            {
  -                final Boolean localScope = (Boolean)convert( Boolean.class, object );
  -                setLocalScope( Boolean.TRUE == localScope );
  -            }
  -            else
  -            {
  -                throw new ConfigurationException( "Unknown attribute " + name );
  -            }
  +            configure( this, name, value );
           }
   
           final Configuration[] children = configuration.getChildren();
  -
           for( int i = 0; i < children.length; i++ )
           {
  -            final Configuration child = children[ i ];
  -
               try
               {
  -                final DataType value = (DataType)m_factory.create( child.getName() );
  -                configure( value, child );
  +                final DataType value = (DataType)m_factory.create( children[ i ].getName()
);
  +                configure( value, children[ i ] );
                   setValue( value );
               }
               catch( final Exception e )
  
  
  

Mime
View raw message