help
UltraSina opened this issue · 3 comments
hi , how i can make it ignore classes for import , for example java.lang is default ignored
You might want to use methods such as
or similarthanks , but i use SimpleCompiler for compiling full classes with package name inside of them , and Simple Compiler does not have a methode for imports
First of all: Reminding anyone about issues isn't necessary as we generally get an email and a github notification for every message. This is also the reason why internet etiquette generally advises against doing so as you'll be senselessly distracting people unrelated to this issue (this repo has 58 watchers, a good chunk of them will get notifications for issues), too.
I personally believe that SimpleCompiler won't be able to accomplish this without you editing the code of the file you wish to compile manually. SimpleCompiler is primarily meant as - who guessed it - a simple implementation of the compiler and going beyond that will require you to use lower-level components of janino. For reference, this is how ClassBodyEvaluator does it (ClassBodyEvaluator is in turn used by ScriptEvaluator):
Import generation:
janino/janino/src/main/java/org/codehaus/janino/ClassBodyEvaluator.java
Lines 326 to 357 in 4db1b81
Source file parsing process:
janino/janino/src/main/java/org/codehaus/janino/ClassBodyEvaluator.java
Lines 265 to 298 in 4db1b81