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: core/esmf-aspect-model-aas-generator/src/main/java/org/eclipse/esmf/aspectmodel/aas/AspectModelAASGenerator.java
Copy file name to clipboardExpand all lines: tools/samm-cli/src/main/java/org/eclipse/esmf/aspect/to/AspectToAasCommand.java
+10-3Lines changed: 10 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -35,6 +35,8 @@ public class AspectToAasCommand extends AbstractCommand {
35
35
publicstaticfinalStringCOMMAND_NAME = "aas";
36
36
publicstaticfinalStringAASX = "aasx";
37
37
publicstaticfinalStringXML = "xml";
38
+
publicstaticfinalStringJSON = "json";
39
+
38
40
39
41
@CommandLine.Option(
40
42
names = { "--output", "-o" },
@@ -43,7 +45,7 @@ public class AspectToAasCommand extends AbstractCommand {
43
45
44
46
@CommandLine.Option(
45
47
names = { "--format", "-f" },
46
-
description = "The file format the AAS is to be generated. Valid options are \"" + AASX + "\" and \"" + XML + "\". Default is \"" + XML + "\"." )
48
+
description = "The file format the AAS is to be generated. Valid options are \"" + AASX + "\", \"" + JSON + "\", and \"" + XML + "\". Default is \"" + XML + "\"." )
47
49
privateStringformat = XML;
48
50
49
51
@CommandLine.ParentCommand
@@ -63,9 +65,14 @@ public void run() {
63
65
// we intentionally override the name of the generated artifact here to the name explicitly
64
66
// desired by the user (outputFilePath), as opposed to what the model thinks it should be
65
67
// called (name)
66
-
if ( format.equals( AASX ) ) {
68
+
switch ( format ) {
69
+
caseAASX:
67
70
generator.generateAASXFile( aspect, name -> getStreamForFile( outputFilePath ) );
68
-
} else {
71
+
break;
72
+
caseJSON:
73
+
generator.generateAasJsonFile( aspect, name -> getStreamForFile( outputFilePath ) );
74
+
break;
75
+
default:
69
76
generator.generateAasXmlFile( aspect, name -> getStreamForFile( outputFilePath ) );
0 commit comments