0

I'm trying to code something in PDI which uses Janino for compilation. This code

Element firstRow = doc.select("tr").first();
Elements headers = firstRow.select("td");
List list = headers.eachText​();

throws and error

A method named "eachText​" is not declared in any enclosing class nor any supertype, nor through a static import

I know that Janino does not support generics, so I looked into this answer https://stackoverflow.com/a/34218510/8142420

AFAIK, you can't use generics in Janino, so Janino can not determine exact class of the object returned by hashtable.get("ERROR_2001") method, so it assumes that Object is returned, which has no keySet() method defined. Try to cast the result of hashtable.get("ERROR_2001") to the value class, contained in your hashtable collection:

Hashtable errorEntry = (Hashtable) hashtable.get("ERROR_2001"); Set set = errorEntry.keySet();

But that doesn't solve my problem. What am I doing wrong?

PalePal
  • 53
  • 1
  • 4
  • That doesn't sound like it's caused by generics. Are you sure you imported the jsoup `Elements` class and not the one from `javax.lang.model.util`? – Sean Van Gorder Feb 09 '18 at 19:05
  • @SeanVanGorder almost. It just got fussy without JAVA class name in front of it. Thanks :) – PalePal Mar 07 '18 at 19:17

0 Answers0