use of com.sun.javadoc.MethodDoc in project rest.li by linkedin.
the class RestLiDoclet method start.
/**
* Entry point for Javadoc Doclet.
*
* @param root {@link RootDoc} passed in by Javadoc
* @return is successful or not
*/
public static boolean start(RootDoc root) {
final DocInfo docInfo = new DocInfo();
for (ClassDoc classDoc : root.classes()) {
docInfo.setClassDoc(classDoc.qualifiedName(), classDoc);
for (MethodDoc methodDoc : classDoc.methods()) {
docInfo.setMethodDoc(MethodIdentity.create(methodDoc), methodDoc);
}
}
_currentDocLet = new RestLiDoclet(docInfo);
return true;
}
use of com.sun.javadoc.MethodDoc in project zm-mailbox by Zimbra.
the class DocletApiListener method processClass.
private void processClass(ClassDoc classDoc) {
ApiClassDocumentation doc = new ApiClassDocumentation();
processClassTags(doc, classDoc.tags());
for (FieldDoc fieldDoc : classDoc.fields()) {
processFieldTags(doc, fieldDoc);
}
for (MethodDoc methodDoc : classDoc.methods()) {
processMethodTags(doc, methodDoc);
}
if (doc.hasDocumentation()) {
docMap.put(classDoc.toString(), doc);
}
}
use of com.sun.javadoc.MethodDoc in project jangaroo-tools by CoreMedia.
the class MethodDocImpl method overriddenMethod.
public MethodDoc overriddenMethod() {
ClassDoc superClass = containingClass().superclass();
while (superClass != null) {
MethodDoc superMethodDoc = getSuperMethodDoc(superClass);
if (superMethodDoc != null)
return superMethodDoc;
superClass = superClass.superclass();
}
return null;
}
use of com.sun.javadoc.MethodDoc in project RESTdoclet by IG-Group.
the class MethodBuilder method build.
/**
* Populate a Method type
*
* @param method type to populate
* @param methodDoc method doc
* @param baseUri controller base uri
* @return populated type
*/
public Method build(Method method, final MethodDoc methodDoc, final String baseUri) {
assert method != null;
assert methodDoc != null;
LOG.info("Initialising method: " + methodDoc);
MethodDoc md = DocletUtils.findMethodDocumentation(methodDoc);
initName(method, methodDoc);
initRequestMethod(method, methodDoc);
initProduces(method, methodDoc);
initConsumes(method, methodDoc);
initHeaders(method, methodDoc);
initJavadoc(method, md);
initRequestParams(method, methodDoc.parameters(), md.paramTags());
initPathParams(method, methodDoc.parameters(), md.paramTags());
initModelParams(method, methodDoc.parameters(), md.paramTags());
initBodyParams(method, methodDoc.parameters(), md.paramTags());
initRestParams(method, methodDoc, baseUri);
initResponseParams(method, methodDoc);
return method;
}
use of com.sun.javadoc.MethodDoc in project RESTdoclet by IG-Group.
the class DocletUtils method findMethodDocumentation.
public static MethodDoc findMethodDocumentation(final MethodDoc methodDoc) {
// Look in parent class for javadoc
if (methodDoc.commentText().contains("@inheritDoc")) {
ClassDoc containingClass = methodDoc.containingClass();
ClassDoc superClass = containingClass.superclass().asClassDoc();
for (MethodDoc md : superClass.methods()) {
if (md.name().equalsIgnoreCase(methodDoc.name()) && md.signature().equalsIgnoreCase(methodDoc.signature())) {
return md;
}
}
// Look in interfaces for javadoc
for (ClassDoc cd : containingClass.interfaces()) {
for (MethodDoc md : cd.methods()) {
if (md.name().equalsIgnoreCase(methodDoc.name()) && md.signature().equalsIgnoreCase(methodDoc.signature())) {
return md;
}
}
}
}
return methodDoc;
}
Aggregations