Browse Source

-fix <ol> 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
master
Kevin Jackson 18 years ago
parent
commit
6e53627cdd
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      docs/manual/tutorial-writing-tasks.html

+ 5
- 4
docs/manual/tutorial-writing-tasks.html View File

@@ -313,14 +313,14 @@ property name as argument and returns its value (or ${propname} if not set).</p>
<p>There are several ways for inserting the ability of handling nested elements. See <p>There are several ways for inserting the ability of handling nested elements. See
the <a href="http://ant.apache.org/manual/develop.html#nested-elements">Manual [4]</a> for other. the <a href="http://ant.apache.org/manual/develop.html#nested-elements">Manual [4]</a> for other.
We use the first way of the three described ways. There are several steps for that:<ol> We use the first way of the three described ways. There are several steps for that:<ol>
<li>We create a class for collecting all the infos the nested element should contain.
<li>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 This class is created by the same rules for attributes and nested elements
as for the task (<code>set&lt;attributename&gt;</code>() methods). </li> as for the task (<code>set&lt;attributename&gt;</code>() methods). </li>
<li>The task holds multiple instances of this class in a list.</li> <li>The task holds multiple instances of this class in a list.</li>
<li>A factory method instantiates an object, saves the reference in the list <li>A factory method instantiates an object, saves the reference in the list
and returns it to Ant Core.</li> and returns it to Ant Core.</li>
<li>The execute() method iterates over the list and evaluates its values.</li> <li>The execute() method iterates over the list and evaluates its values.</li>
</li></p>
</ol></p>
<pre class="code"> <pre class="code">
import java.util.Vector; import java.util.Vector;
import java.util.Iterator; import java.util.Iterator;
@@ -361,7 +361,8 @@ the buildfile
&lt;message msg="Nested Element 2"/&gt; &lt;message msg="Nested Element 2"/&gt;
&lt;/helloworld&gt; &lt;/helloworld&gt;
</pre> </pre>

<p>Note that if you choose to use methods 2 or 3, the class that represents the nested
element must be declared as <pre>static</pre></p>


<a name="complex"></a> <a name="complex"></a>
<h2>Our task in a little more complex version</h2> <h2>Our task in a little more complex version</h2>
@@ -449,7 +450,7 @@ import java.util.Iterator;
/** /**
* The task of the tutorial. * The task of the tutorial.
* Print a message or let the build fail. * Print a message or let the build fail.
* @author Jan Matèrne
* @author Jan Mat�rne
* @since 2003-08-19 * @since 2003-08-19
*/ */
public class HelloWorld extends Task { public class HelloWorld extends Task {


Loading…
Cancel
Save