User: ara_e_w
Date: 02/03/04 13:32:41
Modified: core/src/xdoclet SubTask.java TemplateSubTask.java
Log:
- <pakageSubstitution/> is now available to TemplateSubTasks
- added an option to turn of the timestamp/etc guessing of merge point/etc of a
template
- you can set subtaskname now (pretty cool if you want to fool xdoclet!)
Revision Changes Path
1.62 +12 -2 xdoclet/core/src/xdoclet/SubTask.java
Index: SubTask.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/SubTask.java,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -w -r1.61 -r1.62
--- SubTask.java 21 Jan 2002 21:12:15 -0000 1.61
+++ SubTask.java 4 Mar 2002 21:32:41 -0000 1.62
@@ -22,7 +22,7 @@
*
* @author Ara Abrahamian ([EMAIL PROTECTED])
* @created June 16, 2001
- * @version $Revision: 1.61 $
+ * @version $Revision: 1.62 $
*/
public abstract class SubTask extends DocletSupport implements Serializable
{
@@ -42,6 +42,8 @@
private Vector configParams = new Vector();
+ private String subtaskName;
+
public Vector getConfigParams()
{
return configParams;
@@ -57,7 +59,15 @@
return mergeDir;
}
- public abstract String getSubTaskName();
+ public String getSubTaskName()
+ {
+ return subtaskName;
+ }
+
+ public void setSubTaskName( String subtaskName )
+ {
+ this.subtaskName = subtaskName;
+ }
public void setDestDir( File destDir )
{
1.27 +62 -6 xdoclet/core/src/xdoclet/TemplateSubTask.java
Index: TemplateSubTask.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/TemplateSubTask.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -w -r1.26 -r1.27
--- TemplateSubTask.java 1 Mar 2002 21:14:23 -0000 1.26
+++ TemplateSubTask.java 4 Mar 2002 21:32:41 -0000 1.27
@@ -19,10 +19,7 @@
import java.net.URL;
import java.net.MalformedURLException;
import java.text.MessageFormat;
-import java.util.Date;
-import java.util.StringTokenizer;
-import java.util.List;
-import java.util.ArrayList;
+import java.util.*;
/**
* Generates The template file specified in templateFile configuration
@@ -30,7 +27,7 @@
*
* @author Ara Abrahamian ([EMAIL PROTECTED])
* @created Sep 25, 2001
- * @version $Revision: 1.26 $
+ * @version $Revision: 1.27 $
*/
public class TemplateSubTask extends SubTask
{
@@ -93,6 +90,11 @@
*/
private String subTaskClassName = null;
+ private Vector packageSubstitutions = new Vector();
+ private boolean packageSubstitutionInheritanceSupported = true;
+
+ private boolean guessGenerationNeeded = true;
+
/**
* Converts the full qualified class name to a valid path with File.separator
* characters instead of . characters and class name postfixed by a ".java".
@@ -105,6 +107,28 @@
return className.replace( '.', '/' ) + ".java";
}
+ public Vector getPackageSubstitutions()
+ {
+ return packageSubstitutions;
+ }
+
+ public boolean isGuessGenerationNeeded()
+ {
+ return guessGenerationNeeded;
+ }
+
+ /**
+ * By default supports, but some subtasks may not support because global
+ * packageSubstitution is for public interfaces/classes, not good for impl
+ * classes.
+ *
+ * @return true
+ */
+ public boolean isPackageSubstitutionInheritanceSupported()
+ {
+ return packageSubstitutionInheritanceSupported;
+ }
+
public String getSubTaskClassName()
{
return subTaskClassName;
@@ -155,6 +179,21 @@
return prefixWithPackageStructure;
}
+ public void setGuessGenerationNeeded( boolean guessGenerationNeeded )
+ {
+ this.guessGenerationNeeded = guessGenerationNeeded;
+ }
+
+ public void setPackageSubstitutions( Vector packageSubstitutions )
+ {
+ this.packageSubstitutions = packageSubstitutions;
+ }
+
+ public void setPackageSubstitutionInheritanceSupported( boolean
packageSubstitutionInheritanceSupported )
+ {
+ this.packageSubstitutionInheritanceSupported =
packageSubstitutionInheritanceSupported;
+ }
+
public void setSubTaskClassName( String subTaskClassName )
{
this.subTaskClassName = subTaskClassName;
@@ -231,6 +270,16 @@
this.havingClassTag = havingClassTag;
}
+ /**
+ * Adds a set of files (nested fileset attribute).
+ *
+ * @param ps The feature to be added to the Fileset attribute
+ */
+ public void addPackageSubstitution( PackageTagsHandler.PackageSubstitution ps )
+ {
+ packageSubstitutions.addElement( ps );
+ }
+
public void copyAttributesFrom( TemplateSubTask src )
{
setPrefixWithPackageStructure( src.isPrefixWithPackageStructure() );
@@ -289,7 +338,7 @@
Category cat = Log.getCategory( TemplateSubTask.class,
"getGeneratedFileName" );
PackageDoc pak = clazz.containingPackage();
- String pak_name = prefixWithPackageStructure == true ?
PackageTagsHandler.packageNameAsPathFor( pak ) : null;
+ String pak_name = isPackageSubstitutionInheritanceSupported() == true
? PackageTagsHandler.packageNameAsPathFor( pak ) : null;
String dest_file = MessageFormat.format( getDestinationFile(), new
Object[]{clazz.name()} );
if( cat.isDebugEnabled() )
@@ -569,6 +618,13 @@
throws XDocletException
{
Category cat = Log.getCategory( TemplateSubTask.class, "generation" );
+
+ if( isGuessGenerationNeeded() == false )
+ {
+ if( cat.isDebugEnabled() )
+ cat.debug( "guessGenerationNeeded enabled" );
+ return true;
+ }
if( getContext().isForce() )
{
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel