use of org.eclipse.ceylon.common.tool.AnnotatedToolModel in project ceylon by eclipse.
the class CeylonTool method getTool.
public Tool getTool(ToolModel<?> model) {
Tool tool = null;
if (model == null) {
ArgumentModel<?> argumentModel = getToolModel("").getArguments().get(0);
// XXX Very evil hack to work around the fact that the CeyonTool does
// not use subtools yet, and so the model used to generate help doc
// doesn't quite work right.
argumentModel.setName("command");
throw new NoSuchToolException(argumentModel, getToolName());
}
if (!(model instanceof AnnotatedToolModel))
return null;
boolean useCache = false;
if (toolName != null && toolName.equals(model.getName()))
useCache = true;
if (useCache && toolCache != null)
return toolCache;
tool = getPluginFactory().bindArguments(model, this, toolArgs);
if (useCache)
toolCache = tool;
return tool;
}
Aggregations