1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.jelly.ant.task;
17
18 import org.apache.tools.ant.Task;
19 import org.apache.tools.ant.BuildException;
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68 /***
69 * A sample Task to test out the Ant introspection logic
70 *
71 * @author Aslak Hellesøy (aslak.hellesoy@bekk.no)
72 * @version $Revision: 1.8 $
73 */
74 public class DummyTask extends Task {
75 private int i = 0;
76 private String[] messages = { "a", "b", "c", "d", "e", "f", "g", "h", "i" };
77 private boolean force;
78
79 public void execute() throws BuildException {
80 if (!force) {
81 throw new BuildException("Should have set force to be true!");
82 }
83 }
84
85 public Thingy createDing() {
86 System.out.println("createDing: " + messages[i++]);
87 return new Thingy();
88 }
89
90 public void addDang(Thingy thingy) {
91 System.out.println("addDang: " + messages[i++]);
92 }
93
94 public void addConfiguredDong(Thingy thingy) {
95 System.out.println("addConfiguredDong: " + messages[i++]);
96 }
97
98 public Thingy createHipHop() {
99 System.out.println("createHipHop: " + messages[i++]);
100 return new Thingy();
101 }
102
103 public void addWontStop(Thingy thingy) {
104 System.out.println("addWontStop: " + messages[i++]);
105 }
106
107 public void addConfiguredTillYouDrop(Thingy thingy) {
108 System.out.println("addConfiguredTillYouDrop: " + messages[i++]);
109 }
110
111 public boolean isForce() {
112 return force;
113 }
114
115 public void setForce(boolean force) {
116 this.force = force;
117 }
118
119 public static class Thingy {
120 }
121 }