donaldp 2002/07/02 00:27:28
Modified: api/src/java/org/apache/myrmidon/api/event TaskEvent.java
Log:
Add a utility method to aquire QualifiedName of Task from event
Also moved the SEPARATOR constant to TaskContext
Revision Changes Path
1.7 +20 -11
jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/event/TaskEvent.java
Index: TaskEvent.java
===================================================================
RCS file:
/home/cvs/jakarta-ant-myrmidon/api/src/java/org/apache/myrmidon/api/event/TaskEvent.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- TaskEvent.java 2 Jul 2002 06:37:51 -0000 1.6
+++ TaskEvent.java 2 Jul 2002 07:27:28 -0000 1.7
@@ -7,6 +7,8 @@
*/
package org.apache.myrmidon.api.event;
+import org.apache.myrmidon.api.TaskContext;
+
/**
* The TaskEvent object notifies [EMAIL PROTECTED] TaskListener} objects
* when a [EMAIL PROTECTED] org.apache.myrmidon.api.Task} starts, stops
@@ -19,11 +21,6 @@
public final class TaskEvent
{
/**
- * Separator for elements in TaskEvents name/path.
- */
- public final static char SEPARATOR = '/';
-
- /**
* The path to task. A path is made of of 0 or more elements.
* Each element in path is separated by a '/' character. An
* example path is "/myproject/mytarget".
@@ -126,6 +123,17 @@
}
/**
+ * Retrieve the name of task that this event is about.
+ *
+ * @return the name of task
+ * @see #m_name
+ */
+ public String getName()
+ {
+ return m_name;
+ }
+
+ /**
* Retrieve the path to task that this event is about.
*
* @return the path to task
@@ -137,14 +145,15 @@
}
/**
- * Retrieve the name of task that this event is about.
+ * Return the fully qualified name of task.
*
- * @return the name of task
- * @see #m_name
+ * @return the fully qualified name of task
+ * @see #getName
+ * @see #getPath
*/
- public String getName()
+ public String getQualifiedName()
{
- return m_name;
+ return getPath() + TaskContext.SEPARATOR + getName();
}
/**
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>