Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CAMEL-18977: camel-joor - Make the code more flexible for native mode #9208

Merged
merged 1 commit into from Jan 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -116,7 +116,7 @@ public JoorMethod compile(CamelContext camelContext, String script, boolean sing
return answer;
}

private String evalCode(CamelContext camelContext, String fqn, String script, boolean singleQuotes) {
public String evalCode(CamelContext camelContext, String fqn, String script, boolean singleQuotes) {
String qn = fqn.substring(0, fqn.lastIndexOf('.'));
String name = fqn.substring(fqn.lastIndexOf('.') + 1);

Expand Down
Expand Up @@ -41,15 +41,32 @@ public class JoorLanguage extends TypedLanguageSupport implements ScriptingLangu
private static final Logger LOG = LoggerFactory.getLogger(JoorLanguage.class);

private static Boolean java8;
private final JoorCompiler compiler = new JoorCompiler();
private final JoorScriptingCompiler scriptingCompiler = new JoorScriptingCompiler();
private final JoorCompiler compiler;
private final JoorScriptingCompiler scriptingCompiler;
private final Set<String> imports = new TreeSet<>();
private final Map<String, String> aliases = new HashMap<>();

private String configResource = "classpath:camel-joor.properties?optional=true";
private boolean preCompile = true;
private boolean singleQuotes = true;

public JoorLanguage() {
this(new JoorCompiler(), new JoorScriptingCompiler());
}

public JoorLanguage(JoorCompiler compiler, JoorScriptingCompiler scriptingCompiler) {
this.compiler = compiler;
this.scriptingCompiler = scriptingCompiler;
}

public JoorCompiler getCompiler() {
return compiler;
}

public JoorScriptingCompiler getScriptingCompiler() {
return scriptingCompiler;
}

public String getConfigResource() {
return configResource;
}
Expand Down