User: pathoss
Date: 02/05/12 06:13:22
Modified: modules/xdoclet/src/xdoclet/modules/doc Tag:
MODULE_REFACTORING_BRANCH DocumentDocletTask.java
DocumentTagsSubTask.java
DocumentationTagsHandler.java
Log:
Refactored. The thing compiles now :)
Revision Changes Path
No revision
No revision
1.1.2.4 +7 -6
xdoclet/modules/xdoclet/src/xdoclet/modules/doc/Attic/DocumentDocletTask.java
Index: DocumentDocletTask.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/xdoclet/src/xdoclet/modules/doc/Attic/DocumentDocletTask.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -w -r1.1.2.3 -r1.1.2.4
--- DocumentDocletTask.java 27 Apr 2002 23:54:33 -0000 1.1.2.3
+++ DocumentDocletTask.java 12 May 2002 13:13:22 -0000 1.1.2.4
@@ -9,9 +9,10 @@
/**
* @author Ara Abrahamian ([EMAIL PROTECTED])
* @created June 19, 2001
- * @version $Revision: 1.1.2.3 $
+ * @version $Revision: 1.1.2.4 $
* @todo Remove this class. It does not add any functionality. (Aslak)
*/
-public class DocumentDocletTask extends DocletTask {
+public class DocumentDocletTask extends DocletTask
+{
}
1.1.2.5 +278 -332
xdoclet/modules/xdoclet/src/xdoclet/modules/doc/Attic/DocumentTagsSubTask.java
Index: DocumentTagsSubTask.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/xdoclet/src/xdoclet/modules/doc/Attic/DocumentTagsSubTask.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -w -r1.1.2.4 -r1.1.2.5
--- DocumentTagsSubTask.java 29 Apr 2002 19:14:24 -0000 1.1.2.4
+++ DocumentTagsSubTask.java 12 May 2002 13:13:22 -0000 1.1.2.5
@@ -4,11 +4,6 @@
*/
package xdoclet.modules.doc;
-import xdoclet.TemplateSubTask;
-import xdoclet.XDocletException;
-import xdoclet.template.TemplateEngine;
-import xdoclet.util.Translator;
-
import java.io.File;
import java.io.IOException;
import java.text.MessageFormat;
@@ -16,135 +11,104 @@
import xjavadoc.XClass;
+import xdoclet.TemplateSubTask;
+import xdoclet.XDocletException;
+import xdoclet.template.TemplateEngine;
+import xdoclet.util.Translator;
+
/**
* Extracts doc:blabla tags from xdoclet.* sources and generates an html file
* describing the tags and their parameters.
*
- * @xdoclet:subtask name="documenttags"
parent="xdoclet.modules.doc.DocumentDocletTask"
- * @todo use DocletTask as parent instead. should be enough.
- *
* @author Ara Abrahamian ([EMAIL PROTECTED])
* @created June 19, 2001
- * @version $Revision: 1.1.2.4 $
- */
-public class DocumentTagsSubTask extends TemplateSubTask {
-
- /**
- * @todo-javadoc Describe the field
- */
- private Namespace currentNamespace;
- /**
- * @todo-javadoc Describe the field
- */
- private ArrayList namespaces = new ArrayList();
- /**
- * @todo-javadoc Describe the field
- */
- private Properties tagMappings = new Properties();
- /**
- * @todo-javadoc Describe the field
+ * @xdoclet:subtask name="documenttags"
+ * parent="xdoclet.modules.doc.DocumentDocletTask"
+ * @todo use DocletTask as parent instead. should be enough.
+ * @version $Revision: 1.1.2.5 $
*/
+public class DocumentTagsSubTask extends TemplateSubTask
+{
public final static String SUBTASK_NAME = "documentTags";
- /**
- * @todo-javadoc Describe the field
- */
private static String NAMESPACES_TEMPLATE_FILE = "resources/namespaces.xdt";
- /**
- * @todo-javadoc Describe the field
- */
+
private static String GENERATED_NAMESPACES_FILE_NAME = "namespaces.html";
- /**
- * @todo-javadoc Describe the field
- */
private static String TAGS_MAIN_TEMPLATE_FILE = "resources/tags_main.xdt";
- /**
- * @todo-javadoc Describe the field
- */
+
private static String GENERATED_TAGS_MAIN_FILE_NAME = "tags.html";
- /**
- * @todo-javadoc Describe the field
- */
private static String TAGS_TOC_MAIN_TEMPLATE_FILE =
"resources/tags_toc_main.xdt";
- /**
- * @todo-javadoc Describe the field
- */
+
private static String GENERATED_TAGS_TOC_MAIN_FILE_NAME = "tags_toc.html";
- /**
- * @todo-javadoc Describe the field
- */
private static String TAGS_TOC_TEMPLATE_FILE = "resources/tags_toc.xdt";
- /**
- * @todo-javadoc Describe the field
- */
+
private static String GENERATED_TAGS_TOC_FILE_NAME = "{0}_toc.html";
- /**
- * @todo-javadoc Describe the field
- */
private static String TAGS_TEMPLATE_FILE = "resources/tags.xdt";
- /**
- * @todo-javadoc Describe the field
- */
+
private static String GENERATED_TAGS_FILE_NAME = "{0}.html";
+ private Namespace currentNamespace;
+
+ private ArrayList namespaces = new ArrayList();
+
+ private Properties tagMappings = new Properties();
/**
* Gets the SubTaskName attribute of the DocumentTagsSubTask object
*
* @return The SubTaskName value
*/
- public String getSubTaskName() {
+ public String getSubTaskName()
+ {
return SUBTASK_NAME;
}
-
/**
* Gets the CurrentNamespace attribute of the DocumentTagsSubTask object
*
* @return The CurrentNamespace value
*/
- public Namespace getCurrentNamespace() {
+ public Namespace getCurrentNamespace()
+ {
return currentNamespace;
}
-
/**
* Gets the Namespaces attribute of the DocumentTagsSubTask object
*
* @return The Namespaces value
*/
- public ArrayList getNamespaces() {
+ public ArrayList getNamespaces()
+ {
return namespaces;
}
-
/**
* Gets the TagMappings attribute of the DocumentTagsSubTask object
*
* @return The TagMappings value
*/
- public Properties getTagMappings() {
+ public Properties getTagMappings()
+ {
return tagMappings;
}
-
/**
* Describe what the method does
*
* @exception XDocletException Describe the exception
- * @todo-javadoc Write javadocs for method
- * @todo-javadoc Write javadocs for exception
*/
- public void execute() throws XDocletException {
+ public void execute() throws XDocletException
+ {
Properties tag_handler_mappings = loadTagMappings();
- Set entry_set = tag_handler_mappings.entrySet();
+ Set entrySet = tag_handler_mappings.entrySet();
- for (Iterator iterator = entry_set.iterator(); iterator.hasNext(); ) {
+ for (Iterator iterator = entrySet.iterator(); iterator.hasNext(); ) {
Map.Entry entry = (Map.Entry)iterator.next();
namespaces.add(new Namespace((String)entry.getKey(),
(String)entry.getValue()));
@@ -182,55 +146,50 @@
startProcess();
}
-
/**
* Gets the GeneratedFileName attribute of the DocumentTagsSubTask object
*
* @param clazz Describe what the parameter does
* @return The GeneratedFileName value
* @exception XDocletException Describe the exception
- * @todo-javadoc Write javadocs for method parameter
- * @todo-javadoc Write javadocs for exception
*/
- protected String getGeneratedFileName(XClass clazz) throws XDocletException {
- String dest_file = MessageFormat.format(getDestinationFile(), new
Object[]{currentNamespace.getName()});
+ protected String getGeneratedFileName(XClass clazz) throws XDocletException
+ {
+ String destinationFile = MessageFormat.format(getDestinationFile(), new
Object[]{currentNamespace.getName()});
- return new File(dest_file).toString();
+ return new File(destinationFile).toString();
}
-
/**
* Processed template for clazz and generates output file for clazz.
*
* @param clazz Description of Parameter
* @exception XDocletException Description of Exception
*/
- protected void generateForClass(XClass clazz) throws XDocletException {
+ protected void generateForClass(XClass clazz) throws XDocletException
+ {
setCurrentNamespace(clazz);
super.generateForClass(clazz);
}
-
/**
* Describe what the method does
*
* @exception XDocletException Describe the exception
- * @todo-javadoc Write javadocs for method
- * @todo-javadoc Write javadocs for exception
*/
- protected void engineStarted() throws XDocletException {
+ protected void engineStarted() throws XDocletException
+ {
}
-
/**
* Sets the CurrentNamespace attribute of the DocumentTagsSubTask object
*
* @param clazz The new CurrentNamespace value
* @exception XDocletException Describe the exception
- * @todo-javadoc Write javadocs for exception
*/
- private void setCurrentNamespace(XClass clazz) throws XDocletException {
+ private void setCurrentNamespace(XClass clazz) throws XDocletException
+ {
for (int i = 0; i < namespaces.size(); i++) {
Namespace namespace = (Namespace)namespaces.get(i);
@@ -241,109 +200,96 @@
}
}
-
/**
* Describe what the method does
*
* @return Describe the return value
* @exception XDocletException Describe the exception
- * @todo-javadoc Write javadocs for method
- * @todo-javadoc Write javadocs for return value
- * @todo-javadoc Write javadocs for exception
*/
- private Properties loadTagMappings() throws XDocletException {
+ private Properties loadTagMappings() throws XDocletException
+ {
//we should reload it here directly, because TemplateEngine may also
have
//non-default handlers registered by TagDef.
try {
tagMappings.load(getClass().getResourceAsStream(TemplateEngine.TAG_MAPPINGS_FILE));
- } catch (IOException e) {
+ }
+ catch (IOException e) {
throw new
XDocletException(Translator.getString("template_couldnt_load_mappings"));
}
return tagMappings;
}
-
/**
* @author Aslak Helles�y
* @created December 1, 2001
*/
- public static class Namespace implements Comparable {
- /**
- * @todo-javadoc Describe the field
- */
+ public static class Namespace implements Comparable
+ {
private String name;
- /**
- * @todo-javadoc Describe the field
- */
- private String tagsHandlerClassName;
+ private String tagsHandlerClassName;
/**
* Describe what the Namespace constructor does
*
* @param name Describe what the parameter does
* @param tagsHandlerClassName Describe what the parameter does
- * @todo-javadoc Write javadocs for constructor
- * @todo-javadoc Write javadocs for method parameter
- * @todo-javadoc Write javadocs for method parameter
*/
- public Namespace(String name, String tagsHandlerClassName) {
+ public Namespace(String name, String tagsHandlerClassName)
+ {
this.name = name;
this.tagsHandlerClassName = tagsHandlerClassName;
}
-
/**
- * Sets the Name attribute of the Namespace object
+ * Gets the Name attribute of the Namespace object
*
- * @param name The new Name value
+ * @return The Name value
*/
- public void setName(String name) {
- this.name = name;
+ public String getName()
+ {
+ return name;
}
-
/**
- * Sets the TagsHandlerClassName attribute of the Namespace object
+ * Gets the TagsHandlerClassName attribute of the Namespace object
*
- * @param tagsHandlerClassName The new TagsHandlerClassName value
+ * @return The TagsHandlerClassName value
*/
- public void setTagsHandlerClassName(String tagsHandlerClassName) {
- this.tagsHandlerClassName = tagsHandlerClassName;
+ public String getTagsHandlerClassName()
+ {
+ return tagsHandlerClassName;
}
-
/**
- * Gets the Name attribute of the Namespace object
+ * Sets the Name attribute of the Namespace object
*
- * @return The Name value
+ * @param name The new Name value
*/
- public String getName() {
- return name;
+ public void setName(String name)
+ {
+ this.name = name;
}
-
/**
- * Gets the TagsHandlerClassName attribute of the Namespace object
+ * Sets the TagsHandlerClassName attribute of the Namespace object
*
- * @return The TagsHandlerClassName value
+ * @param tagsHandlerClassName The new TagsHandlerClassName value
*/
- public String getTagsHandlerClassName() {
- return tagsHandlerClassName;
+ public void setTagsHandlerClassName(String tagsHandlerClassName)
+ {
+ this.tagsHandlerClassName = tagsHandlerClassName;
}
-
/**
* Describe what the method does
*
* @param o Describe what the parameter does
* @return Describe the return value
- * @todo-javadoc Write javadocs for method
- * @todo-javadoc Write javadocs for method parameter
- * @todo-javadoc Write javadocs for return value
*/
- public int compareTo(Object o) {
+ public int compareTo(Object o)
+ {
return this.getName().compareTo(((Namespace)o).getName());
}
}
1.1.2.2 +129 -131
xdoclet/modules/xdoclet/src/xdoclet/modules/doc/Attic/DocumentationTagsHandler.java
Index: DocumentationTagsHandler.java
===================================================================
RCS file:
/cvsroot/xdoclet/xdoclet/modules/xdoclet/src/xdoclet/modules/doc/Attic/DocumentationTagsHandler.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -w -r1.1.2.1 -r1.1.2.2
--- DocumentationTagsHandler.java 29 Apr 2002 19:00:44 -0000 1.1.2.1
+++ DocumentationTagsHandler.java 12 May 2002 13:13:22 -0000 1.1.2.2
@@ -4,37 +4,35 @@
*/
package xdoclet.modules.doc;
-import xdoclet.XDocletTagSupport;
-import xdoclet.XDocletException;
-import xdoclet.modules.doc.DocumentTagsSubTask;
+import java.util.*;
import xjavadoc.XJavaDoc;
+import xdoclet.XDocletException;
-import java.util.*;
+import xdoclet.XDocletTagSupport;
+import xdoclet.modules.doc.DocumentTagsSubTask;
/**
- * @xdoclet:taghandler namespace="Doc"
- *
* @author Ara Abrahamian ([EMAIL PROTECTED])
* @created Nov 30, 2001
- * @version $Revision: 1.1.2.1 $
- */
-public class DocumentationTagsHandler extends XDocletTagSupport {
- /**
- * @todo-javadoc Describe the field
+ * @xdoclet:taghandler namespace="Doc"
+ * @version $Revision: 1.1.2.2 $
*/
+public class DocumentationTagsHandler extends XDocletTagSupport
+{
private DocumentTagsSubTask.Namespace currentNamespace;
-
/**
- * Iterates over all template namespaces registered in /tagmappings.properties
- * file and evaluates the body of the tag for each namespace.
+ * Iterates over all template namespaces registered in
+ * /tagmappings.properties file and evaluates the body of the tag for each
+ * namespace.
*
* @param template The body of the block tag
* @exception XDocletException Description of Exception
* @doc:tag type="block"
*/
- public void forAllNamespaces(String template) throws XDocletException {
+ public void forAllNamespaces(String template) throws XDocletException
+ {
for (Iterator iterator =
getActiveDocumentTagsSubTask().getNamespaces().iterator(); iterator.hasNext(); ) {
currentNamespace =
(DocumentTagsSubTask.Namespace)iterator.next();
setCurrentClass(XJavaDoc.getInstance().getXClass(currentNamespace.getTagsHandlerClassName()));
@@ -43,7 +41,6 @@
}
}
-
/**
* Returns current namespace name. Use inside forAllNamespaces only.
*
@@ -51,11 +48,11 @@
* @exception XDocletException Description of Exception
* @doc:tag type="content"
*/
- public String namespace() throws XDocletException {
+ public String namespace() throws XDocletException
+ {
return currentNamespace.getName();
}
-
/**
* Returns current namespace tags handler class name. Use inside
* forAllNamespaces only.
@@ -64,11 +61,11 @@
* @exception XDocletException Description of Exception
* @doc:tag type="content"
*/
- public String namespaceTagsHandlerClassName() throws XDocletException {
+ public String namespaceTagsHandlerClassName() throws XDocletException
+ {
return currentNamespace.getTagsHandlerClassName();
}
-
/**
* Returns current namespace name from current class name.
*
@@ -76,19 +73,19 @@
* @exception XDocletException Description of Exception
* @doc:tag type="content"
*/
- public String namespaceFromClassName() throws XDocletException {
+ public String namespaceFromClassName() throws XDocletException
+ {
for (Iterator iterator =
getActiveDocumentTagsSubTask().getNamespaces().iterator(); iterator.hasNext(); ) {
- DocumentTagsSubTask.Namespace temp_namespace =
(DocumentTagsSubTask.Namespace)iterator.next();
+ DocumentTagsSubTask.Namespace tempNamespace =
(DocumentTagsSubTask.Namespace) iterator.next();
- if
(temp_namespace.getTagsHandlerClassName().equals(getCurrentClass().qualifiedName())) {
- return temp_namespace.getName();
+ if
(tempNamespace.getTagsHandlerClassName().equals(getCurrentClass().qualifiedName())) {
+ return tempNamespace.getName();
}
}
return null;
}
-
/**
* Returns current namespace. Used for tags_toc.j.
*
@@ -96,47 +93,48 @@
* @exception XDocletException Description of Exception
* @doc:tag type="content"
*/
- public String currentNamespace() throws XDocletException {
+ public String currentNamespace() throws XDocletException
+ {
return getActiveDocumentTagsSubTask().getCurrentNamespace().getName();
}
-
/**
- * Returns current namespace tags handler class name. Used for <namespace>.html
- * files.
+ * Returns current namespace tags handler class name. Used for <namespace>
+ * .html files.
*
* @return Current namespace name
* @exception XDocletException Description of Exception
* @doc:tag type="content"
- * @doc:param name="namespace" optional="false" description="The namesapce name
- * we lookup the handler."
+ * @doc:param name="namespace" optional="false"
+ * description="The namesapce name we lookup the handler."
*/
- public String currentNamespaceTagsHandlerClassName() throws XDocletException {
+ public String currentNamespaceTagsHandlerClassName() throws XDocletException
+ {
return
getActiveDocumentTagsSubTask().getCurrentNamespace().getTagsHandlerClassName();
}
-
/**
* Returns current namespace name. Use inside forAllNamespaces only.
*
* @return Current namespace name
* @exception XDocletException Description of Exception
* @doc:tag type="content"
- * @doc:param name="namespace" optional="false" description="The namesapce name
- * we lookup the handler."
+ * @doc:param name="namespace" optional="false"
+ * description="The namesapce name we lookup the handler."
*/
- public String currentNamespaceTagsHandlerClassNameAsDirStructure() throws
XDocletException {
+ public String currentNamespaceTagsHandlerClassNameAsDirStructure() throws
XDocletException
+ {
return currentNamespaceTagsHandlerClassName().replace('.', '/');
}
-
/**
- * Gets the ActiveDocumentTagsSubTask attribute of the DocumentationTagsHandler
- * object
+ * Gets the ActiveDocumentTagsSubTask attribute of the
+ * DocumentationTagsHandler object
*
* @return The ActiveDocumentTagsSubTask value
*/
- private DocumentTagsSubTask getActiveDocumentTagsSubTask() {
+ private DocumentTagsSubTask getActiveDocumentTagsSubTask()
+ {
return (DocumentTagsSubTask)getDocletContext().getActiveSubTask();
}
}
_______________________________________________________________
Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel