use of com.sun.javadoc.Parameter in project cxf by apache.
the class DumpJavaDoc method start.
public static boolean start(RootDoc root) throws IOException {
String dumpFileName = readOptions(root.options());
OutputStream os = Files.newOutputStream(Paths.get(dumpFileName));
Properties javaDocMap = new Properties();
for (ClassDoc classDoc : root.classes()) {
javaDocMap.put(classDoc.toString(), classDoc.commentText());
for (MethodDoc method : classDoc.methods()) {
javaDocMap.put(method.qualifiedName(), method.commentText());
for (ParamTag paramTag : method.paramTags()) {
Parameter[] parameters = method.parameters();
for (int i = 0; i < parameters.length; ++i) {
if (parameters[i].name().equals(paramTag.parameterName())) {
javaDocMap.put(method.qualifiedName() + ".paramCommentTag." + i, paramTag.parameterComment());
}
}
}
Tag[] retTags = method.tags("return");
if (retTags != null && retTags.length == 1) {
Tag retTag = method.tags("return")[0];
javaDocMap.put(method.qualifiedName() + "." + "returnCommentTag", retTag.text());
}
}
}
javaDocMap.store(os, "");
os.flush();
os.close();
return true;
}
use of com.sun.javadoc.Parameter in project RESTdoclet by IG-Group.
the class MethodBuilder method initPathParams.
/**
* Initialises the path-parameters of this method.
*
* @param params the method's path parameters.
* @param tags the parameters' Java documentation tags.
*/
private void initPathParams(Method method, final Parameter[] params, final ParamTag[] tags) {
LOG.debug(method.getName());
ArrayList<PathParameter> pathParams = new ArrayList<PathParameter>();
for (Parameter param : params) {
if (isAnnotated(param, PathVariable.class)) {
pathParams.add(new PathParameterBuilder().build(new PathParameter(), param, tags));
}
}
method.setPathParams(pathParams);
}
use of com.sun.javadoc.Parameter in project RESTdoclet by IG-Group.
the class MethodBuilder method initModelParams.
/**
* Initialises the model-parameters of this method.
*
* @param params the method's parameters.
* @param tags the parameters' Java documentation tags.
*/
private void initModelParams(Method method, final Parameter[] params, final ParamTag[] tags) {
LOG.debug(method.getName());
ArrayList<ModelParameter> modelParams = new ArrayList<ModelParameter>();
for (Parameter param : params) {
if (isAnnotated(param, ModelAttribute.class)) {
modelParams.add(new ModelParameterBuilder().build(new ModelParameter(), param, tags));
}
}
method.setModelParams(modelParams);
}
use of com.sun.javadoc.Parameter in project Orchid by JavaEden.
the class ParameterParser method getParameters.
public JSONArray getParameters(ExecutableMemberDoc doc) {
JSONArray array = new JSONArray();
for (Parameter parameter : doc.parameters()) {
JSONObject object = new JSONObject();
object.put("type", typeParser.getTypeObject(parameter.type()));
object.put("name", parameter.name());
for (ParamTag paramTag : doc.paramTags()) {
if (parameter.name().equals(paramTag.parameterName())) {
object.put("description", paramTag.parameterComment());
}
}
array.put(object);
}
return (array.length() > 0) ? array : null;
}
Aggregations