KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > rift > coad > lib > thirdparty > ant > AntListener


1 /*
2  * CoadunationLib: The coaduntion implementation library.
3  * Copyright (C) 2006 Rift IT Contracting
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  *
19  * AntListener.java
20  *
21  * This class listens for events generated by the ANT environment.
22  */

23
24 // package path
25
package com.rift.coad.lib.thirdparty.ant;
26
27 // ant imports
28
import org.apache.tools.ant.BuildEvent;
29 import org.apache.tools.ant.BuildListener;
30
31 /**
32  * This class listens for events generated by the ANT environment.
33  *
34  * @author Brett Chaldecott
35  */

36 public class AntListener implements BuildListener {
37     
38     // The classes private member variables
39
private String JavaDoc message = new String JavaDoc();
40     
41     
42     /**
43      * Creates a new instance of AntListener
44      */

45     public AntListener() {
46     }
47     
48     
49     /**
50      * Signals that the last target has finished.
51      */

52     public void buildFinished(BuildEvent buildEvent) {
53         //this.buildEvent = buildEvent;
54
}
55     
56     /**
57      * Signals that a build has started.
58      */

59     public void buildStarted(BuildEvent buildEvent) {
60         //this.buildEvent = buildEvent;
61
}
62     
63     
64     /**
65      * Signals a message logging event.
66      */

67     public void messageLogged(BuildEvent buildEvent) {
68         this.message += buildEvent.getMessage();
69     }
70     
71     
72     /**
73      * Signals that a target has finished.
74      */

75     public void targetFinished(BuildEvent buildEvent) {
76         //this.buildEvent = buildEvent;
77
}
78     
79     
80     /**
81      * Signals that a target is starting.
82      */

83     public void targetStarted(BuildEvent buildEvent) {
84         //this.buildEvent = buildEvent;
85
}
86     
87     
88     /**
89      * Signals that a task has finished.
90      */

91     public void taskFinished(BuildEvent buildEvent) {
92         //this.buildEvent = buildEvent;
93
}
94     
95     
96     /**
97      * Signals that a task is starting.
98      */

99     public void taskStarted(BuildEvent buildEvent) {
100         //this.buildEvent = buildEvent;
101
}
102     
103     
104     /**
105      * This method return the current build build event.
106      */

107     public String JavaDoc getMessage() {
108         return message;
109     }
110 }
111
Popular Tags