From 7a87980dc39534a2517471c590aa5b5619892aaa Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Mon, 4 Jun 2001 12:47:11 +0000 Subject: [PATCH] Update class to use new configuration of attribute method. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269100 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/ant/modules/basic/Property.java | 34 ++----------------- 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Property.java b/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Property.java index dfc39dc9d..1b2d538b7 100644 --- a/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Property.java +++ b/proposal/myrmidon/src/java/org/apache/ant/modules/basic/Property.java @@ -52,48 +52,20 @@ public class Property 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 )