Search in sources :

Example 1 with Action

use of org.springframework.roo.addon.tailor.actions.Action in project spring-roo by spring-projects.

the class DefaultTailorImpl method execute.

private void execute(final CommandTransformation commandTrafo) {
    final TailorConfiguration configuration = configLocator.getActiveTailorConfiguration();
    if (configuration == null) {
        return;
    }
    final CommandConfiguration commandConfig = configuration.getCommandConfigFor(commandTrafo.getInputCommand());
    if (commandConfig == null) {
        return;
    }
    logInDevelopmentMode(Level.INFO, "Tailor: detected " + commandTrafo.getInputCommand());
    for (final ActionConfig config : commandConfig.getActions()) {
        final Action component = actionLocator.getAction(config.getActionTypeId());
        if (component != null) {
            logInDevelopmentMode(Level.INFO, "\tTailoring: " + component.getDescription(config));
            component.execute(commandTrafo, config);
        } else {
            logInDevelopmentMode(Level.WARNING, "\tTailoring: Couldn't find action '" + config.getActionTypeId());
        }
    }
}
Also used : ActionConfig(org.springframework.roo.addon.tailor.actions.ActionConfig) Action(org.springframework.roo.addon.tailor.actions.Action) CommandConfiguration(org.springframework.roo.addon.tailor.config.CommandConfiguration) TailorConfiguration(org.springframework.roo.addon.tailor.config.TailorConfiguration)

Aggregations

Action (org.springframework.roo.addon.tailor.actions.Action)1 ActionConfig (org.springframework.roo.addon.tailor.actions.ActionConfig)1 CommandConfiguration (org.springframework.roo.addon.tailor.config.CommandConfiguration)1 TailorConfiguration (org.springframework.roo.addon.tailor.config.TailorConfiguration)1