User: rinkrank
Date: 02/03/17 14:48:02
Modified: src/xjavadoc BinaryClass.java
Log:
fixed dimensions in returnType and parameter (I hope)
Revision Changes Path
1.8 +34 -4 xjavadoc/src/xjavadoc/BinaryClass.java
Index: BinaryClass.java
===================================================================
RCS file: /cvsroot/xdoclet/xjavadoc/src/xjavadoc/BinaryClass.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -r1.7 -r1.8
--- BinaryClass.java 10 Mar 2002 17:56:00 -0000 1.7
+++ BinaryClass.java 17 Mar 2002 22:48:02 -0000 1.8
@@ -184,14 +184,18 @@
xmethod.addModifier(methods[i].getModifiers());
populateExecutableMember(xmethod, methods[i]);
Class returnType = methods[i].getReturnType();
- xmethod.setReturnType(returnType.getName());
+
+ String typeName = getTypeName(returnType);
+ int dimension = getDimension(returnType);
+
+ xmethod.setReturnType(typeName);
+ xmethod.setReturnDimension(dimension);
addMethod(xmethod);
}
}
/**
- * @todo fix dimensions (1)
* @param executableMember Describe what the parameter does
* @param accessibleObject Describe what the parameter does
* @todo-javadoc Write javadocs for method parameter
@@ -211,11 +215,37 @@
exceptions = ((Method)accessibleObject).getExceptionTypes();
}
for (int i = parameters.length - 1; i >= 0; i--) {
- // TODO 1
- executableMember.addParameterData(parameters[i].getName(), "p"
+ i, 0);
+ String typeName = getTypeName(parameters[i]);
+ int dimension = getDimension(parameters[i]);
+ executableMember.addParameterData(typeName, "p" + i,
dimension);
}
for (int i = exceptions.length - 1; i >= 0; i--) {
executableMember.addThrownException(exceptions[i].getName());
}
}
+
+
+ /**
+ * Gets the Dimension attribute of the BinaryClass class
+ *
+ * @param c Describe what the parameter does
+ * @return The Dimension value
+ * @todo-javadoc Write javadocs for method parameter
+ */
+ private static int getDimension(Class c) {
+ return c.getName().lastIndexOf('[') + 1;
+ }
+
+
+ /**
+ * Gets the TypeName attribute of the BinaryClass class
+ *
+ * @param c Describe what the parameter does
+ * @return The TypeName value
+ * @todo-javadoc Write javadocs for method parameter
+ */
+ private static String getTypeName(Class c) {
+ return c.getComponentType() != null ? c.getComponentType().getName() :
c.getName();
+ }
+
}
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel