ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cos...@apache.org
Subject cvs commit: jakarta-ant/proposal/embed/src/java/org/apache/tools/ant RuntimeConfigurable2.java
Date Sat, 28 Dec 2002 22:58:52 GMT
costin      2002/12/28 14:58:52

  Modified:    proposal/embed/src/java/org/apache/tools/ant
                        RuntimeConfigurable2.java
  Log:
  Update to ProjectHelper
  
  Revision  Changes    Path
  1.7       +23 -2     jakarta-ant/proposal/embed/src/java/org/apache/tools/ant/RuntimeConfigurable2.java
  
  Index: RuntimeConfigurable2.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/embed/src/java/org/apache/tools/ant/RuntimeConfigurable2.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RuntimeConfigurable2.java	28 Dec 2002 05:33:20 -0000	1.6
  +++ RuntimeConfigurable2.java	28 Dec 2002 22:58:52 -0000	1.7
  @@ -281,10 +281,31 @@
           if( proxyConfigured ) {
               return;
           }
  -        PropertyHelper2 ph=PropertyHelper2.getPropertyHelper(p);
  +        PropertyHelper ph=PropertyHelper.getPropertyHelper(p);
  +
  +        Object target=(wrappedObject instanceof TaskAdapter) ?
  +                ((TaskAdapter)wrappedObject).getProxy() : wrappedObject;
   
           if (attributes != null) {
  -            ph.configure(wrappedObject, attributes, p);
  +            IntrospectionHelper ih =
  +                    IntrospectionHelper.getHelper(p, target.getClass());
  +
  +            for (int i = 0; i < attributes.getLength(); i++) {
  +                String name= attributes.getQName(i);
  +                String value= attributes.getValue(i);
  +
  +                // reflect these into the target
  +                value = ph.replaceProperties(null, value, null);
  +                try {
  +                    ih.setAttribute(p, target,
  +                            name.toLowerCase(Locale.US), value);
  +                } catch (BuildException be) {
  +                    // id attribute must be set externally
  +                    if (!name.equals("id")) {
  +                        throw be;
  +                    }
  +                }
  +            }
               id = attributes.getValue("id");
               // No way - this will be used on future calls ( if the task is used
               // multiple times: attributes = null;
  
  
  

--
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