Class IntrospectableToTruffleAdapter

java.lang.Object
io.micronaut.views.react.truffle.IntrospectableToTruffleAdapter
All Implemented Interfaces:
org.graalvm.polyglot.proxy.Proxy, org.graalvm.polyglot.proxy.ProxyObject

@Internal public final class IntrospectableToTruffleAdapter extends Object implements org.graalvm.polyglot.proxy.ProxyObject
A proxy object similar to that returned by ProxyObject.fromMap(Map), but with support for Micronaut's bean introspection system (a form of compile-time reflection code generation). Reading a key whose value is an introspectable bean will use the BeanMap instead of the regular polyglot mapping.
  • Method Details

    • wrap

      public static org.graalvm.polyglot.Value wrap(org.graalvm.polyglot.Context context, Object object)
      Wraps an object as a Truffle Value suitable for guest access, wrapping introspectable types with IntrospectableToTruffleAdapter.
      Parameters:
      context - The language context to wrap the object into.
      object - Either null, a Map, a Collection, an introspectable object, or any other object supported by the Polyglot interop layer.
      Returns:
      A value that will return true to Value.isProxyObject()
    • getMember

      public Object getMember(String key)
      Specified by:
      getMember in interface org.graalvm.polyglot.proxy.ProxyObject
    • getMemberKeys

      public Object getMemberKeys()
      Specified by:
      getMemberKeys in interface org.graalvm.polyglot.proxy.ProxyObject
    • hasMember

      public boolean hasMember(String key)
      Specified by:
      hasMember in interface org.graalvm.polyglot.proxy.ProxyObject
    • putMember

      public void putMember(String key, org.graalvm.polyglot.Value value)
      Specified by:
      putMember in interface org.graalvm.polyglot.proxy.ProxyObject
    • toString

      public String toString()
      Overrides:
      toString in class Object