Search in sources :

Example 1 with ScriptToolModel

use of org.eclipse.ceylon.common.tool.ScriptToolModel 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;
}
Also used : Description(org.eclipse.ceylon.common.tool.Description) AnnotatedToolModel(org.eclipse.ceylon.common.tool.AnnotatedToolModel) ResourceBundle(java.util.ResourceBundle) ScriptToolModel(org.eclipse.ceylon.common.tool.ScriptToolModel)

Example 2 with ScriptToolModel

use of org.eclipse.ceylon.common.tool.ScriptToolModel in project ceylon by eclipse.

the class DocBuilder method getSummaryValue.

public static String getSummaryValue(ToolModel<?> model) {
    if (model instanceof ScriptToolModel) {
        return invokeScript((ScriptToolModel<?>) model, "--_print-summary");
    }
    if (model instanceof PluginToolModel) {
        return ((PluginToolModel<?>) model).getToolSummary();
    }
    ResourceBundle toolBundle = getToolBundle(model);
    String msg = msg(toolBundle, "summary");
    if (msg.isEmpty()) {
        Summary summary = getSummary(model);
        if (summary != null) {
            msg = summary.value();
        }
    }
    return msg;
}
Also used : Summary(org.eclipse.ceylon.common.tool.Summary) ResourceBundle(java.util.ResourceBundle) ScriptToolModel(org.eclipse.ceylon.common.tool.ScriptToolModel) PluginToolModel(org.eclipse.ceylon.common.tool.PluginToolModel)

Aggregations

ResourceBundle (java.util.ResourceBundle)2 ScriptToolModel (org.eclipse.ceylon.common.tool.ScriptToolModel)2 AnnotatedToolModel (org.eclipse.ceylon.common.tool.AnnotatedToolModel)1 Description (org.eclipse.ceylon.common.tool.Description)1 PluginToolModel (org.eclipse.ceylon.common.tool.PluginToolModel)1 Summary (org.eclipse.ceylon.common.tool.Summary)1