Class PolyglotUtils


  • public class PolyglotUtils
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String JS  
      static java.lang.String LLVM  
      static java.lang.String PY  
      static java.lang.String PYC  
      static java.lang.String PYTHON  
    • Constructor Summary

      Constructors 
      Constructor Description
      PolyglotUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getLanguage​(java.lang.String source)  
      static java.lang.String getLanguage​(org.graalvm.polyglot.Source source)  
      static java.lang.String getName​(org.graalvm.polyglot.Value value)  
      static java.util.Optional<org.graalvm.polyglot.Value> getValue​(org.graalvm.polyglot.Value value, java.lang.String memberKey)  
      static <O> O invokeMemberOrElse​(org.graalvm.polyglot.Value value, java.lang.String member, @Nullable java.util.function.Supplier<O> superFn)  
      static <TREE extends Tree,​CTX>
      TREE
      invokeMemberOrElse​(org.graalvm.polyglot.Value value, java.lang.String member, TREE tree, CTX ctx, java.util.function.BiFunction<TREE,​CTX,​TREE> superFn)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PolyglotUtils

        public PolyglotUtils()
    • Method Detail

      • getLanguage

        public static java.lang.String getLanguage​(java.lang.String source)
      • getLanguage

        public static java.lang.String getLanguage​(org.graalvm.polyglot.Source source)
      • getName

        public static java.lang.String getName​(org.graalvm.polyglot.Value value)
      • getValue

        public static java.util.Optional<org.graalvm.polyglot.Value> getValue​(org.graalvm.polyglot.Value value,
                                                                              java.lang.String memberKey)
      • invokeMemberOrElse

        @Nullable
        public static <O> O invokeMemberOrElse​(org.graalvm.polyglot.Value value,
                                               java.lang.String member,
                                               @Nullable
                                               @Nullable java.util.function.Supplier<O> superFn)
      • invokeMemberOrElse

        public static <TREE extends Tree,​CTX> TREE invokeMemberOrElse​(org.graalvm.polyglot.Value value,
                                                                            java.lang.String member,
                                                                            @Nullable
                                                                            TREE tree,
                                                                            CTX ctx,
                                                                            java.util.function.BiFunction<TREE,​CTX,​TREE> superFn)