File tree 10 files changed +86
-6
lines changed
rewrite-core/src/main/java/org/openrewrite 10 files changed +86
-6
lines changed Original file line number Diff line number Diff line change @@ -37,10 +37,10 @@ public class DataTable<Row> {
37
37
private final Class <Row > type ;
38
38
39
39
@ Language ("markdown" )
40
- private final String displayName ;
40
+ private final @ NlsRewrite . DisplayName String displayName ;
41
41
42
42
@ Language ("markdown" )
43
- private final String description ;
43
+ private final @ NlsRewrite . Description String description ;
44
44
45
45
@ Setter
46
46
private boolean enabled = true ;
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2024 the original author or authors.
3
+ * <p>
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ * <p>
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ * <p>
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package org .openrewrite ;
17
+
18
+ public class MyRecipe extends Recipe {
19
+
20
+ @ Override
21
+ public String getDisplayName () {
22
+ return "My Title" ;
23
+ }
24
+
25
+ @ Override
26
+ public String getDescription () {
27
+ return "" ;
28
+ }
29
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright 2024 the original author or authors.
3
+ * <p>
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ * <p>
8
+ * https://www.apache.org/licenses/LICENSE-2.0
9
+ * <p>
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ package org .openrewrite ;
17
+
18
+ import org .jetbrains .annotations .Nls ;
19
+
20
+ import java .lang .annotation .ElementType ;
21
+ import java .lang .annotation .Target ;
22
+
23
+ public class NlsRewrite {
24
+ @ Target ({ElementType .TYPE_USE , ElementType .PARAMETER , ElementType .METHOD })
25
+ public @ Nls (capitalization = Nls .Capitalization .Sentence ) @interface DisplayName {
26
+ }
27
+
28
+ @ Target ({ElementType .TYPE_USE , ElementType .PARAMETER , ElementType .METHOD })
29
+ public @ Nls (capitalization = Nls .Capitalization .Sentence ) @interface Description {
30
+ }
31
+ }
Original file line number Diff line number Diff line change 25
25
@ Target ({ElementType .FIELD , ElementType .METHOD })
26
26
@ Retention (RetentionPolicy .RUNTIME )
27
27
public @interface Option {
28
- @ Language ("markdown" ) String displayName () default "" ;
29
- @ Language ("markdown" ) String description () default "" ;
28
+ @ Language ("markdown" ) @ NlsRewrite .DisplayName String displayName () default "" ;
29
+
30
+ @ Language ("markdown" ) @ NlsRewrite .Description String description () default "" ;
31
+
30
32
String example () default "" ;
33
+
31
34
String [] valid () default "" ;
35
+
32
36
boolean required () default true ;
33
37
}
Original file line number Diff line number Diff line change 20
20
import com .fasterxml .jackson .annotation .JsonTypeInfo ;
21
21
import lombok .Setter ;
22
22
import org .intellij .lang .annotations .Language ;
23
+ import org .jetbrains .annotations .Nls ;
23
24
import org .openrewrite .config .DataTableDescriptor ;
24
25
import org .openrewrite .config .OptionDescriptor ;
25
26
import org .openrewrite .config .RecipeDescriptor ;
@@ -103,7 +104,7 @@ public int maxCycles() {
103
104
* @return The display name.
104
105
*/
105
106
@ Language ("markdown" )
106
- public abstract String getDisplayName ();
107
+ public abstract @ NlsRewrite . DisplayName String getDisplayName ();
107
108
108
109
/**
109
110
* A human-readable display name for this recipe instance, including some descriptive
@@ -179,7 +180,7 @@ public String getInstanceNameSuffix() {
179
180
* @return The display name.
180
181
*/
181
182
@ Language ("markdown" )
182
- public abstract String getDescription ();
183
+ public abstract @ NlsRewrite . Description String getDescription ();
183
184
184
185
/**
185
186
* A set of strings used for categorizing related recipes. For example
Original file line number Diff line number Diff line change 18
18
import lombok .Value ;
19
19
import lombok .With ;
20
20
import org .intellij .lang .annotations .Language ;
21
+ import org .openrewrite .NlsRewrite ;
21
22
22
23
import java .util .Set ;
23
24
@@ -29,11 +30,13 @@ public class CategoryDescriptor {
29
30
public static final int HIGHEST_PRECEDENCE = Integer .MAX_VALUE ;
30
31
31
32
@ Language ("markdown" )
33
+ @ NlsRewrite .DisplayName
32
34
String displayName ;
33
35
34
36
String packageName ;
35
37
36
38
@ Language ("markdown" )
39
+ @ NlsRewrite .Description
37
40
String description ;
38
41
39
42
Set <String > tags ;
Original file line number Diff line number Diff line change 17
17
18
18
import lombok .EqualsAndHashCode ;
19
19
import lombok .Value ;
20
+ import org .openrewrite .NlsRewrite ;
20
21
import org .openrewrite .internal .lang .Nullable ;
21
22
22
23
@ Value
@@ -30,8 +31,10 @@ public class ColumnDescriptor {
30
31
String type ;
31
32
32
33
@ Nullable
34
+ @ NlsRewrite .DisplayName
33
35
String displayName ;
34
36
35
37
@ Nullable
38
+ @ NlsRewrite .Description
36
39
String description ;
37
40
}
Original file line number Diff line number Diff line change 17
17
18
18
import lombok .EqualsAndHashCode ;
19
19
import lombok .Value ;
20
+ import org .openrewrite .NlsRewrite ;
20
21
21
22
import java .util .List ;
22
23
@@ -27,8 +28,10 @@ public class DataTableDescriptor {
27
28
@ EqualsAndHashCode .Include
28
29
String name ;
29
30
31
+ @ NlsRewrite .DisplayName
30
32
String displayName ;
31
33
34
+ @ NlsRewrite .Description
32
35
String description ;
33
36
34
37
@ EqualsAndHashCode .Include
Original file line number Diff line number Diff line change 17
17
18
18
import lombok .EqualsAndHashCode ;
19
19
import lombok .Value ;
20
+ import org .openrewrite .NlsRewrite ;
20
21
import org .openrewrite .internal .lang .Nullable ;
21
22
22
23
import java .util .List ;
@@ -32,9 +33,11 @@ public class OptionDescriptor {
32
33
String type ;
33
34
34
35
@ Nullable
36
+ @ NlsRewrite .DisplayName
35
37
String displayName ;
36
38
37
39
@ Nullable
40
+ @ NlsRewrite .Description
38
41
String description ;
39
42
40
43
@ Nullable
Original file line number Diff line number Diff line change 19
19
import lombok .Data ;
20
20
import lombok .EqualsAndHashCode ;
21
21
import lombok .With ;
22
+ import org .openrewrite .NlsRewrite ;
22
23
import org .openrewrite .Tree ;
23
24
import org .openrewrite .Validated ;
24
25
import org .openrewrite .internal .lang .Nullable ;
@@ -42,9 +43,11 @@ public class NamedStyles implements Marker {
42
43
@ EqualsAndHashCode .Include
43
44
String name ;
44
45
46
+ @ NlsRewrite .DisplayName
45
47
String displayName ;
46
48
47
49
@ Nullable
50
+ @ NlsRewrite .Description
48
51
String description ;
49
52
50
53
Set <String > tags ;
You can’t perform that action at this time.
0 commit comments