Class JavascriptValueConverter
- java.lang.Object
-
- org.pentaho.reporting.engine.classic.core.modules.misc.datafactory.JavascriptValueConverter
-
- All Implemented Interfaces:
ScriptValueConverter
public class JavascriptValueConverter extends Object implements ScriptValueConverter
In case we do not run on a JDK 1.6 from Oracle, the "sun" name-space may not be available. We shield ourselves via dynamic class loading. The javax.scripting API is a nightmare to work with when it comes to converting values in and out of the context of the script. We have to rely on these hacks to make it work - luckily everyone is either using Sun's JDK or OpenJDK these days (I hope).e
-
-
Constructor Summary
Constructors Constructor Description JavascriptValueConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
convert(Object o)
Attempts to convert a script-engine internal value to a pure java value.
-
-
-
Method Detail
-
convert
public Object convert(Object o)
Description copied from interface:ScriptValueConverter
Attempts to convert a script-engine internal value to a pure java value. It is important to returnnull
for all values that cannot be converted by this implementation to let other implementations have its turn.- Specified by:
convert
in interfaceScriptValueConverter
- Parameters:
o
- the value to be converted.- Returns:
- the converted value or null if the value is not convertible.
-
-