File tree Expand file tree Collapse file tree 2 files changed +4
-31
lines changed Expand file tree Collapse file tree 2 files changed +4
-31
lines changed Original file line number Diff line number Diff line change @@ -16,37 +16,10 @@ import java.util.stream.Stream;
16
16
*/
17
17
public class OpenMINDS {
18
18
19
- private final OpenMINDSContext context;
19
+ private OpenMINDS(){}
20
20
21
- private OpenMINDS(OpenMINDSContext context){
22
- this.context = context;
23
- }
24
-
25
- private static void persist(String targetDirectory, Stream<Instance > instances){
26
- File dir = new File(targetDirectory);
27
- if(!dir.exists()){
28
- dir.mkdirs();
29
- }
30
- instances.forEach(i -> {
31
- File f = new File(targetDirectory+File.separator+i.getLocalId().id()+".jsonld");
32
- try {
33
- ParsingUtils.OBJECT_MAPPER.writerWithDefaultPrettyPrinter().writeValue(f, i);
34
- } catch (IOException e) {
35
- throw new RuntimeException(e);
36
- }
37
- });
38
- }
39
-
40
- {% for version in relevant_versions %} public static OpenMINDS.{{version[0] |upper}}{{version[1:] }} {{version}}(){
41
- return {{version}}(OpenMINDSContext.defaultContext());
42
- }
43
-
44
- public static OpenMINDS.{{version[0] |upper}}{{version[1:] }} {{version}}(String idPrefix){
45
- return {{version}}(new OpenMINDSContext(idPrefix, true));
46
- }
47
-
48
- private static OpenMINDS.{{version[0] |upper}}{{version[1:] }} {{version}}(OpenMINDSContext context) {
49
- return new OpenMINDS(context).new {{version[0] |upper}}{{version[1:] }}();
21
+ {% for version in relevant_versions %} public static OpenMINDS.{{version[0] |upper}}{{version[1:] }} {{version}}() {
22
+ return new OpenMINDS().new {{version[0] |upper}}{{version[1:] }}();
50
23
}
51
24
52
25
public final class {{version[0] |upper}}{{version[1:] }} {
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ public class {{ class_name }} extends Instance {% if implemented_interfaces %}im
44
44
45
45
public {{ class_name }} build(OpenMINDSContext context) {
46
46
if ({{ class_name }}.this.id == null) {
47
- {{ class_name }}.this.id = InstanceId.withPrefix(UUID.randomUUID().toString(), openMINDSContext .idPrefix());
47
+ {{ class_name }}.this.id = InstanceId.withPrefix(UUID.randomUUID().toString(), context .idPrefix());
48
48
}
49
49
{{ class_name }}.this.type = SEMANTIC_NAME;
50
50
return {{ class_name }}.this;
You can’t perform that action at this time.
0 commit comments