jesse 2003/04/29 16:59:40
Modified: proposal/xdocs/src/org/apache/ant/xdoclet AntSubTask.java
TaskDescriptorSubTask.java TaskTagsHandler.java
Log:
Switch to using regular collections instead of the deprecated XCollections
Revision Changes Path
1.3 +3 -3
ant/proposal/xdocs/src/org/apache/ant/xdoclet/AntSubTask.java
Index: AntSubTask.java
===================================================================
RCS file:
/home/cvs/ant/proposal/xdocs/src/org/apache/ant/xdoclet/AntSubTask.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AntSubTask.java 29 Apr 2003 22:36:18 -0000 1.2
+++ AntSubTask.java 29 Apr 2003 23:59:40 -0000 1.3
@@ -74,10 +74,9 @@
*
* @param clazz
* @return
- * @exception XDocletException
* @todo perhaps make deprecation switch
configurable
*/
- public final static boolean isAntTask(XClass clazz) throws
XDocletException
+ public final static boolean isAntTask(XClass clazz)
{
if (clazz.isAbstract()) {
return false;
@@ -153,7 +152,8 @@
protected void startProcess() throws XDocletException
{
XJavaDoc xjd = new XJavaDoc();
- Collection classes = xjd.getSourceClasses(false,
processInnerClasses());
+ xjd.setUseNodeParser(false);
+ xjd.getSourceClasses();
super.startProcess();
}
1.2 +2 -10
ant/proposal/xdocs/src/org/apache/ant/xdoclet/TaskDescriptorSubTask.java
Index: TaskDescriptorSubTask.java
===================================================================
RCS file:
/home/cvs/ant/proposal/xdocs/src/org/apache/ant/xdoclet/TaskDescriptorSubTask.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TaskDescriptorSubTask.java 29 Apr 2003 19:42:00 -0000 1.1
+++ TaskDescriptorSubTask.java 29 Apr 2003 23:59:40 -0000 1.2
@@ -55,17 +55,9 @@
package org.apache.ant.xdoclet;
import java.io.File;
-import java.util.Collection;
-import java.util.Iterator;
-import xjavadoc.XClass;
-import xjavadoc.XJavaDoc;
-import xjavadoc.XMethod;
-
-import xdoclet.TemplateSubTask;
import xdoclet.XDocletException;
-import xdoclet.XDocletTagSupport;
-import xdoclet.util.TypeConversionUtil;
+import xjavadoc.XClass;
/**
* Generates Ant task descriptors.
1.2 +11 -40
ant/proposal/xdocs/src/org/apache/ant/xdoclet/TaskTagsHandler.java
Index: TaskTagsHandler.java
===================================================================
RCS file:
/home/cvs/ant/proposal/xdocs/src/org/apache/ant/xdoclet/TaskTagsHandler.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- TaskTagsHandler.java 29 Apr 2003 19:42:00 -0000 1.1
+++ TaskTagsHandler.java 29 Apr 2003 23:59:40 -0000 1.2
@@ -67,9 +67,7 @@
import org.apache.tools.ant.IntrospectionHelper;
import org.apache.tools.ant.types.EnumeratedAttribute;
-import xjavadoc.TagIterator;
import xjavadoc.XClass;
-import xjavadoc.XCollections;
import xjavadoc.XMethod;
import xjavadoc.XParameter;
import xjavadoc.XTag;
@@ -146,15 +144,9 @@
/**
* Provides the Ant task name. Order of rules:
- * <ol>
- * <li> Value of
*
* @param clazz
- * @return
- * @ant:task name="..."</li>
- * <li> Lowercased classname with "Task" suffix removed</li>
- * </ol>
- *
+ * @return Lowercased classname with "Task" suffix removed
*/
public final static String getTaskName(XClass clazz)
{
@@ -216,29 +208,6 @@
}
}
-// /**
-// * Iterates over all Ant attributes.
-// *
-// * @param template XDoclet template
-// * @param attributes Tag parameters
-// * @exception XDocletException Oops!
-// */
-// public void forAllAttributes(String template, Properties attributes)
throws XDocletException
-// {
-// // throw exception if not an Ant task
-//
-// XClass cur_class = getCurrentClass();
-//
-// XMethod[] methods = getAttributeMethods(cur_class);
-//
-//// System.out.println("# attributes = " + methods.length);
-//
-// for (int i = 0; i < methods.length; i++) {
-// setCurrentMethod(methods[i]);
-// generate(template);
-// }
-// }
-
/**
* Iterates over all Ant attributes.
*
@@ -318,8 +287,8 @@
{
Collection tags =
getCurrentClass().getDoc().getTags("ant.attribute.group");
- for (TagIterator t = XCollections.tagIterator(tags); t.hasNext(); ) {
- setCurrentClassTag(t.next());
+ for (Iterator t = tags.iterator(); t.hasNext(); ) {
+ setCurrentClassTag((XTag) t.next());
generate(template);
}
@@ -379,7 +348,7 @@
public String displayAttributeType() throws XDocletException
{
Collection parameters = getCurrentMethod().getParameters();
- XParameter param = XCollections.parameterIterator(parameters).next();
+ XParameter param = (XParameter) parameters.iterator().next();
String methodType = param.getType().getQualifiedName();
String display = (String) attributeDisplayMap.get(methodType);
@@ -610,7 +579,8 @@
continue;
}
- String attributeType =
XCollections.parameterIterator(method.getParameters()).next().getType().getQualifiedName();
+ Iterator it = method.getParameters().iterator();
+ String attributeType = ((XParameter)
it.next()).getType().getQualifiedName();
// System.out.println("attributeType = " + attributeType);
@@ -713,7 +683,8 @@
if (method.getParameters().size() != 1) {
continue;
}
- elementType =
XCollections.parameterIterator(method.getParameters()).next().getType().getQualifiedName();
+ Iterator it = method.getParameters().iterator();
+ elementType = ((XParameter)
it.next()).getType().getQualifiedName();
}
else {
elementType =
method.getReturnType().getType().getQualifiedName();
@@ -748,9 +719,8 @@
*
* @param cur_class
* @return
- * @exception XDocletException
*/
- private XMethod[] getMethods(XClass cur_class) throws XDocletException
+ private XMethod[] getMethods(XClass cur_class)
{
Map already = new HashMap();
@@ -829,7 +799,8 @@
Collection params = getCurrentMethod().getParameters();
if (params.size() == 1) {
- clazz =
XCollections.parameterIterator(params).next().getType();
+ Iterator it = params.iterator();
+ clazz = ((XParameter)it.next()).getType();
}
}
}