You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: rewrite-core/src/main/java/org/openrewrite/text/FindAndReplace.java
+14-13Lines changed: 14 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -37,6 +37,19 @@
37
37
@EqualsAndHashCode(callSuper = false)
38
38
publicclassFindAndReplaceextendsRecipe {
39
39
40
+
@Override
41
+
publicStringgetDisplayName() {
42
+
return"Find and replace";
43
+
}
44
+
45
+
@Override
46
+
publicStringgetDescription() {
47
+
return"Textual find and replace, optionally interpreting the search query as a Regular Expression (regex). " +
48
+
"When operating on source files that are language-specific Lossless Semantic " +
49
+
"Tree, such as Java or XML, this operation converts the source file to plain text for the rest of the recipe run. " +
50
+
"So if you are combining this recipe with language-specific recipes in a single recipe run put all the language-specific recipes before this recipe.";
51
+
}
52
+
40
53
@Option(displayName = "Find",
41
54
description = "The text to find (and replace). This snippet can be multiline.",
42
55
example = "blacklist")
@@ -50,7 +63,7 @@ public class FindAndReplace extends Recipe {
50
63
Stringreplace;
51
64
52
65
@Option(displayName = "Regex",
53
-
description = "Default false. If true, `find` will be interpreted as a Regular Expression, and capture group contents will be available in `replace`.",
66
+
description = "Default false. If true, `find` will be interpreted as a [Regular Expression](https://en.wikipedia.org/wiki/Regular_expression), and capture group contents will be available in `replace`.",
54
67
required = false)
55
68
@Nullable
56
69
Booleanregex;
@@ -86,18 +99,6 @@ public class FindAndReplace extends Recipe {
86
99
@Nullable
87
100
StringfilePattern;
88
101
89
-
@Override
90
-
publicStringgetDisplayName() {
91
-
return"Find and replace";
92
-
}
93
-
94
-
@Override
95
-
publicStringgetDescription() {
96
-
return"Simple text find and replace. When the original source file is a language-specific Lossless Semantic " +
97
-
"Tree, this operation irreversibly converts the source file to a plain text file. Subsequent recipes " +
98
-
"will not be able to operate on language-specific type.";
0 commit comments