You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: espresso/src/com.oracle.truffle.espresso.polyglot/src/com/oracle/truffle/espresso/polyglot/GuestTypeConversion.java
+18-1Lines changed: 18 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright (c) 2022, 2022, Oracle and/or its affiliates. All rights reserved.
2
+
* Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* The Universal Permissive License (UPL), Version 1.0
@@ -40,6 +40,23 @@
40
40
*/
41
41
packagecom.oracle.truffle.espresso.polyglot;
42
42
43
+
/**
44
+
* This interface must be implemented by a custom defined type converter that is declared as context
45
+
* builder input using the 'java.PolyglotTypeConverters' option. If a polyglot object that is passed
46
+
* into Espresso has a declared meta name that matches the declaration used for the GuestConversion,
47
+
* the toGuest method is invoked. This invocation is responsible for returning a guest object
48
+
* matching the parameterized type.
49
+
* </p>
50
+
* Note that, in the case where the target type, e.g. a method parameter type in the guest, is not
51
+
* assignable from the returned instance of the toGuest method, the converted value is ignored.
52
+
* Hence, other custom or internal type mappings might be attempted in sequence in response to such
53
+
* incompatible conversion. For example, the built-in collection type mappings
54
+
* (java.BuiltInPolyglotCollections) might be compatible for the incoming polyglot object, or there
55
+
* might be custom interface mapping (java.PolyglotInterfaceMappings).
56
+
*
57
+
* @param <T> the guest type this converter is converting an interop meta name-mapped polyglot
Copy file name to clipboardExpand all lines: espresso/src/com.oracle.truffle.espresso/src/com/oracle/truffle/espresso/nodes/interop/ToEspressoNode.java
0 commit comments