* @param documentation
* @return ActionDoc
*/
private Action extractDocumentationAnnotations(ExtDirectMethodDocumentation documentation) {
if (!documentation.value().isEmpty()) {
ActionDoc actionDoc = new ActionDoc(getAction(), documentation.value(), documentation.author(),
documentation.version(), documentation.deprecated());
ExtDirectDocParameters docParameters = documentation.parameters();
if (null != docParameters) {
String[] params = docParameters.params();
String[] descriptions = docParameters.descriptions() == null ? new String[params.length]
: docParameters.descriptions();
if (params.length == descriptions.length) {
for (int i = 0; i < params.length; i++) {
actionDoc.getParameters().put(params[i],
descriptions[i] == null ? "No description" : descriptions[i]);
}
} else {
LogFactory
.getLog(MethodInfo.class)
.info("Documentation: skip generation of parameters, params size is different from descriptions size");
}
}
ExtDirectDocReturn docReturn = documentation.returnMethod();
if (null != docReturn) {
String[] properties = docReturn.properties();
String[] descriptions = docReturn.descriptions() == null ? new String[properties.length] : docReturn
.descriptions();
if (properties.length == descriptions.length) {
for (int i = 0; i < properties.length; i++) {
actionDoc.getReturnMethod().put(properties[i],
descriptions[i] == null ? "No description" : descriptions[i]);
}
} else {
LogFactory
.getLog(MethodInfo.class)