Class ScriptValueConverter

java.lang.Object
org.springframework.extensions.webscripts.ScriptValueConverter

public final class ScriptValueConverter extends Object
Value Converter to marshal objects between Java and Javascript.
Author:
Kevin Roast
  • Method Details

    • unwrapValue

      public static Object unwrapValue(Object value)
      Convert an object from a script wrapper value to a serializable value valid outside of the Rhino script processor context. This includes converting JavaScript Array objects to Lists of valid objects.
      Parameters:
      value - Value to convert from script wrapper object to external object value.
      Returns:
      unwrapped and converted value.
    • wrapValue

      public static Object wrapValue(org.mozilla.javascript.Scriptable scope, Object value)
      Convert an object from any repository serialized value to a valid script object. This includes converting Collection multi-value properties into JavaScript Array objects.
      Parameters:
      scope - Scripting scope
      value - Property value
      Returns:
      Value safe for scripting usage