use of org.eclipse.ceylon.common.tool.Description in project ceylon by eclipse.
the class DocBuilder method getOptionDescription.
public static String getOptionDescription(ToolModel<?> model, OptionModel<?> opt) {
ResourceBundle toolBundle = getToolBundle(model);
String msg = msg(toolBundle, "option." + opt.getLongName());
if (msg.isEmpty()) {
Description description = opt.getArgument().getSetter().getAnnotation(Description.class);
if (description != null) {
msg = description.value();
}
}
return msg;
}
use of org.eclipse.ceylon.common.tool.Description in project ceylon by eclipse.
the class DocBuilder method getDescription.
public static String getDescription(ToolModel<?> model) {
if (model instanceof ScriptToolModel) {
return invokeScript((ScriptToolModel<?>) model, "--_print-description");
}
AnnotatedToolModel<?> amodel = (AnnotatedToolModel<?>) model;
ResourceBundle toolBundle = getToolBundle(model);
String msg = msg(toolBundle, "description");
if (msg.isEmpty()) {
Description description = amodel.getToolClass().getAnnotation(Description.class);
if (description != null) {
msg = description.value();
}
}
return msg;
}
Aggregations