Author: adrianc
Date: Sun Mar 4 09:02:07 2012
New Revision: 1296771
URL:
http://svn.apache.org/viewvc?rev=1296771&view=revLog:
Minor changes to ScriptUtil.java: add private constructor, make class final, code format changes. No functional change.
Modified:
ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java
Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java?rev=1296771&r1=1296770&r2=1296771&view=diff==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/ScriptUtil.java Sun Mar 4 09:02:07 2012
@@ -22,17 +22,11 @@ import org.codehaus.groovy.runtime.Invok
import java.util.Map;
-public class ScriptUtil {
+public final class ScriptUtil {
+
public static final String module = ScriptUtil.class.getName();
- protected static final Object[] EMPTY_ARGS = {};
+ private static final Object[] EMPTY_ARGS = {};
- public static Class<?> parseScript(String language, String script) {
- Class<?> scriptClass = null;
- if ("groovy".equals(language)) {
- scriptClass = GroovyUtil.parseClass(script);
- }
- return scriptClass;
- }
/* TODO: the "evaluate" and "executeScript" method method could be enhanced to implement JSR-223 using code like:
import javax.script.ScriptEngineManager;
import javax.script.ScriptEngine;
@@ -96,4 +90,14 @@ public class ScriptUtil {
throw new IllegalArgumentException("The script type is not yet support for location:" + location);
}
}
+
+ public static Class<?> parseScript(String language, String script) {
+ Class<?> scriptClass = null;
+ if ("groovy".equals(language)) {
+ scriptClass = GroovyUtil.parseClass(script);
+ }
+ return scriptClass;
+ }
+
+ private ScriptUtil() {}
}