Author: [email protected]
Date: Wed Jan 18 14:33:48 2012
New Revision: 1928
Log:
Version 1.0.1 Improved logging
Modified:
sandbox/ivol/amdatu-commons/rest-doclet/pom.xml
sandbox/ivol/amdatu-commons/rest-doclet/src/main/java/org/amdatu/commons/restdoclet/JaxbBeanHelper.java
sandbox/ivol/amdatu-commons/rest-doclet/src/main/java/org/amdatu/commons/restdoclet/RESTDoclet.java
Modified: sandbox/ivol/amdatu-commons/rest-doclet/pom.xml
==============================================================================
--- sandbox/ivol/amdatu-commons/rest-doclet/pom.xml (original)
+++ sandbox/ivol/amdatu-commons/rest-doclet/pom.xml Wed Jan 18 14:33:48 2012
@@ -24,7 +24,7 @@
</parent>
<artifactId>org.amdatu.commons.restdoclet</artifactId>
<packaging>jar</packaging>
- <version>1.0.0</version>
+ <version>1.0.1</version>
<name>Amdatu Commons - REST Doclet</name>
<description>A doclet to generate REST documentation</description>
Modified:
sandbox/ivol/amdatu-commons/rest-doclet/src/main/java/org/amdatu/commons/restdoclet/JaxbBeanHelper.java
==============================================================================
---
sandbox/ivol/amdatu-commons/rest-doclet/src/main/java/org/amdatu/commons/restdoclet/JaxbBeanHelper.java
(original)
+++
sandbox/ivol/amdatu-commons/rest-doclet/src/main/java/org/amdatu/commons/restdoclet/JaxbBeanHelper.java
Wed Jan 18 14:33:48 2012
@@ -1,3 +1,18 @@
+/*
+ * Copyright (c) 2010, 2011 The Amdatu Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
package org.amdatu.commons.restdoclet;
import java.io.StringWriter;
@@ -12,6 +27,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
+@SuppressWarnings({"restriction", "rawtypes", "unchecked"})
public class JaxbBeanHelper {
private final static Gson GSON = new
GsonBuilder().setPrettyPrinting().create();
Modified:
sandbox/ivol/amdatu-commons/rest-doclet/src/main/java/org/amdatu/commons/restdoclet/RESTDoclet.java
==============================================================================
---
sandbox/ivol/amdatu-commons/rest-doclet/src/main/java/org/amdatu/commons/restdoclet/RESTDoclet.java
(original)
+++
sandbox/ivol/amdatu-commons/rest-doclet/src/main/java/org/amdatu/commons/restdoclet/RESTDoclet.java
Wed Jan 18 14:33:48 2012
@@ -35,7 +35,6 @@
import com.sun.javadoc.RootDoc;
public class RESTDoclet {
-
private final static String EOL = System.getProperty("line.separator");
private static File m_file = null;
@@ -43,12 +42,16 @@
private static ClassAnalyzer m_classAnalyzer = new ClassAnalyzer();
public static void main(String[] args) {
+ log("Executing RESTDoclet");
com.sun.tools.javadoc.Main.execute(new String[] { "@options",
"@packages" });
}
+
+ private static void log(String msg) {
+ System.out.println("[INFO] " + msg);
+ }
public static boolean start(RootDoc root) throws Exception {
- System.out.println("***** Generating REST dcoumentation for " +
root.getClass().toString() + " *****");
-
+ log("Generating REST dcoumentation");
// Initialize the sourec class loader
m_classAnalyzer.setSourceClassLoader(createSourceClassLoader(root));
@@ -71,7 +74,7 @@
handle(docClasses[i]);
}
}
- System.out.println("***** DONE ****");
+ log("Finished REST documentation");
return true;
}
@@ -127,7 +130,7 @@
}
private static void handle(ClassDoc classDoc) throws Exception {
- System.out.println("> Generating documentation for REST resource " +
classDoc);
+ log(" Generating documentation for REST resource " + classDoc.name());
// Initialize the result .html file
initFile(classDoc);
@@ -143,6 +146,8 @@
}
finishFile(classDoc);
+ log(" Documentation written to file '" + m_file.getAbsolutePath() +
File.separator + m_file.getName() + "'");
+ log(" Finished documentation for REST resource " + classDoc);
}
private static void initFile(ClassDoc classDoc) throws IOException {
@@ -177,7 +182,7 @@
}
private static void handle(ClassDoc classDoc, MethodDoc methodDoc) throws
Exception {
- System.out.println("> Generating documentation for HTTP method " +
methodDoc);
+ log(" Generating documentation for HTTP method " +
methodDoc.name());
Collection<String> lines = new ArrayList<String>();
lines.add("<h3><a href='#'>" +
m_classAnalyzer.getHTTPMethod(methodDoc) + " "
@@ -197,8 +202,6 @@
lines.add(getRow("Response", m_classAnalyzer.getReturn(methodDoc)));
lines.add("</table></div>");
FileUtils.writeLines(m_file, lines, EOL, true);
- System.out.println("Documentation written to file '" +
m_file.getAbsolutePath() + File.separator
- + m_file.getName() + "'");
}
private static String getRow(String key, String value) {
_______________________________________________
Amdatu-commits mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-commits