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/interfaces/oldmodel Target.java
Date Thu, 23 May 2002 04:49:26 GMT
donaldp     02/05/22 21:49:26

  Modified:    container/src/java/org/apache/myrmidon/interfaces/oldmodel
                        Target.java
  Log:
  Make getName() directly access model
  
  Revision  Changes    Path
  1.5       +8 -36     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/oldmodel/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/oldmodel/Target.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Target.java	21 May 2002 01:32:55 -0000	1.4
  +++ Target.java	23 May 2002 04:49:26 -0000	1.5
  @@ -7,7 +7,6 @@
    */
   package org.apache.myrmidon.interfaces.oldmodel;
   
  -import java.util.ArrayList;
   import org.apache.myrmidon.api.metadata.ModelElement;
   import org.apache.myrmidon.interfaces.model.TargetMetaData;
   
  @@ -15,48 +14,21 @@
    * Targets in build file.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.4 $ $Date: 2002/05/21 01:32:55 $
  + * @version $Revision: 1.5 $ $Date: 2002/05/23 04:49:26 $
    */
   public class Target
       implements TargetMetaData
   {
  -    private final ArrayList m_dependencies = new ArrayList();
  -    private final ArrayList m_tasks = new ArrayList();
  -    private final String m_name;
  +    private final ModelElement m_target;
   
       /**
        * Constructs a target.
        *
  -     * @param tasks The task models for all tasks in this target.
  -     * @param dependencies The dependencies for executing this target.
  +     * @param target the ModelElement representing target
        */
  -    public Target( final String name,
  -        final ModelElement[] tasks,
  -                   final Dependency[] dependencies )
  +    public Target( final ModelElement target )
       {
  -        m_name = name;
  -        for( int i = 0; i < tasks.length; i++ )
  -        {
  -            m_tasks.add( tasks[ i ] );
  -        }
  -
  -        if( null != dependencies )
  -        {
  -            for( int i = 0; i < dependencies.length; i++ )
  -            {
  -                m_dependencies.add( dependencies[ i ] );
  -            }
  -        }
  -    }
  -
  -    /**
  -     * Get dependencies of target
  -     *
  -     * @return the dependency list
  -     */
  -    public final Dependency[] getDependencies()
  -    {
  -        return (Dependency[])m_dependencies.toArray( new Dependency[ 0 ] );
  +        m_target = target;
       }
   
       /**
  @@ -64,9 +36,9 @@
        *
        * @return the target list
        */
  -    public final ModelElement[] getTasks()
  +    public final ModelElement getModel()
       {
  -        return (ModelElement[])m_tasks.toArray( new ModelElement[ 0 ] );
  +        return m_target;
       }
   
       /**
  @@ -76,7 +48,7 @@
        */
       public String getName()
       {
  -        return m_name;
  +        return m_target.getAttribute( "name" );
       }
   
       /**
  
  
  

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