Skip to content

Commit d9dc404

Browse files
rename fixes
1 parent 525fe99 commit d9dc404

File tree

11 files changed

+69
-15
lines changed

11 files changed

+69
-15
lines changed

annot/src/main/java/com/predic8/membrane/annot/generator/JsonSchemaGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
* - Choose/cases/case has one nesting to much
3838
* - apiKey/extractors/expressionExtractor/expression => too much?
3939
*/
40-
public class JsonSchemaGenerator extends AbstractK8sGenerator {
40+
public class JsonSchemaGenerator extends AbstractGrammar {
4141

4242
private final Map<String, Boolean> topLevelAdded = new HashMap<>();
4343

annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/AbstractK8sGenerator.java renamed to annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/AbstractGrammar.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
package com.predic8.membrane.annot.generator.kubernetes;
1515

1616
import com.fasterxml.jackson.databind.*;
17-
import com.fasterxml.jackson.databind.node.*;
18-
import com.predic8.membrane.annot.generator.kubernetes.model.*;
1917
import com.predic8.membrane.annot.model.ElementInfo;
2018
import com.predic8.membrane.annot.model.MainInfo;
2119
import com.predic8.membrane.annot.model.Model;
@@ -34,7 +32,7 @@
3432
/**
3533
* Bundles functionality for kubernetes file generation
3634
*/
37-
public abstract class AbstractK8sGenerator {
35+
public abstract class AbstractGrammar {
3836

3937
protected final ObjectMapper om = new ObjectMapper();
4038
protected final ObjectWriter writer = om.writerWithDefaultPrettyPrinter();
@@ -53,7 +51,7 @@ public WritableNames(ElementInfo ei) {
5351
}
5452
}
5553

56-
public AbstractK8sGenerator(final ProcessingEnvironment processingEnv) {
54+
public AbstractGrammar(final ProcessingEnvironment processingEnv) {
5755
this.processingEnv = processingEnv;
5856
}
5957

annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/K8sHelperGenerator.java renamed to annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/Grammar.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727
/**
2828
* Autogenerates a helper file for JSON parsing
2929
*/
30-
public class K8sHelperGenerator extends AbstractK8sGenerator {
30+
public class Grammar extends AbstractGrammar {
3131

32-
public K8sHelperGenerator(ProcessingEnvironment processingEnv) {
32+
public Grammar(ProcessingEnvironment processingEnv) {
3333
super(processingEnv);
3434
}
3535

3636
@Override
3737
protected String fileName() {
38-
return K8sHelperGenerator.class.getSimpleName() + "AutoGenerated";
38+
return Grammar.class.getSimpleName() + "AutoGenerated";
3939
}
4040

4141
@Override
@@ -90,12 +90,12 @@ private void writeClassContent(Writer w, MainInfo mainInfo) throws IOException {
9090
import java.util.List;
9191
import java.util.HashMap;
9292
import java.util.ArrayList;
93-
import com.predic8.membrane.annot.K8sHelperGenerator;
93+
import com.predic8.membrane.annot.Grammar;
9494
9595
/**
9696
* Automatically generated by {@link %s}
9797
*/
98-
public class %s implements K8sHelperGenerator {
98+
public class %s implements Grammar {
9999
private static Map<String, Class<?>> elementMapping = new HashMap<>();
100100
private static Map<String, Map<String, Class<?>>> localElementMapping = new HashMap<>();
101101
private static List<String> crdSingularNames = new ArrayList<>();
@@ -137,7 +137,7 @@ public String getSchemaLocation() {
137137
static {
138138
""".formatted(
139139
mainInfo.getAnnotation().outputPackage(),
140-
K8sHelperGenerator.class.getName(),
140+
Grammar.class.getName(),
141141
fileName(),
142142
mainInfo.getAnnotation().outputPackage()
143143
.replaceAll(".spring$", ".json")

annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/K8sJsonSchemaGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
/**
2929
* Generates JSON Schema (draft 2019-09/2020-12) to validate Kubernetes CustomResourceDefinitions.
3030
*/
31-
public class K8sJsonSchemaGenerator extends AbstractK8sGenerator {
31+
public class K8sJsonSchemaGenerator extends AbstractGrammar {
3232

3333
public K8sJsonSchemaGenerator(ProcessingEnvironment processingEnv) {
3434
super(processingEnv);

annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/K8sYamlGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
/**
3030
* Generates ClusterRoles, ClusterRoleBindings and CustomResourceDefinitions for kubernetes integration.
3131
*/
32-
public class K8sYamlGenerator extends AbstractK8sGenerator {
32+
public class K8sYamlGenerator extends AbstractGrammar {
3333

3434
private final List<String> crdPlurals;
3535

annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/KubernetesBootstrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ public KubernetesBootstrapper(final ProcessingEnvironment processingEnv) {
3232
public void boot(final Model model) throws IOException {
3333
new K8sYamlGenerator(processingEnv).write(model);
3434
new K8sJsonSchemaGenerator(processingEnv).write(model);
35-
new K8sHelperGenerator(processingEnv).write(model);
35+
new Grammar(processingEnv).write(model);
3636
}
3737
}

annot/src/main/java/com/predic8/membrane/annot/yaml/MethodSetter.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright 2025 predic8 GmbH, www.predic8.com
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
package com.predic8.membrane.annot.yaml;
216

317
import com.predic8.membrane.annot.MCChildElement;

annot/src/main/java/com/predic8/membrane/annot/yaml/NodeValidationUtils.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright 2025 predic8 GmbH, www.predic8.com
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
package com.predic8.membrane.annot.yaml;
216

317
import com.fasterxml.jackson.databind.JsonNode;

annot/src/main/java/com/predic8/membrane/annot/yaml/ParsingContext.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright 2025 predic8 GmbH, www.predic8.com
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
package com.predic8.membrane.annot.yaml;
216

317
import com.predic8.membrane.annot.*;

annot/src/main/java/com/predic8/membrane/annot/yaml/ParsingException.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/* Copyright 2025 predic8 GmbH, www.predic8.com
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License. */
14+
115
package com.predic8.membrane.annot.yaml;
216

317
import com.fasterxml.jackson.databind.JsonNode;

0 commit comments

Comments
 (0)