User: rinkrank
Date: 02/04/27 16:54:33
Modified: core/src/xdoclet/loader Tag: MODULE_REFACTORING_BRANCH
XDocletModule.java ModuleFinder.java
TagHandlerDefinition.java SubTaskDefinition.java
Removed: core/src/xdoclet/loader Tag: MODULE_REFACTORING_BRANCH
Bootstrapper.java BootstrapClassLoader.java
Log:
Refactored to use new dynamic subelements from Ant 1.5
Revision Changes Path
No revision
No revision
1.5.2.1 +2 -2 xdoclet/core/src/xdoclet/loader/XDocletModule.java
Index: XDocletModule.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/loader/XDocletModule.java,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -u -w -r1.5 -r1.5.2.1
--- XDocletModule.java 21 Apr 2002 20:40:13 -0000 1.5
+++ XDocletModule.java 27 Apr 2002 23:54:32 -0000 1.5.2.1
@@ -17,9 +17,9 @@
*
* @author <a href="mailto:[EMAIL PROTECTED]">Aslak Helles�y</a>
* @created 7. april 2002
- * @version $Revision: 1.5 $
+ * @version $Revision: 1.5.2.1 $
*/
-class XDocletModule
+public class XDocletModule
{
private ArrayList _tagHandlers = new ArrayList();
private ArrayList _subTasks = new ArrayList();
1.3.2.1 +34 -2 xdoclet/core/src/xdoclet/loader/ModuleFinder.java
Index: ModuleFinder.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/loader/ModuleFinder.java,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -w -r1.3 -r1.3.2.1
--- ModuleFinder.java 11 Apr 2002 20:53:00 -0000 1.3
+++ ModuleFinder.java 27 Apr 2002 23:54:32 -0000 1.3.2.1
@@ -17,16 +17,48 @@
import javax.xml.parsers.DocumentBuilderFactory;
import xdoclet.GenerationManager;
+import xdoclet.util.Log;
+import org.apache.log4j.Category;
/**
* Finds optional subtasks and registers them with the core.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Aslak Helles�y</a>
* @created 7. april 2002
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.3.2.1 $
*/
public class ModuleFinder
{
+ public static File getXDocletJar()
+ {
+ return getJar( ModuleFinder.class, "xdoclet.jar" );
+ }
+
+ public static File getJar( Class clazz, String name )
+ {
+ String jarFileName =
clazz.getProtectionDomain().getCodeSource().getLocation().getFile();
+
+ if( jarFileName != null && jarFileName.startsWith( "/" ) )
+ {
+ jarFileName = jarFileName.substring( 1 );
+ }
+
+ File jar = new File( jarFileName );
+
+ if( !jar.getAbsolutePath().endsWith( name ) )
+ {
+ // For some weird reason, the jar points to ant.jar if the
desired jar isn't on the system classpath.
+ // This is a hack around that until we find a better solution
+ System.err.println( "Was looking for " + name + ", but found :
" + jar.getAbsolutePath() );
+ jar = new File( jar.getParentFile(), name );
+
+ if( !jar.exists() )
+ {
+ throw new IllegalStateException( "You have to put " +
name + " under " + jar.getParentFile().getAbsolutePath() );
+ }
+ }
+ return jar;
+ }
public List findModules()
{
@@ -34,7 +66,7 @@
XDocletXmlParser parser = new XDocletXmlParser();
// find out where our own jar is.
- File myJar = BootstrapClassLoader.getXDocletJar();
+ File myJar = getXDocletJar();
// find all the other jar files in same dir.
File[] siblings = myJar.getParentFile().listFiles();
1.2.2.1 +2 -14 xdoclet/core/src/xdoclet/loader/TagHandlerDefinition.java
Index: TagHandlerDefinition.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/core/src/xdoclet/loader/TagHandlerDefinition.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -w -r1.2 -r1.2.2.1
--- TagHandlerDefinition.java 9 Apr 2002 00:07:16 -0000 1.2
+++ TagHandlerDefinition.java 27 Apr 2002 23:54:32 -0000 1.2.2.1
@@ -10,7 +10,7 @@
* @author Aslak Helles�y
* @created 7. april 2002
*/
-class TagHandlerDefinition
+public class TagHandlerDefinition
{
/**
* @todo-javadoc Describe the field
@@ -19,7 +19,7 @@
/**
* @todo-javadoc Describe the field
*/
- private final String className;
+ public final String className;
/**
* Describe what the TagHandlerDefinition constructor does
@@ -34,17 +34,5 @@
{
this.namespace = namespace;
this.className = className;
- }
-
- /**
- * Gets the TagHandler attribute of the TagHandlerDefinition object
- *
- * @return The TagHandler value
- * @exception Exception Describe the exception
- * @todo-javadoc Write javadocs for exception
- */
- public TemplateTagHandler getTagHandler() throws Exception
- {
- return ( TemplateTagHandler ) Class.forName( className ).newInstance();
}
}
1.1.2.1 +1 -6 xdoclet/core/src/xdoclet/loader/SubTaskDefinition.java
Index: SubTaskDefinition.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/loader/SubTaskDefinition.java,v
retrieving revision 1.1
retrieving revision 1.1.2.1
diff -u -w -r1.1 -r1.1.2.1
--- SubTaskDefinition.java 7 Apr 2002 21:12:33 -0000 1.1
+++ SubTaskDefinition.java 27 Apr 2002 23:54:32 -0000 1.1.2.1
@@ -6,7 +6,7 @@
/**
* @created 7. april 2002
*/
-class SubTaskDefinition
+public class SubTaskDefinition
{
public final String name;
public final String implementationClass;
@@ -16,10 +16,5 @@
this.name = name;
this.implementationClass = implementationClass;
this.parentTaskClass = parentTaskClass;
- }
-
- public String createMethodName()
- {
- return "create" + name.substring( 0, 1 ).toUpperCase() +
name.substring( 1 );
}
}
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel