Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ROO-3109: Update addon-tailor with supplied patches - formatting

  • Loading branch information...
commit a89fdc867c86e85334e4b1a568b7bafd6d473ffa 1 parent 100e8f1
Alan Stewart authored
View
7 addon-tailor/src/main/java/org/springframework/roo/addon/tailor/DefaultTailorImpl.java
@@ -48,7 +48,8 @@
}
try {
// validate if it is commented
- final CommentedLine comment = new CommentedLine(command, inBlockComment);
+ final CommentedLine comment = new CommentedLine(command,
+ inBlockComment);
TailorHelper.removeComment(comment);
inBlockComment = comment.getInBlockComment();
command = comment.getLine();
@@ -106,8 +107,8 @@ private void execute(final CommandTransformation commandTrafo) {
"Tailor: detected " + commandTrafo.getInputCommand());
for (final ActionConfig config : commandConfig.getActions()) {
- final Action component = actionLocator
- .getAction(config.getActionTypeId());
+ final Action component = actionLocator.getAction(config
+ .getActionTypeId());
if (component != null) {
logInDevelopmentMode(Level.INFO,
"\tTailoring: " + component.getDescription(config));
View
5 addon-tailor/src/main/java/org/springframework/roo/addon/tailor/TailorCommands.java
@@ -61,8 +61,9 @@ public void tailorList() {
final Iterator<String> iterator = configs.keySet().iterator();
while (iterator.hasNext()) {
final String configName = iterator.next();
- final String isActive = activeConfig != null && configName
- .equals(activeConfig.getName()) ? " [ ACTIVE ] " : "";
+ final String isActive = activeConfig != null
+ && configName.equals(activeConfig.getName()) ? " [ ACTIVE ] "
+ : "";
LOGGER.info("\to " + configName + isActive + " - "
+ configs.get(configName).getDescription());
}
View
11 addon-tailor/src/main/java/org/springframework/roo/addon/tailor/actions/AbstractAction.java
@@ -20,10 +20,11 @@
/**
* {@inheritDoc}
*/
- public void execute(final CommandTransformation command, final ActionConfig config) {
+ public void execute(final CommandTransformation command,
+ final ActionConfig config) {
if (isValid(config)) {
- final ActionConfig processedConfig = processConfigAttributes(command,
- config);
+ final ActionConfig processedConfig = processConfigAttributes(
+ command, config);
executeImpl(command, processedConfig);
}
else {
@@ -37,8 +38,8 @@ public void execute(final CommandTransformation command, final ActionConfig conf
protected abstract void executeImpl(CommandTransformation command,
ActionConfig config);
- private ActionConfig processConfigAttributes(final CommandTransformation command,
- final ActionConfig config) {
+ private ActionConfig processConfigAttributes(
+ final CommandTransformation command, final ActionConfig config) {
// Process variables in config
final ActionConfig processedConfig = new ActionConfig(
config.getActionTypeId());
View
9 ...ailor/src/main/java/org/springframework/roo/addon/tailor/actions/ActionConfigFactory.java
@@ -36,12 +36,14 @@ public static ActionConfig defaultArgumentAction(final String argument,
* @return new ActionConfig
*/
public static ActionConfig executeAction() {
- final ActionConfig config = new ActionConfig(ActionType.EXECUTE.getActionId());
+ final ActionConfig config = new ActionConfig(
+ ActionType.EXECUTE.getActionId());
return config;
}
public static ActionConfig executeAction(final String command) {
- final ActionConfig config = new ActionConfig(ActionType.EXECUTE.getActionId());
+ final ActionConfig config = new ActionConfig(
+ ActionType.EXECUTE.getActionId());
config.setCommand(command);
return config;
}
@@ -50,7 +52,8 @@ public static ActionConfig executeAction(final String command) {
* @see Focus
*/
public static ActionConfig focusModuleAction(final String module) {
- final ActionConfig config = new ActionConfig(ActionType.FOCUS.getActionId());
+ final ActionConfig config = new ActionConfig(
+ ActionType.FOCUS.getActionId());
config.setModule(module);
return config;
}
View
3  addon-tailor/src/main/java/org/springframework/roo/addon/tailor/actions/DefaultValue.java
@@ -16,7 +16,8 @@
public class DefaultValue extends AbstractAction {
@Override
- public void executeImpl(final CommandTransformation arg, final ActionConfig config) {
+ public void executeImpl(final CommandTransformation arg,
+ final ActionConfig config) {
// Allow argument name with and without "--" in config
String argumentName = config.getArgument();
if (argumentName.startsWith("--")) {
View
16 addon-tailor/src/main/java/org/springframework/roo/addon/tailor/actions/Execute.java
@@ -22,10 +22,12 @@
public static final String ACTIONATTR_REMOVEARGS = "exclude";
@Override
- public void executeImpl(final CommandTransformation trafo, final ActionConfig config) {
+ public void executeImpl(final CommandTransformation trafo,
+ final ActionConfig config) {
if (StringUtils.isBlank(config.getCommand())) {
// If no command specified, this will execute the original command
- final String processedCommand = removeArgumentsFromInputCmd(trafo, config);
+ final String processedCommand = removeArgumentsFromInputCmd(trafo,
+ config);
trafo.addOutputCommand(processedCommand);
}
else {
@@ -57,8 +59,8 @@ public boolean isValid(final ActionConfig config) {
* @param config Action configuration
* @return Processed input command
*/
- private String removeArgumentsFromInputCmd(final CommandTransformation trafo,
- final ActionConfig config) {
+ private String removeArgumentsFromInputCmd(
+ final CommandTransformation trafo, final ActionConfig config) {
final String removeArgumentsAttribute = config
.getAttribute(ACTIONATTR_REMOVEARGS);
if (StringUtils.isBlank(removeArgumentsAttribute)) {
@@ -67,7 +69,8 @@ private String removeArgumentsFromInputCmd(final CommandTransformation trafo,
String inputCommandString = trafo.getInputCommand();
- final String[] removeArgumentsList = removeArgumentsAttribute.split(",");
+ final String[] removeArgumentsList = removeArgumentsAttribute
+ .split(",");
for (final String element : removeArgumentsList) {
String argToRemove = element;
@@ -76,7 +79,8 @@ private String removeArgumentsFromInputCmd(final CommandTransformation trafo,
}
final Map<String, String> cmdArguments = trafo.getArguments();
- final Iterator<String> keyIterator = cmdArguments.keySet().iterator();
+ final Iterator<String> keyIterator = cmdArguments.keySet()
+ .iterator();
while (keyIterator.hasNext()) {
final String argName = keyIterator.next();
if (argName.equals(argToRemove)) {
View
3  addon-tailor/src/main/java/org/springframework/roo/addon/tailor/actions/Focus.java
@@ -34,7 +34,8 @@
private final String baseCommand = "module focus --moduleName ";
@Override
- public void executeImpl(final CommandTransformation trafo, final ActionConfig config) {
+ public void executeImpl(final CommandTransformation trafo,
+ final ActionConfig config) {
if ("~".equals(config.getModule())) {
trafo.addOutputCommand(baseCommand, "~");
return;
View
3  ...tailor/src/main/java/org/springframework/roo/addon/tailor/config/TailorConfiguration.java
@@ -47,7 +47,8 @@ public void addCommandConfig(final CommandConfiguration newConfig) {
* @return CommandConfiguration for the command in this TailorConfiguration;
* null if no configuration present for the command
*/
- public CommandConfiguration getCommandConfigFor(final String fullCommandString) {
+ public CommandConfiguration getCommandConfigFor(
+ final String fullCommandString) {
for (final CommandConfiguration config : commandConfigs) {
if (fullCommandString.startsWith(config.getCommandName())) {
return config;
View
9 addon-tailor/src/main/java/org/springframework/roo/addon/tailor/config/xml/TailorParser.java
@@ -49,7 +49,8 @@
* @param tailor element
* @return tailor configurations
*/
- public static TailorConfiguration parseTailorConfiguration(final Element elTailor) {
+ public static TailorConfiguration parseTailorConfiguration(
+ final Element elTailor) {
if (StringUtils.isBlank(elTailor.getAttribute("name"))) {
logTailorXMLInvalid("<tailor> must have a name attribute");
@@ -67,7 +68,8 @@ public static TailorConfiguration parseTailorConfiguration(final Element elTailo
result.setActive(isActive);
}
- final List<Element> elConfigs = XmlUtils.findElements("config", elTailor);
+ final List<Element> elConfigs = XmlUtils.findElements("config",
+ elTailor);
if (elConfigs.isEmpty()) {
logTailorXMLInvalid("<tailor> must have <config> child elements");
return null;
@@ -82,7 +84,8 @@ public static TailorConfiguration parseTailorConfiguration(final Element elTailo
final CommandConfiguration newCmdConfig = new CommandConfiguration();
newCmdConfig.setCommandName(command);
- final List<Element> elActions = XmlUtils.findElements("action", elConfig);
+ final List<Element> elActions = XmlUtils.findElements("action",
+ elConfig);
for (final Element elAction : elActions) {
// Determine the action type
if (StringUtils.isBlank(elAction.getAttribute("type"))) {
View
6 ...c/main/java/org/springframework/roo/addon/tailor/service/DefaultConfigurationLocator.java
@@ -67,7 +67,8 @@ public void setActiveTailorConfiguration(final String name) {
}
protected void bindConfig(final TailorConfigurationFactory factory) {
- final List<TailorConfiguration> configs = factory.createTailorConfiguration();
+ final List<TailorConfiguration> configs = factory
+ .createTailorConfiguration();
if (CollectionUtils.isEmpty(configs)) {
return;
}
@@ -87,7 +88,8 @@ protected void bindConfig(final TailorConfigurationFactory factory) {
protected void unbindConfig(final TailorConfigurationFactory factory) {
// TODO It's a little unelegant to call "create" method here again, but
// we need the name...
- final List<TailorConfiguration> configs = factory.createTailorConfiguration();
+ final List<TailorConfiguration> configs = factory
+ .createTailorConfiguration();
if (CollectionUtils.isEmpty(configs)) {
return;
}
View
9 addon-tailor/src/test/java/org/springframework/roo/addon/tailor/actions/TestFocusModule.java
@@ -24,7 +24,8 @@
public void testList() {
final Focus action = createTestActionObject();
- final ActionConfig config = ActionConfigFactory.focusModuleAction("data,it");
+ final ActionConfig config = ActionConfigFactory
+ .focusModuleAction("data,it");
final CommandTransformation trafo = new CommandTransformation(
"command not relevant for this test");
action.execute(trafo, config);
@@ -54,7 +55,8 @@ public void testModulesNotLoadedYet() {
final Focus action = new Focus();
action.projectOperations = new MockProjectOperationsEmpty();
- final ActionConfig config = ActionConfigFactory.focusModuleAction("domain");
+ final ActionConfig config = ActionConfigFactory
+ .focusModuleAction("domain");
final CommandTransformation trafo = new CommandTransformation(
"command not relevant for this test");
@@ -71,7 +73,8 @@ public void testModulesNotLoadedYet() {
@Test
public void testStandard() {
final Focus action = createTestActionObject();
- final ActionConfig config = ActionConfigFactory.focusModuleAction("domain");
+ final ActionConfig config = ActionConfigFactory
+ .focusModuleAction("domain");
final CommandTransformation trafo = new CommandTransformation(
"command not relevant for this test");
action.execute(trafo, config);
Please sign in to comment.
Something went wrong with that request. Please try again.