Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import java.time.OffsetDateTime;
import java.util.Collection;
import java.util.Map;
import java.util.Objects;
import java.util.function.Supplier;
import net.thisptr.jackson.jq.BuiltinFunctionLoader;
import net.thisptr.jackson.jq.Scope;
Expand All @@ -35,7 +36,15 @@ public class JQExpressionFactory extends ObjectExpressionFactory {

private WorkflowModelFactory modelFactory = new JacksonModelFactory();

private static Supplier<Scope> scopeSupplier = new DefaultScopeSupplier();
private final Supplier<Scope> scopeSupplier;

public JQExpressionFactory() {
this(new DefaultScopeSupplier());
}

public JQExpressionFactory(Supplier<Scope> scopeSupplier) {
this.scopeSupplier = Objects.requireNonNull(scopeSupplier, "scopeSupplier must be not null");
}

private static class DefaultScopeSupplier implements Supplier<Scope> {
private static class DefaultScope {
Expand Down