Skip to content

Commit 12b489c

Browse files
Clean up CLI
1 parent 9afa76e commit 12b489c

File tree

2 files changed

+2
-25
lines changed

2 files changed

+2
-25
lines changed

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The generated Python code can deserialize and serialize an object.
2222

2323
### Deserializing from a string
2424

25-
To deserialize from a string and create a object of the model specified in the string invoke the function:
25+
To deserialize from a string and create an object of the model specified in the string invoke the function:
2626

2727
`BaseDataClass.rune_deserialize` with the following parameters
2828

src/main/java/com/regnosys/rosetta/generator/python/PythonCodeGeneratorCLI.java

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212
import org.apache.commons.cli.*;
1313
import org.eclipse.emf.ecore.resource.Resource;
1414
import org.eclipse.emf.ecore.resource.ResourceSet;
15-
import org.eclipse.xtext.resource.XtextResourceSet;
1615
import org.eclipse.emf.common.util.URI;
1716
import org.jetbrains.annotations.NotNull;
1817
import org.slf4j.Logger;
1918
import org.slf4j.LoggerFactory;
20-
21-
import jakarta.inject.Inject;
2219
import java.io.IOException;
2320
import java.nio.file.*;
2421
import java.util.*;
@@ -205,8 +202,7 @@ private static void writePythonFiles(Map<String, CharSequence> generatedPython,
205202
// --- Helper classes for model loading and Guice setup ---
206203

207204
static class PythonModelLoader {
208-
@Inject Provider<XtextResourceSet> resourceSetProvider;
209-
205+
210206
public List<RosettaModel> getRosettaModels(List<Resource> resources) {
211207
return resources.stream()
212208
.filter(Objects::nonNull)
@@ -216,25 +212,6 @@ public List<RosettaModel> getRosettaModels(List<Resource> resources) {
216212
.map(r -> (RosettaModel) r)
217213
.collect(Collectors.toList());
218214
}
219-
public XtextResourceSet getResourceSet() {
220-
return resourceSetProvider.get();
221-
}
222-
223-
private static String url(@NotNull java.net.URL c) {
224-
try {
225-
return c.toURI().toURL().toURI().toASCIIString();
226-
} catch (Exception e) {
227-
throw new RuntimeException(e);
228-
}
229-
}
230-
231-
private static Resource getResource(ResourceSet resourceSet, String f) {
232-
try {
233-
return resourceSet.getResource(org.eclipse.emf.common.util.URI.createURI(f, true), true);
234-
} catch (Exception e) {
235-
throw new RuntimeException(e);
236-
}
237-
}
238215
}
239216

240217
static class PythonRosettaRuntimeModule extends RosettaRuntimeModule {

0 commit comments

Comments
 (0)