use of org.mule.runtime.module.extension.internal.capability.xml.schema.MethodDocumentation in project mule by mulesoft.
the class SourcesDescriptionDocumenter method documentCallback.
private void documentCallback(Map<String, Element> methods, SourceCallbackDeclaration cb) {
Element method = methods.get(cb.getName());
if (method != null) {
MethodDocumentation documentation = processor.getMethodDocumentation(processingEnv, method);
parameterDeclarer.document(cb, method, documentation);
}
}
use of org.mule.runtime.module.extension.internal.capability.xml.schema.MethodDocumentation in project mule by mulesoft.
the class OperationDescriptionDocumenter method documentOperations.
private void documentOperations(WithOperationsDeclaration<?> declaration, Map<String, Element> methods) {
for (OperationDeclaration operation : declaration.getOperations()) {
Element method = methods.get(operation.getName());
// the one which defined the operation being processed
if (method == null) {
continue;
}
MethodDocumentation documentation = processor.getMethodDocumentation(processingEnv, method);
operation.setDescription(documentation.getSummary());
parameterDeclarer.document(operation, method, documentation);
}
}
use of org.mule.runtime.module.extension.internal.capability.xml.schema.MethodDocumentation in project mule by mulesoft.
the class ParameterDescriptionDocumenter method document.
/**
* Describes parameters that are defined as Method parameters.
*/
void document(ParameterizedDeclaration<?> parameterized, Element method, MethodDocumentation documentation) {
parameterized.getAllParameters().forEach(p -> {
String description = documentation.getParameters().get(p.getName());
if (description != null) {
p.setDescription(description);
}
});
if (method instanceof ExecutableElement) {
((ExecutableElement) method).getParameters().stream().filter(e -> e.getAnnotation(ParameterGroup.class) != null).forEach(group -> {
TypeElement typeElement = (TypeElement) processingEnv.getTypeUtils().asElement(group.asType());
document(parameterized, typeElement);
});
}
}
Aggregations