Class ScriptValueConverter
java.lang.Object
org.springframework.extensions.webscripts.ScriptValueConverter
Value Converter to marshal objects between Java and Javascript.
- Author:
- Kevin Roast
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectunwrapValue(Object value) Convert an object from a script wrapper value to a serializable value valid outside of the Rhino script processor context.static ObjectConvert an object from any repository serialized value to a valid script object.
-
Method Details
-
unwrapValue
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
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 scopevalue- Property value- Returns:
- Value safe for scripting usage
-