Search in sources :

Example 1 with NamedAction

use of aQute.bnd.service.action.NamedAction in project bnd by bndtools.

the class Project method fillActions.

public void fillActions(Map<String, Action> all) {
    List<NamedAction> plugins = getPlugins(NamedAction.class);
    for (NamedAction a : plugins) all.put(a.getName(), a);
    Parameters actions = new Parameters(getProperty("-actions", DEFAULT_ACTIONS), this);
    for (Entry<String, Attrs> entry : actions.entrySet()) {
        String key = Processor.removeDuplicateMarker(entry.getKey());
        Action action;
        if (entry.getValue().get("script") != null) {
            // TODO check for the type
            action = new ScriptAction(entry.getValue().get("type"), entry.getValue().get("script"));
        } else {
            action = new ReflectAction(key);
        }
        String label = entry.getValue().get("label");
        all.put(label.toLowerCase(), action);
    }
}
Also used : NamedAction(aQute.bnd.service.action.NamedAction) Action(aQute.bnd.service.action.Action) NamedAction(aQute.bnd.service.action.NamedAction) Parameters(aQute.bnd.header.Parameters) Attrs(aQute.bnd.header.Attrs)

Aggregations

Attrs (aQute.bnd.header.Attrs)1 Parameters (aQute.bnd.header.Parameters)1 Action (aQute.bnd.service.action.Action)1 NamedAction (aQute.bnd.service.action.NamedAction)1