checkstyle WhiteAround
WhiteAroundCheck script
This commit is contained in:
@@ -37,6 +37,6 @@ public interface ScriptExecutor {
|
||||
* @param variables The variables.
|
||||
* @return The result of the execution.
|
||||
*/
|
||||
Object executeScript(ScriptSource scriptSource, Map<String,Object> variables);
|
||||
Object executeScript(ScriptSource scriptSource, Map<String, Object> variables);
|
||||
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ import org.springframework.integration.scripting.ScriptExecutor;
|
||||
|
||||
@Override
|
||||
protected Object postProcess(Object result, ScriptEngine scriptEngine, String script, Bindings bindings) {
|
||||
Object newResult= result;
|
||||
Object newResult = result;
|
||||
if (newResult == null) {
|
||||
String returnVariableName = PythonVariableParser.parseReturnVariable(script);
|
||||
if (bindings != null) {
|
||||
@@ -55,9 +55,9 @@ import org.springframework.integration.scripting.ScriptExecutor;
|
||||
}
|
||||
|
||||
public static class PythonVariableParser {
|
||||
public static String parseReturnVariable(String script){
|
||||
public static String parseReturnVariable(String script) {
|
||||
String[] lines = script.trim().split("\n");
|
||||
String lastLine = lines[lines.length -1];
|
||||
String lastLine = lines[lines.length - 1];
|
||||
String[] tokens = lastLine.split("=");
|
||||
return tokens[0].trim();
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class ScriptExecutingMessageProcessor extends AbstractScriptExecutingMess
|
||||
@Override
|
||||
protected Object executeScript(ScriptSource scriptSource, Map<String, Object> variables) throws Exception {
|
||||
Assert.notNull(scriptSource, "scriptSource must not be null");
|
||||
return this.scriptExecutor.executeScript(scriptSource,variables);
|
||||
return this.scriptExecutor.executeScript(scriptSource, variables);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.integration.scripting.ScriptExecutor;
|
||||
public abstract class ScriptExecutorFactory {
|
||||
|
||||
public static ScriptExecutor getScriptExecutor(String language) {
|
||||
if (language.equalsIgnoreCase("python") || language.equalsIgnoreCase("jython")){
|
||||
if (language.equalsIgnoreCase("python") || language.equalsIgnoreCase("jython")) {
|
||||
return new PythonScriptExecutor();
|
||||
}
|
||||
else if (language.equalsIgnoreCase("ruby") || language.equalsIgnoreCase("jruby")) {
|
||||
|
||||
Reference in New Issue
Block a user