Source Code Cross Referenced for BuildEvent.java in  » Build » ANT » org » apache » tools » ant » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *  Licensed to the Apache Software Foundation (ASF) under one or more
003:         *  contributor license agreements.  See the NOTICE file distributed with
004:         *  this work for additional information regarding copyright ownership.
005:         *  The ASF licenses this file to You under the Apache License, Version 2.0
006:         *  (the "License"); you may not use this file except in compliance with
007:         *  the License.  You may obtain a copy of the License at
008:         *
009:         *      http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         *  Unless required by applicable law or agreed to in writing, software
012:         *  distributed under the License is distributed on an "AS IS" BASIS,
013:         *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         *  See the License for the specific language governing permissions and
015:         *  limitations under the License.
016:         *
017:         */
018:        package org.apache.tools.ant;
019:
020:        import java.util.EventObject;
021:
022:        /**
023:         * Class representing an event occurring during a build. An
024:         * event is built by specifying either a project, a task or a target.
025:         * A project level event will only have a project reference;
026:         * a target level event will have project and target references;
027:         * a task level event will have project, target and task references.
028:         *
029:         */
030:        public class BuildEvent extends EventObject {
031:
032:            /** Project which emitted the event. */
033:            private Project project;
034:            /** Target which emitted the event, if specified. */
035:            private Target target;
036:            /** Task which emitted the event, if specified. */
037:            private Task task;
038:            /**
039:             * Message associated with the event. This is only used for
040:             * "messageLogged" events.
041:             */
042:            private String message;
043:            /**
044:             * The priority of the message, for "messageLogged" events.
045:             */
046:            private int priority = Project.MSG_VERBOSE;
047:            /**
048:             * The exception associated with this event, if any.
049:             * This is only used for "messageLogged", "taskFinished", "targetFinished",
050:             * and "buildFinished" events.
051:             */
052:            private Throwable exception;
053:
054:            /**
055:             * Construct a BuildEvent for a project level event.
056:             *
057:             * @param project the project that emitted the event.
058:             *                Should not be <code>null</code>.
059:             */
060:            public BuildEvent(Project project) {
061:                super (project);
062:                this .project = project;
063:                this .target = null;
064:                this .task = null;
065:            }
066:
067:            /**
068:             * Construct a BuildEvent for a target level event.
069:             * The project associated with the event is derived
070:             * from the given target.
071:             *
072:             * @param target the target that emitted the event.
073:             *               Must not be <code>null</code>.
074:             */
075:            public BuildEvent(Target target) {
076:                super (target);
077:                this .project = target.getProject();
078:                this .target = target;
079:                this .task = null;
080:            }
081:
082:            /**
083:             * Construct a BuildEvent for a task level event.
084:             * The project and target associated with the event
085:             * are derived from the given task.
086:             *
087:             * @param task the task that emitted the event.
088:             *             Must not be <code>null</code>.
089:             */
090:            public BuildEvent(Task task) {
091:                super (task);
092:                this .project = task.getProject();
093:                this .target = task.getOwningTarget();
094:                this .task = task;
095:            }
096:
097:            /**
098:             * Sets the message and priority associated with this event.
099:             * This is used for "messageLogged" events.
100:             *
101:             * @param message the message to be associated with this event.
102:             *                Should not be <code>null</code>.
103:             * @param priority the priority to be associated with this event,
104:             *                 as defined in the {@link Project Project} class.
105:             *
106:             * @see BuildListener#messageLogged(BuildEvent)
107:             */
108:            public void setMessage(String message, int priority) {
109:                this .message = message;
110:                this .priority = priority;
111:            }
112:
113:            /**
114:             * Sets the exception associated with this event. This is used
115:             * for "messageLogged", "taskFinished", "targetFinished", and "buildFinished"
116:             * events.
117:             *
118:             * @param exception The exception to be associated with this event.
119:             *                  May be <code>null</code>.
120:             *
121:             * @see BuildListener#messageLogged(BuildEvent)
122:             * @see BuildListener#taskFinished(BuildEvent)
123:             * @see BuildListener#targetFinished(BuildEvent)
124:             * @see BuildListener#buildFinished(BuildEvent)
125:             */
126:            public void setException(Throwable exception) {
127:                this .exception = exception;
128:            }
129:
130:            /**
131:             * Returns the project that fired this event.
132:             *
133:             * @return the project that fired this event
134:             */
135:            public Project getProject() {
136:                return project;
137:            }
138:
139:            /**
140:             * Returns the target that fired this event.
141:             *
142:             * @return the project that fired this event, or <code>null</code>
143:             *          if this event is a project level event.
144:             */
145:            public Target getTarget() {
146:                return target;
147:            }
148:
149:            /**
150:             * Returns the task that fired this event.
151:             *
152:             * @return the task that fired this event, or <code>null</code>
153:             *         if this event is a project or target level event.
154:             */
155:            public Task getTask() {
156:                return task;
157:            }
158:
159:            /**
160:             * Returns the logging message. This field will only be set
161:             * for "messageLogged" events.
162:             *
163:             * @return the message associated with this event, or <code>null</code>
164:             *         if no message has been set.
165:             *
166:             * @see BuildListener#messageLogged(BuildEvent)
167:             */
168:            public String getMessage() {
169:                return message;
170:            }
171:
172:            /**
173:             * Returns the priority of the logging message. This field will only
174:             * be set for "messageLogged" events. The meaning of this priority
175:             * is as specified by the constants in the {@link Project Project} class.
176:             *
177:             * @return the priority associated with this event.
178:             *
179:             * @see BuildListener#messageLogged(BuildEvent)
180:             */
181:            public int getPriority() {
182:                return priority;
183:            }
184:
185:            /**
186:             * Returns the exception that was thrown, if any. This field will only
187:             * be set for "messageLogged", "taskFinished", "targetFinished", and "buildFinished"
188:             * events.
189:             *
190:             * @return the exception associated with this exception, or
191:             *         <code>null</code> if no exception has been set.
192:             *
193:             * @see BuildListener#messageLogged(BuildEvent)
194:             * @see BuildListener#taskFinished(BuildEvent)
195:             * @see BuildListener#targetFinished(BuildEvent)
196:             * @see BuildListener#buildFinished(BuildEvent)
197:             */
198:            public Throwable getException() {
199:                return exception;
200:            }
201:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.