@Test public void testDynamicModifications() { String message = "hello\nend"; AtomicReference<String> config = new AtomicReference<>(".*hello.*"); Function<String, Matcher> matcher = RegExpExt.dynamicMatcher(() -> config.get(), Pattern.DOTALL, e -> { throw new IllegalStateException(e); }); assertThat(matcher.apply(message).matches()).isTrue(); config.set(".*foobar.*"); assertThat(matcher.apply(message).matches()).isFalse(); }
public static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, int flags, Consumer<Throwable> onError) { return dynamicMatcherInternal(regExpSource, flags, onError); }
RegExpExt { public static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, int flags, Consumer<Throwable> onError) { return dynamicMatcherInternal(regExpSource, flags, onError); } }
RegExpExt { public static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, int flags, Consumer<Throwable> onError) { return dynamicMatcherInternal(regExpSource, flags, onError); } private  RegExpExt(); }
RegExpExt { public static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, int flags, Consumer<Throwable> onError) { return dynamicMatcherInternal(regExpSource, flags, onError); } private  RegExpExt(); static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, int flags, Consumer<Throwable> onError); static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, String propertyName, int flags, Logger errorLogger); }
RegExpExt { public static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, int flags, Consumer<Throwable> onError) { return dynamicMatcherInternal(regExpSource, flags, onError); } private  RegExpExt(); static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, int flags, Consumer<Throwable> onError); static Function<String, Matcher> dynamicMatcher(Supplier<String> regExpSource, String propertyName, int flags, Logger errorLogger);  }