in log4j-docgen/src/main/java/org/apache/logging/log4j/docgen/processor/DescriptorGenerator.java [409:442]
private void populatePlugin(final TypeElement element, final PluginType pluginType) {
final ElementImports imports = importsFactory.ofElement(element);
final String qualifiedClassName = element.getQualifiedName().toString();
populateType(element, imports, qualifiedClassName, pluginType);
// Supertypes
registerSupertypes(element).forEach(pluginType::addSupertype);
// Plugin factory
for (final Element member : element.getEnclosedElements()) {
if (member instanceof ExecutableElement
&& !annotations.hasDeprecatedAnnotation(member)
&& annotations.hasFactoryAnnotation(member)) {
final ExecutableElement executable = (ExecutableElement) member;
final Map<String, String> descriptions =
getParameterDescriptions(executable, imports, qualifiedClassName);
final List<? extends VariableElement> parameters = executable.getParameters();
if (parameters.isEmpty()) {
// We have a builder
final TypeElement returnType = getReturnType(executable);
if (returnType != null) {
populateConfigurationProperties(
imports, qualifiedClassName, getAllMembers(returnType), descriptions, pluginType);
} else {
messager.printMessage(
Diagnostic.Kind.WARNING,
"The return type of a @PluginFactory annotated method should be a concrete class.",
member);
}
} else {
// Old style factory method
populateConfigurationProperties(imports, qualifiedClassName, parameters, descriptions, pluginType);
}
}
}
}