From 6e53627cdd34419a6eeb6f95a0004991db4d2b91 Mon Sep 17 00:00:00 2001 From: Kevin Jackson Date: Thu, 10 May 2007 03:16:31 +0000 Subject: [PATCH] -fix
    not closed & add information about classes for nested elements must be static git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@536737 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/tutorial-writing-tasks.html | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/manual/tutorial-writing-tasks.html b/docs/manual/tutorial-writing-tasks.html index 30410451e..73fc6a140 100644 --- a/docs/manual/tutorial-writing-tasks.html +++ b/docs/manual/tutorial-writing-tasks.html @@ -313,14 +313,14 @@ property name as argument and returns its value (or ${propname} if not set).

    There are several ways for inserting the ability of handling nested elements. See the Manual [4] for other. We use the first way of the three described ways. There are several steps for that:

      -
    1. We create a class for collecting all the infos the nested element should contain. +
    2. We create a class for collecting all the info the nested element should contain. This class is created by the same rules for attributes and nested elements as for the task (set<attributename>() methods).
    3. The task holds multiple instances of this class in a list.
    4. A factory method instantiates an object, saves the reference in the list and returns it to Ant Core.
    5. The execute() method iterates over the list and evaluates its values.
    6. -

      +

     import java.util.Vector;
     import java.util.Iterator;
    @@ -361,7 +361,8 @@ the buildfile
                 <message msg="Nested Element 2"/>
             </helloworld>
     
    - +

    Note that if you choose to use methods 2 or 3, the class that represents the nested +element must be declared as

    static

    Our task in a little more complex version

    @@ -449,7 +450,7 @@ import java.util.Iterator; /** * The task of the tutorial. * Print a message or let the build fail. - * @author Jan Matèrne + * @author Jan Mat�rne * @since 2003-08-19 */ public class HelloWorld extends Task {