User: rinkrank
Date: 02/06/07 07:12:57
Modified: core/src/xdoclet DocletTask.java
Log:
Added code that can check presence of certain classes (like javax.ejb.EntityBean).
This is for better error reporting
Revision Changes Path
1.43 +20 -2 xdoclet/core/src/xdoclet/DocletTask.java
Index: DocletTask.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/DocletTask.java,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -w -r1.42 -r1.43
--- DocletTask.java 31 May 2002 20:43:50 -0000 1.42
+++ DocletTask.java 7 Jun 2002 14:12:56 -0000 1.43
@@ -351,7 +351,7 @@
return configs;
}
- protected void start()
+ protected void start() throws BuildException
{
try {
new XDocletMain().start();
@@ -362,7 +362,7 @@
}
/**
- * Describe what the method does
+ * Called by superclass before start() is called
*
* @exception BuildException Describe the exception
*/
@@ -373,6 +373,24 @@
throw new BuildException(Translator.getString(XDocletMessages.class,
XDocletMessages.ATTRIBUTE_NOT_PRESENT_ERROR, new String[]{"destDir"}), location);
}
validateSubTasks();
+ }
+
+ /**
+ * Throws BuildException if a specific class is not on the CP. Should be called
from subclasses' validateOptions()
+ * to verify that classpath is OK.
+ *
+ * @param className
+ */
+ protected void checkClass(String className)
+ {
+ try {
+ Class.forName(className);
+ }
+ catch (Exception e) {
+ throw new BuildException("Make sure the jar file containing the " +
className +
+ " class is on the classpath specified in the <taskdef> that defined
" + getTaskName() +
+ ". These classes are needed in order to generate correct output.");
+ }
}
/**
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel