MCPcopy Create free account
hub / github.com/mozilla/rhino / jsToJava

Method jsToJava

rhino/src/main/java/org/mozilla/javascript/Context.java:1882–1884  ·  view source on GitHub ↗

Convert a JavaScript value into the desired type. Uses the semantics defined with LiveConnect3 and throws an Illegal argument exception if the conversion cannot be performed. @param value the JavaScript value to convert @param desiredType the Java type to convert to. Primitive Java types are repres

(Object value, Class<?> desiredType)

Source from the content-addressed store, hash-verified

1880 * @throws EvaluatorException if the conversion cannot be performed
1881 */
1882 public static Object jsToJava(Object value, Class<?> desiredType) throws EvaluatorException {
1883 return jsToJava(value, TypeInfoFactory.GLOBAL.create(desiredType));
1884 }
1885
1886 public static Object jsToJava(Object value, TypeInfo desiredType) throws EvaluatorException {
1887 return NativeJavaObject.coerceTypeImpl(desiredType, value);

Callers 15

getMethod · 0.95
evalMethod · 0.95
invokeMethodRawMethod · 0.95
putMethod · 0.95
getTypedPropertyMethod · 0.95
putMethod · 0.95
putMethod · 0.95
toTypeMethod · 0.95
invokeImplMethod · 0.95
putMethod · 0.95
convertResultMethod · 0.95
callMethod · 0.95

Calls 2

coerceTypeImplMethod · 0.95
createMethod · 0.65

Tested by 3

importPackageAndClassMethod · 0.76
importInSameContextMethod · 0.76
readClassAndValueMethod · 0.76