Merge branch 'develop' into stable
This commit is contained in:
commit
9560c65732
@ -35,8 +35,9 @@ public class TestNamedBean {
|
|||||||
* This is an example comment for the method apiMethod3()
|
* This is an example comment for the method apiMethod3()
|
||||||
*
|
*
|
||||||
* @param param An example parameter comment.
|
* @param param An example parameter comment.
|
||||||
|
* @param classType An example generic parameter.
|
||||||
*/
|
*/
|
||||||
public void apiMethod3(String param) {
|
public <T> void apiMethod3(String param, Class<T> classType) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,10 +31,10 @@ class ActivitiApiBeanDoc {
|
|||||||
|
|
||||||
private final String beanId;
|
private final String beanId;
|
||||||
private TypeElement classElement;
|
private TypeElement classElement;
|
||||||
private boolean isDelegate = false;
|
|
||||||
private boolean isExecutionListener = false;
|
|
||||||
private boolean isTaskListener = false;
|
|
||||||
private Map<String, ExecutableElement> methodElements = new HashMap<>();
|
private Map<String, ExecutableElement> methodElements = new HashMap<>();
|
||||||
|
private ExecutableElement delegateMethodElement;
|
||||||
|
private ExecutableElement executionListenerMethodElement;
|
||||||
|
private ExecutableElement taskListenerMethodElement;
|
||||||
|
|
||||||
public ActivitiApiBeanDoc(String beanId, TypeElement classElement) {
|
public ActivitiApiBeanDoc(String beanId, TypeElement classElement) {
|
||||||
this.beanId = beanId;
|
this.beanId = beanId;
|
||||||
@ -49,7 +49,31 @@ class ActivitiApiBeanDoc {
|
|||||||
return classElement;
|
return classElement;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ActivitiApiBeanDoc addMethod(ExecutableElement method) {
|
public ExecutableElement getDelegateMethodElement() {
|
||||||
|
return delegateMethodElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDelegateMethodElement(ExecutableElement delegateMethodElement) {
|
||||||
|
this.delegateMethodElement = delegateMethodElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExecutableElement getExecutionListenerMethodElement() {
|
||||||
|
return executionListenerMethodElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutionListenerMethodElement(ExecutableElement executionListenerMethodElement) {
|
||||||
|
this.executionListenerMethodElement = executionListenerMethodElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExecutableElement getTaskListenerMethodElement() {
|
||||||
|
return taskListenerMethodElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskListenerMethodElement(ExecutableElement taskListenerMethodElement) {
|
||||||
|
this.taskListenerMethodElement = taskListenerMethodElement;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ActivitiApiBeanDoc addMethodElement(ExecutableElement method) {
|
||||||
this.methodElements.put(method.toString(), method);
|
this.methodElements.put(method.toString(), method);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
@ -71,30 +95,6 @@ class ActivitiApiBeanDoc {
|
|||||||
return methodElements;
|
return methodElements;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDelegate() {
|
|
||||||
return isDelegate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setDelegate(boolean isDelegate) {
|
|
||||||
this.isDelegate = isDelegate;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isExecutionListener() {
|
|
||||||
return isExecutionListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setExecutionListener(boolean isExecutionListener) {
|
|
||||||
this.isExecutionListener = isExecutionListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isTaskListener() {
|
|
||||||
return isTaskListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setTaskListener(boolean isTaskListener) {
|
|
||||||
this.isTaskListener = isTaskListener;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return this.beanId;
|
return this.beanId;
|
||||||
|
@ -14,10 +14,14 @@
|
|||||||
*/
|
*/
|
||||||
package com.inteligr8.activiti.doclet;
|
package com.inteligr8.activiti.doclet;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.lang.model.element.Element;
|
import javax.lang.model.element.Element;
|
||||||
import javax.lang.model.element.ElementKind;
|
import javax.lang.model.element.ElementKind;
|
||||||
@ -37,6 +41,10 @@ import jdk.javadoc.doclet.DocletEnvironment;
|
|||||||
*/
|
*/
|
||||||
class ActivitiDocFilter {
|
class ActivitiDocFilter {
|
||||||
|
|
||||||
|
private final static String INTERFACE_JAVA_DELEGATE = "org.activiti.engine.delegate.JavaDelegate";
|
||||||
|
private final static String INTERFACE_EXECUTION_LISTENER = "org.activiti.engine.delegate.ExecutionListener";
|
||||||
|
private final static String INTERFACE_TASK_LISTENER = "org.activiti.engine.delegate.TaskListener";
|
||||||
|
|
||||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||||
private final List<ActivitiApiBeanDoc> beandocs = new LinkedList<>();
|
private final List<ActivitiApiBeanDoc> beandocs = new LinkedList<>();
|
||||||
private final DocletEnvironment docenv;
|
private final DocletEnvironment docenv;
|
||||||
@ -88,27 +96,33 @@ class ActivitiDocFilter {
|
|||||||
this.logger.debug("Adding named bean: {} => {}", beanId, classElement);
|
this.logger.debug("Adding named bean: {} => {}", beanId, classElement);
|
||||||
|
|
||||||
ActivitiApiBeanDoc beandoc = new ActivitiApiBeanDoc(beanId, classElement);
|
ActivitiApiBeanDoc beandoc = new ActivitiApiBeanDoc(beanId, classElement);
|
||||||
|
|
||||||
|
Set<String> delegateMethodElements = new HashSet<>(5);
|
||||||
|
Set<String> executionListenerMethodElements = new HashSet<>(5);
|
||||||
|
Set<String> taskListenerMethodElements = new HashSet<>(5);
|
||||||
|
|
||||||
// getAllTypeElements() will get inherited interfaces
|
// getAllTypeElements() will get inherited interfaces
|
||||||
for (TypeMirror interfaceType : classElement.getInterfaces()) {
|
for (TypeMirror interfaceType : classElement.getInterfaces()) {
|
||||||
this.logger.trace("Found interface '{}' on bean '{}'", interfaceType, beanId);
|
this.logger.trace("Found interface '{}' on bean '{}'", interfaceType, beanId);
|
||||||
|
|
||||||
switch (interfaceType.toString()) {
|
switch (interfaceType.toString()) {
|
||||||
case "org.activiti.engine.delegate.JavaDelegate":
|
case INTERFACE_JAVA_DELEGATE:
|
||||||
this.logger.debug("The bean '{}' is a JavaDelegate", beanId);
|
this.logger.debug("The bean '{}' is a JavaDelegate", beanId);
|
||||||
beandoc.setDelegate(true);
|
delegateMethodElements.addAll(this.toStrings(this.docenv.getTypeUtils().asElement(interfaceType).getEnclosedElements()));
|
||||||
break;
|
break;
|
||||||
case "org.activiti.engine.delegate.ExecutionListener":
|
case INTERFACE_EXECUTION_LISTENER:
|
||||||
this.logger.debug("The bean '{}' is a ExecutionListener", beanId);
|
this.logger.debug("The bean '{}' is a ExecutionListener", beanId);
|
||||||
beandoc.setExecutionListener(true);
|
executionListenerMethodElements.addAll(this.toStrings(this.docenv.getTypeUtils().asElement(interfaceType).getEnclosedElements()));
|
||||||
break;
|
break;
|
||||||
case "org.activiti.engine.delegate.TaskListener":
|
case INTERFACE_TASK_LISTENER:
|
||||||
this.logger.debug("The bean '{}' is a TaskListener", beanId);
|
this.logger.debug("The bean '{}' is a TaskListener", beanId);
|
||||||
beandoc.setTaskListener(true);
|
taskListenerMethodElements.addAll(this.toStrings(this.docenv.getTypeUtils().asElement(interfaceType).getEnclosedElements()));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.logger.info("delegates: {}", delegateMethodElements);
|
||||||
|
|
||||||
// getAllMembers() will get inherited methods
|
// getAllMembers() will get inherited methods
|
||||||
for (Element memberElement : this.docenv.getElementUtils().getAllMembers(classElement)) {
|
for (Element memberElement : this.docenv.getElementUtils().getAllMembers(classElement)) {
|
||||||
switch (memberElement.getKind()) {
|
switch (memberElement.getKind()) {
|
||||||
@ -116,22 +130,33 @@ class ActivitiDocFilter {
|
|||||||
ExecutableElement methodElement = (ExecutableElement)memberElement;
|
ExecutableElement methodElement = (ExecutableElement)memberElement;
|
||||||
|
|
||||||
if (!methodElement.getModifiers().contains(Modifier.PUBLIC)) {
|
if (!methodElement.getModifiers().contains(Modifier.PUBLIC)) {
|
||||||
this.logger.trace("Skipping non-public method: {}#{}", classElement, methodElement.getSimpleName());
|
this.logger.trace("Skipping non-public method: {}.{}", classElement, methodElement.getSimpleName());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (methodElement.getModifiers().contains(Modifier.ABSTRACT)) {
|
if (methodElement.getModifiers().contains(Modifier.ABSTRACT)) {
|
||||||
this.logger.trace("Skipping abstract method: {}#{}", classElement, methodElement.getSimpleName());
|
this.logger.trace("Skipping abstract method: {}.{}", classElement, methodElement.getSimpleName());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.skipObjectMethods && methodElement.getEnclosingElement().toString().equals("java.lang.Object")) {
|
if (this.skipObjectMethods && methodElement.getEnclosingElement().toString().equals("java.lang.Object")) {
|
||||||
this.logger.trace("Skipping java.lang.Object methods: {}#{}", classElement, methodElement.getSimpleName());
|
this.logger.trace("Skipping java.lang.Object method: {}.{}", classElement, methodElement.getSimpleName());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.logger.debug("The bean '{}' has method '{}'", beanId, methodElement);
|
if (delegateMethodElements.contains(methodElement.toString())) {
|
||||||
beandoc.addMethod(methodElement);
|
this.logger.debug("The bean '{}' has delegate method '{}'", beanId, methodElement);
|
||||||
|
beandoc.setDelegateMethodElement(methodElement);
|
||||||
|
} else if (executionListenerMethodElements.contains(methodElement.toString())) {
|
||||||
|
this.logger.debug("The bean '{}' has execution listener method '{}'", beanId, methodElement);
|
||||||
|
beandoc.setExecutionListenerMethodElement(methodElement);
|
||||||
|
} else if (taskListenerMethodElements.contains(methodElement.toString())) {
|
||||||
|
this.logger.debug("The bean '{}' has task listener method '{}'", beanId, methodElement);
|
||||||
|
beandoc.setTaskListenerMethodElement(methodElement);
|
||||||
|
} else {
|
||||||
|
this.logger.debug("The bean '{}' has method '{}'", beanId, methodElement);
|
||||||
|
beandoc.addMethodElement(methodElement);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
@ -153,5 +178,15 @@ class ActivitiDocFilter {
|
|||||||
|
|
||||||
return beandocs;
|
return beandocs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<String> toStrings(Collection<? extends Element> elements) {
|
||||||
|
if (elements == null)
|
||||||
|
return Collections.emptyList();
|
||||||
|
|
||||||
|
List<String> strs = new ArrayList<String>(elements.size());
|
||||||
|
for (Element element : elements)
|
||||||
|
strs.add(element.toString());
|
||||||
|
return strs;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,12 +14,10 @@
|
|||||||
*/
|
*/
|
||||||
package com.inteligr8.activiti.doclet;
|
package com.inteligr8.activiti.doclet;
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author brian@inteligr8.com
|
* @author brian@inteligr8.com
|
||||||
@ -36,7 +34,11 @@ public class BeanFreemarkerModel implements JavadocDocumentable, JavadocTaggable
|
|||||||
|
|
||||||
private String docBody;
|
private String docBody;
|
||||||
|
|
||||||
private Set<String> delegateRoles = new HashSet<>();
|
private MethodSignatureFreemarkerModel delegateMethod;
|
||||||
|
|
||||||
|
private MethodSignatureFreemarkerModel executionListenerMethod;
|
||||||
|
|
||||||
|
private MethodSignatureFreemarkerModel taskListenerMethod;
|
||||||
|
|
||||||
private Map<String, List<String>> tags = new LinkedHashMap<>();
|
private Map<String, List<String>> tags = new LinkedHashMap<>();
|
||||||
|
|
||||||
@ -83,13 +85,33 @@ public class BeanFreemarkerModel implements JavadocDocumentable, JavadocTaggable
|
|||||||
public void setDocBody(String docBody) {
|
public void setDocBody(String docBody) {
|
||||||
this.docBody = docBody;
|
this.docBody = docBody;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Set<String> getDelegateRoles() {
|
public boolean isHasDelegate() {
|
||||||
return delegateRoles;
|
return this.delegateMethod != null || this.executionListenerMethod != null || this.taskListenerMethod != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDelegateRoles(Set<String> delegateRoles) {
|
public MethodSignatureFreemarkerModel getDelegateMethod() {
|
||||||
this.delegateRoles = delegateRoles;
|
return delegateMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDelegateMethod(MethodSignatureFreemarkerModel delegateMethod) {
|
||||||
|
this.delegateMethod = delegateMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MethodSignatureFreemarkerModel getExecutionListenerMethod() {
|
||||||
|
return executionListenerMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setExecutionListenerMethod(MethodSignatureFreemarkerModel executionListenerMethod) {
|
||||||
|
this.executionListenerMethod = executionListenerMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public MethodSignatureFreemarkerModel getTaskListenerMethod() {
|
||||||
|
return taskListenerMethod;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setTaskListenerMethod(MethodSignatureFreemarkerModel taskListenerMethod) {
|
||||||
|
this.taskListenerMethod = taskListenerMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, List<String>> getTags() {
|
public Map<String, List<String>> getTags() {
|
||||||
|
@ -27,6 +27,10 @@ public class IndexFreemarkerModel {
|
|||||||
private String apiName;
|
private String apiName;
|
||||||
|
|
||||||
private List<BeanFreemarkerModel> beans = new LinkedList<>();
|
private List<BeanFreemarkerModel> beans = new LinkedList<>();
|
||||||
|
|
||||||
|
private boolean hasDelegateBeans;
|
||||||
|
|
||||||
|
private boolean hasMethodBeans;
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
return title;
|
return title;
|
||||||
@ -51,5 +55,21 @@ public class IndexFreemarkerModel {
|
|||||||
public void setBeans(List<BeanFreemarkerModel> beans) {
|
public void setBeans(List<BeanFreemarkerModel> beans) {
|
||||||
this.beans = beans;
|
this.beans = beans;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isHasDelegateBeans() {
|
||||||
|
return hasDelegateBeans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasDelegateBeans(boolean hasDelegateBeans) {
|
||||||
|
this.hasDelegateBeans = hasDelegateBeans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHasMethodBeans() {
|
||||||
|
return hasMethodBeans;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setHasMethodBeans(boolean hasMethodBeans) {
|
||||||
|
this.hasMethodBeans = hasMethodBeans;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ class MarkdownWriter {
|
|||||||
.with(Pattern.compile("\\{ ?(@[^}]+) \\}"), "{$1}")
|
.with(Pattern.compile("\\{ ?(@[^}]+) \\}"), "{$1}")
|
||||||
.with(Pattern.compile("\\{@link ([^}]+)\\}"), "[$1]($1)")
|
.with(Pattern.compile("\\{@link ([^}]+)\\}"), "[$1]($1)")
|
||||||
.with(Pattern.compile("([A-Za-z0-9\\-\\._]+@[A-Za-z0-9\\-\\._]+)"), "[$1](mailto:$1)");
|
.with(Pattern.compile("([A-Za-z0-9\\-\\._]+@[A-Za-z0-9\\-\\._]+)"), "[$1](mailto:$1)");
|
||||||
private final Pattern seeRefPattern = Pattern.compile("^([A-Za-z0-9_\\-]+)\\.([A-Za-z0-9_]+)$");
|
private final Pattern seeRefPattern = Pattern.compile("^([A-Za-z0-9_\\-]+)[\\.#]([A-Za-z0-9_]+)$");
|
||||||
|
|
||||||
private final DocletEnvironment docenv;
|
private final DocletEnvironment docenv;
|
||||||
private final File outputDirectory;
|
private final File outputDirectory;
|
||||||
@ -129,12 +129,6 @@ class MarkdownWriter {
|
|||||||
beanModel.setTitle(this.title);
|
beanModel.setTitle(this.title);
|
||||||
beanModel.setApiName(this.apiName);
|
beanModel.setApiName(this.apiName);
|
||||||
beanModel.setBeanId(beandoc.getBeanId());
|
beanModel.setBeanId(beandoc.getBeanId());
|
||||||
if (beandoc.isDelegate())
|
|
||||||
beanModel.getDelegateRoles().add("ServiceTask");
|
|
||||||
if (beandoc.isExecutionListener())
|
|
||||||
beanModel.getDelegateRoles().add("ExecutionListener");
|
|
||||||
if (beandoc.isTaskListener())
|
|
||||||
beanModel.getDelegateRoles().add("TaskListener");
|
|
||||||
if (commentTree != null) {
|
if (commentTree != null) {
|
||||||
this.logger.debug("Found documentation for bean: {}", beandoc.getBeanId());
|
this.logger.debug("Found documentation for bean: {}", beandoc.getBeanId());
|
||||||
|
|
||||||
@ -144,14 +138,24 @@ class MarkdownWriter {
|
|||||||
null, null, null, beanModel);
|
null, null, null, beanModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (beandoc.getDelegateMethodElement() != null) {
|
||||||
|
beanModel.setDelegateMethod(this.buildMethodSignatureModel(beandoc, beandoc.getDelegateMethodElement()));
|
||||||
|
indexModel.setHasDelegateBeans(true);
|
||||||
|
}
|
||||||
|
if (beandoc.getExecutionListenerMethodElement() != null) {
|
||||||
|
beanModel.setExecutionListenerMethod(this.buildMethodSignatureModel(beandoc, beandoc.getExecutionListenerMethodElement()));
|
||||||
|
indexModel.setHasDelegateBeans(true);
|
||||||
|
}
|
||||||
|
if (beandoc.getTaskListenerMethodElement() != null) {
|
||||||
|
beanModel.setTaskListenerMethod(this.buildMethodSignatureModel(beandoc, beandoc.getTaskListenerMethodElement()));
|
||||||
|
indexModel.setHasDelegateBeans(true);
|
||||||
|
}
|
||||||
|
|
||||||
Map<Name, MethodFreemarkerModel> methodOverloads = new LinkedHashMap<>();
|
Map<Name, MethodFreemarkerModel> methodOverloads = new LinkedHashMap<>();
|
||||||
|
|
||||||
for (ExecutableElement methodElement : beandoc.getSortedMethodElements()) {
|
for (ExecutableElement methodElement : beandoc.getSortedMethodElements()) {
|
||||||
String logId = beandoc.getBeanId() + "." + methodElement.toString();
|
MethodSignatureFreemarkerModel sigModel = this.buildMethodSignatureModel(beandoc, methodElement);
|
||||||
DocCommentTree methodCommentTree = docs.getDocCommentTree(methodElement);
|
|
||||||
|
|
||||||
this.logger.debug("Building documentation method model: {}", logId);
|
|
||||||
|
|
||||||
MethodFreemarkerModel methodModel = methodOverloads.get(methodElement.getSimpleName());
|
MethodFreemarkerModel methodModel = methodOverloads.get(methodElement.getSimpleName());
|
||||||
if (methodModel == null) {
|
if (methodModel == null) {
|
||||||
@ -160,33 +164,11 @@ class MarkdownWriter {
|
|||||||
|
|
||||||
methodOverloads.put(methodElement.getSimpleName(), methodModel);
|
methodOverloads.put(methodElement.getSimpleName(), methodModel);
|
||||||
beanModel.getMethods().add(methodModel);
|
beanModel.getMethods().add(methodModel);
|
||||||
|
indexModel.setHasMethodBeans(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> paramComments = new HashMap<>();
|
if (sigModel.getDocFirstSentence() != null && methodModel.getDocFirstSentence() == null)
|
||||||
Map<String, String> throwComments = new LinkedHashMap<>();
|
methodModel.setDocFirstSentence(sigModel.getDocFirstSentence());
|
||||||
Map<String, String> errorComments = new LinkedHashMap<>();
|
|
||||||
|
|
||||||
MethodSignatureFreemarkerModel sigModel = new MethodSignatureFreemarkerModel();
|
|
||||||
if (methodCommentTree != null) {
|
|
||||||
this.logger.debug("Found documentation for '{}'", logId);
|
|
||||||
|
|
||||||
this.buildDocumentation(methodCommentTree, sigModel);
|
|
||||||
if (methodModel.getDocFirstSentence() == null)
|
|
||||||
methodModel.setDocFirstSentence(sigModel.getDocFirstSentence());
|
|
||||||
for (DocTree tag : methodCommentTree.getBlockTags()) {
|
|
||||||
this.buildTagModel(tag, logId,
|
|
||||||
paramComments, throwComments, errorComments, sigModel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
this.buildMethodArguments(methodElement, logId, paramComments, sigModel);
|
|
||||||
this.buildMethodThrows(methodElement, logId, throwComments, !errorComments.isEmpty(), sigModel);
|
|
||||||
this.buildMethodErrors(methodElement, logId, errorComments, sigModel);
|
|
||||||
this.buildMethodReturns(methodElement, logId, sigModel);
|
|
||||||
this.buildMethodSignature(methodElement, sigModel);
|
|
||||||
|
|
||||||
if (!paramComments.isEmpty())
|
|
||||||
this.logger.warn("'{}' has documented parameters {} that don't exist; ignoring ...", logId, paramComments.keySet());
|
|
||||||
|
|
||||||
methodModel.getSignatures().add(sigModel);
|
methodModel.getSignatures().add(sigModel);
|
||||||
}
|
}
|
||||||
@ -197,6 +179,40 @@ class MarkdownWriter {
|
|||||||
return indexModel;
|
return indexModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private MethodSignatureFreemarkerModel buildMethodSignatureModel(ActivitiApiBeanDoc beandoc, ExecutableElement methodElement) {
|
||||||
|
String logId = beandoc.getBeanId() + "." + methodElement.toString();
|
||||||
|
DocCommentTree methodCommentTree = this.docenv.getDocTrees().getDocCommentTree(methodElement);
|
||||||
|
|
||||||
|
this.logger.debug("Building documentation method model: {}", logId);
|
||||||
|
|
||||||
|
Map<String, String> paramComments = new HashMap<>();
|
||||||
|
Map<String, String> throwComments = new LinkedHashMap<>();
|
||||||
|
Map<String, String> errorComments = new LinkedHashMap<>();
|
||||||
|
|
||||||
|
MethodSignatureFreemarkerModel sigModel = new MethodSignatureFreemarkerModel();
|
||||||
|
if (methodCommentTree != null) {
|
||||||
|
this.logger.debug("Found documentation for '{}'", logId);
|
||||||
|
|
||||||
|
this.buildDocumentation(methodCommentTree, sigModel);
|
||||||
|
for (DocTree tag : methodCommentTree.getBlockTags()) {
|
||||||
|
this.buildTagModel(tag, logId,
|
||||||
|
paramComments, throwComments, errorComments, sigModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.buildMethodArguments(methodElement, logId, paramComments, sigModel);
|
||||||
|
this.buildMethodThrows(methodElement, logId, throwComments, !errorComments.isEmpty(), sigModel);
|
||||||
|
this.buildMethodErrors(methodElement, logId, errorComments, sigModel);
|
||||||
|
this.buildMethodReturns(methodElement, logId, sigModel);
|
||||||
|
this.buildMethodBriefSignature(methodElement, sigModel);
|
||||||
|
this.buildMethodSignature(methodElement, sigModel);
|
||||||
|
|
||||||
|
if (!paramComments.isEmpty())
|
||||||
|
this.logger.warn("'{}' has documented parameters {} that don't exist; ignoring ...", logId, paramComments.keySet());
|
||||||
|
|
||||||
|
return sigModel;
|
||||||
|
}
|
||||||
|
|
||||||
private void buildDocumentation(DocCommentTree commentTree, JavadocDocumentable docuable) {
|
private void buildDocumentation(DocCommentTree commentTree, JavadocDocumentable docuable) {
|
||||||
if (commentTree.getFirstSentence() != null)
|
if (commentTree.getFirstSentence() != null)
|
||||||
docuable.setDocFirstSentence(this.sanitize(commentTree.getFirstSentence()));
|
docuable.setDocFirstSentence(this.sanitize(commentTree.getFirstSentence()));
|
||||||
@ -314,6 +330,18 @@ class MarkdownWriter {
|
|||||||
sigModel.setReturnType(methodElement.getReturnType().toString());
|
sigModel.setReturnType(methodElement.getReturnType().toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void buildMethodBriefSignature(ExecutableElement methodElement, MethodSignatureFreemarkerModel sigModel) {
|
||||||
|
StringBuilder methodSignature = new StringBuilder(methodElement.getSimpleName()).append("(");
|
||||||
|
for (ParamFreemarkerModel model : sigModel.getParams().values())
|
||||||
|
methodSignature.append(model.getName()).append(", ");
|
||||||
|
if (methodSignature.charAt(methodSignature.length()-1) != '(')
|
||||||
|
methodSignature.delete(methodSignature.length()-2, methodSignature.length());
|
||||||
|
methodSignature.append(")");
|
||||||
|
|
||||||
|
this.logger.debug("Formulated method brief signature: {}", methodSignature);
|
||||||
|
sigModel.setMethodSignature(methodSignature.toString());
|
||||||
|
}
|
||||||
|
|
||||||
private void buildMethodSignature(ExecutableElement methodElement, MethodSignatureFreemarkerModel sigModel) {
|
private void buildMethodSignature(ExecutableElement methodElement, MethodSignatureFreemarkerModel sigModel) {
|
||||||
StringBuilder methodSignature = new StringBuilder(methodElement.getSimpleName()).append("(");
|
StringBuilder methodSignature = new StringBuilder(methodElement.getSimpleName()).append("(");
|
||||||
for (ParamFreemarkerModel model : sigModel.getParams().values())
|
for (ParamFreemarkerModel model : sigModel.getParams().values())
|
||||||
@ -322,7 +350,7 @@ class MarkdownWriter {
|
|||||||
methodSignature.delete(methodSignature.length()-2, methodSignature.length());
|
methodSignature.delete(methodSignature.length()-2, methodSignature.length());
|
||||||
methodSignature.append("): ").append(methodElement.getReturnType());
|
methodSignature.append("): ").append(methodElement.getReturnType());
|
||||||
|
|
||||||
this.logger.debug("Found method signature: {}", methodSignature);
|
this.logger.debug("Formulated method signature: {}", methodSignature);
|
||||||
sigModel.setMethodSignature(methodSignature.toString());
|
sigModel.setMethodSignature(methodSignature.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,58 +1,65 @@
|
|||||||
|
|
||||||
# ${title}<#if apiName??>: ${apiName}</#if>: `${beanId}`
|
# ${title}<#if apiName??>: ${apiName}</#if>: `${beanId}`
|
||||||
|
|
||||||
<#if (tags.author?? || tags.since?? || tags.deprecated??)>
|
<#if (tags.author?? || tags.since?? || tags.deprecated??)><#if tags.author??><#list tags.author as author>
|
||||||
<#if tags.author??>
|
|
||||||
<#list tags.author as author>
|
|
||||||
*Author*: ${author}
|
*Author*: ${author}
|
||||||
</#list>
|
</#list></#if><#if tags.since??>*Since Version*: ${tags.since[0]}
|
||||||
</#if>
|
</#if><#if tags.version??>*Version*: ${tags.version[0]}
|
||||||
<#if tags.since??>*Since*: ${tags.since[0]}</#if>
|
</#if><#if tags.deprecated??>*Deprecated*</#if>
|
||||||
<#if tags.deprecated??>*Deprecated*</#if>
|
|
||||||
|
|
||||||
</#if>
|
</#if>
|
||||||
<#if docBody??>${docBody}<#else>No documentation available.</#if>
|
<#if docBody??>${docBody}<#else>No documentation available.</#if>
|
||||||
|
|
||||||
<#if (tags.see?? || seeRefs?size > 0)>
|
<#if (tags.see?? || seeRefs?size > 0)><#list seeRefs as seeRef>
|
||||||
<#list seeRefs as seeRef>
|
|
||||||
*See Also*: [`${seeRef.beanId}.${seeRef.methodName}`](bean-${seeRef.beanId}.md#${seeRef.methodName})
|
*See Also*: [`${seeRef.beanId}.${seeRef.methodName}`](bean-${seeRef.beanId}.md#${seeRef.methodName})
|
||||||
</#list>
|
</#list><#if tags.see??><#list tags.see as see>
|
||||||
<#if tags.see??>
|
|
||||||
<#list tags.see as see>
|
|
||||||
*See Also*: ${see}
|
*See Also*: ${see}
|
||||||
</#list>
|
</#list></#if>
|
||||||
</#if>
|
|
||||||
|
|
||||||
</#if>
|
</#if>
|
||||||
<#if (delegateRoles?size > 0)>
|
<#if hasDelegate>
|
||||||
## Delegate Uses
|
## Delegate Expression Uses
|
||||||
|
|
||||||
This bean may be used in the following entities and their fields in Activiti. In these cases, the value of the "Delegate Expression" field should be as shown in the snippet below.
|
This bean may be used as a *Delegate* using the "Delegate Expression" field as shown in the snippet below.
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
${r"${"}${beanId}${r"}"}
|
${r"${"}${beanId}${r"}"}
|
||||||
```
|
```
|
||||||
|
|
||||||
<#if delegateRoles?seq_contains("ServiceTask") >
|
<#if delegateMethod??>
|
||||||
- Any **Non-Listener Delegate Expression** (usually a Service Task)
|
You may use it in a **Service Task**.
|
||||||
</#if><#if delegateRoles?seq_contains("ExecutionListener") >
|
|
||||||
- Any **Execution Listener Delegate Expression**
|
|
||||||
</#if><#if delegateRoles?seq_contains("TaskListener") >
|
|
||||||
- Any **Task Listener Delegate Expression**
|
|
||||||
</#if>
|
|
||||||
|
|
||||||
</#if>
|
<#if delegateMethod.docBody??>${delegateMethod.docBody}<#else>No additional documentation available.</#if>
|
||||||
## Expression Methods
|
|
||||||
|
---
|
||||||
|
|
||||||
|
</#if><#if executionListenerMethod??>
|
||||||
|
You may use it in an **Execution Listener**.
|
||||||
|
|
||||||
|
<#if executionListenerMethod.docBody??>${executionListenerMethod.docBody}<#else>No additional documentation available.</#if>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
</#if><#if taskListenerMethod??>
|
||||||
|
You may use it in a **Task Listener**.
|
||||||
|
|
||||||
|
<#if taskListenerMethod.docBody??>${taskListenerMethod.docBody}<#else>No additional documentation available.</#if>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
</#if></#if><#if (methods?size > 0)>
|
||||||
|
## Expression Uses
|
||||||
|
|
||||||
This bean and its methods may be used in any "Expression" field or script in a Script Task in Activiti.
|
This bean and its methods may be used in any "Expression" field or script in a Script Task in Activiti.
|
||||||
|
|
||||||
| Method Name | Brief Documentation |
|
| Method Name | Brief Documentation |
|
||||||
| --------------------------------- | ------------------------ |
|
| -------------------------------- | ------------------------ |
|
||||||
<#list methods as method>
|
<#list methods as method><#assign nameColumn = "[`${method.methodName}`](#${method.methodName})">
|
||||||
<#assign nameColumn = "[`${method.methodName}`](#${method.methodName})">
|
|
||||||
| ${nameColumn?right_pad(32)} | <#if method.docFirstSentence??>${method.docFirstSentence?right_pad(24)}<#else>No documentation available.</#if> |
|
| ${nameColumn?right_pad(32)} | <#if method.docFirstSentence??>${method.docFirstSentence?right_pad(24)}<#else>No documentation available.</#if> |
|
||||||
</#list>
|
</#list>
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
<#list methods as method>
|
<#list methods as method>
|
||||||
## <a name="${method.methodName}"></a> `${method.methodName}`
|
## <a name="${method.methodName}"></a> `${method.methodName}`
|
||||||
|
|
||||||
@ -65,7 +72,8 @@ This bean and its methods may be used in any "Expression" field or script in a S
|
|||||||
*Author*: ${author}
|
*Author*: ${author}
|
||||||
</#list>
|
</#list>
|
||||||
</#if>
|
</#if>
|
||||||
<#if sig.tags.since??>*Since*: ${sig.tags.since[0]}</#if>
|
<#if sig.tags.since??>*Since Version*: ${sig.tags.since[0]}</#if>
|
||||||
|
<#if sig.tags.version??>*Version*: ${sig.tags.version[0]}</#if>
|
||||||
<#if sig.tags.deprecated??>*Deprecated*</#if>
|
<#if sig.tags.deprecated??>*Deprecated*</#if>
|
||||||
|
|
||||||
</#if>
|
</#if>
|
||||||
@ -96,21 +104,16 @@ This bean and its methods may be used in any "Expression" field or script in a S
|
|||||||
</#list>
|
</#list>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
||||||
</#if>
|
</#if><#if (sig.tags.see?? || sig.seeRefs?size > 0)><#list sig.seeRefs as seeRef>
|
||||||
<#if (sig.tags.see?? || sig.seeRefs?size > 0)>
|
|
||||||
<#list sig.seeRefs as seeRef>
|
|
||||||
*See Also*: [`${seeRef.beanId}.${seeRef.methodName}`](bean-${seeRef.beanId}.md#${seeRef.methodName})
|
*See Also*: [`${seeRef.beanId}.${seeRef.methodName}`](bean-${seeRef.beanId}.md#${seeRef.methodName})
|
||||||
</#list>
|
</#list><#if sig.tags.see??><#list sig.tags.see as see>
|
||||||
<#if sig.tags.see??>
|
|
||||||
<#list sig.tags.see as see>
|
|
||||||
*See Also*: ${see}
|
*See Also*: ${see}
|
||||||
</#list>
|
</#list></#if>
|
||||||
</#if>
|
|
||||||
|
|
||||||
</#if>
|
</#if>
|
||||||
</#list>
|
|
||||||
</#list>
|
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
</#list></#list></#if>
|
||||||
|
[Back to Index](index.md)
|
||||||
|
|
||||||
Generated by the [Inteligr8](https://inteligr8.com) [Activiti API Doclet](https://bitbucket.org/inteligr8/activiti-api-doclet).
|
Generated by the [Inteligr8](https://inteligr8.com) [Activiti API Doclet](https://bitbucket.org/inteligr8/activiti-api-doclet).
|
||||||
|
@ -17,15 +17,28 @@ Activiti has a set of features that allow a model designer to call these Java-ba
|
|||||||
|
|
||||||
It is important to note that Activiti expressions use the JUEL language and Activiti scripts use the specified/configured language. Popular configured languages may be JavaScript or Groovy. In any case, the same API notation may be used. It is also worth noting that execution/task listeners may exist on most objects.
|
It is important to note that Activiti expressions use the JUEL language and Activiti scripts use the specified/configured language. Popular configured languages may be JavaScript or Groovy. In any case, the same API notation may be used. It is also worth noting that execution/task listeners may exist on most objects.
|
||||||
|
|
||||||
|
<#if hasDelegateBeans>
|
||||||
|
## Delegates
|
||||||
|
|
||||||
|
| Delegate ID | Brief Documentation |
|
||||||
|
| -------------------------------- | ------------------------- |
|
||||||
|
<#list beans as bean><#if bean.hasDelegate>
|
||||||
|
<#assign idColumn = "[`${bean.beanId}`](bean-${bean.beanId}.md)">
|
||||||
|
| ${idColumn?right_pad(32)} | <#if bean.docFirstSentence??>${bean.docFirstSentence?right_pad(24)}<#else>No documentation available.</#if> |
|
||||||
|
</#if></#list>
|
||||||
|
|
||||||
|
</#if>
|
||||||
|
<#if hasMethodBeans>
|
||||||
## Beans
|
## Beans
|
||||||
|
|
||||||
| Bean ID | Brief Documentation |
|
| Bean ID | Brief Documentation |
|
||||||
| -------------------------------- | ------------------------- |
|
| -------------------------------- | ------------------------- |
|
||||||
<#list beans as bean>
|
<#list beans as bean><#if (bean.methods?size > 0)>
|
||||||
<#assign idColumn = "[`${bean.beanId}`](bean-${bean.beanId}.md)">
|
<#assign idColumn = "[`${bean.beanId}`](bean-${bean.beanId}.md)">
|
||||||
| ${idColumn?right_pad(32)} | <#if bean.docFirstSentence??>${bean.docFirstSentence?right_pad(24)}<#else>No documentation available.</#if> |
|
| ${idColumn?right_pad(32)} | <#if bean.docFirstSentence??>${bean.docFirstSentence?right_pad(24)}<#else>No documentation available.</#if> |
|
||||||
</#list>
|
</#if></#list>
|
||||||
|
|
||||||
|
</#if>
|
||||||
---
|
---
|
||||||
|
|
||||||
Generated by the [Inteligr8](https://inteligr8.com) [Activiti API Doclet](https://bitbucket.org/inteligr8/activiti-api-doclet).
|
Generated by the [Inteligr8](https://inteligr8.com) [Activiti API Doclet](https://bitbucket.org/inteligr8/activiti-api-doclet).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user