@Test void postProcess() { final String source = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<project xmlns:xsi=\"http: + " xsi:schemaLocation=\"http: + " <modelVersion>4.0.0</modelVersion>\n" + "</project>\n"; final String expected = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<project xmlns:xsi=\"http: + " xsi:schemaLocation=\"http: + " <modelVersion>4.0.0</modelVersion>\n" + "</project>\n"; asserTransformation(source, Collections.emptyList(), expected); }
static String postprocess(String src, String result) { for (Pattern p : POSTPROCESS_PATTERNS) { final Matcher srcMatcher = p.matcher(src); if (srcMatcher.find()) { final String replacement = Matcher.quoteReplacement(srcMatcher.group()); result = p.matcher(result).replaceFirst(replacement); } } return result; }
PomTransformer { static String postprocess(String src, String result) { for (Pattern p : POSTPROCESS_PATTERNS) { final Matcher srcMatcher = p.matcher(src); if (srcMatcher.find()) { final String replacement = Matcher.quoteReplacement(srcMatcher.group()); result = p.matcher(result).replaceFirst(replacement); } } return result; } }
PomTransformer { static String postprocess(String src, String result) { for (Pattern p : POSTPROCESS_PATTERNS) { final Matcher srcMatcher = p.matcher(src); if (srcMatcher.find()) { final String replacement = Matcher.quoteReplacement(srcMatcher.group()); result = p.matcher(result).replaceFirst(replacement); } } return result; } PomTransformer(Path path, Charset charset); }
PomTransformer { static String postprocess(String src, String result) { for (Pattern p : POSTPROCESS_PATTERNS) { final Matcher srcMatcher = p.matcher(src); if (srcMatcher.find()) { final String replacement = Matcher.quoteReplacement(srcMatcher.group()); result = p.matcher(result).replaceFirst(replacement); } } return result; } PomTransformer(Path path, Charset charset); void transform(Transformation... transformations); void transform(Collection<Transformation> transformations); }
PomTransformer { static String postprocess(String src, String result) { for (Pattern p : POSTPROCESS_PATTERNS) { final Matcher srcMatcher = p.matcher(src); if (srcMatcher.find()) { final String replacement = Matcher.quoteReplacement(srcMatcher.group()); result = p.matcher(result).replaceFirst(replacement); } } return result; } PomTransformer(Path path, Charset charset); void transform(Transformation... transformations); void transform(Collection<Transformation> transformations);  }