@@ -34,12 +34,10 @@ byte[] processDocument(String handlerId, Integer sourceType) {
34
34
List <People > listPeople = Arrays .asList (new People ("Luthien" , "Tinuviel" , "Queen" ), new People ("Thorin" , "Oakshield" , "King" ));
35
35
// output generation
36
36
DocProcessContext context = DocProcessContext .newContext ("listPeople" , listPeople );
37
- if ( realSourceType == DocFacadeSource .SOURCE_TYPE_JSON ) {
38
- docHelper .getDocProcessConfig ().fullProcess ("document-json" , context .withSourceType ( sourceType ), handlerId , baos );
39
- } else if ( realSourceType == DocFacadeSource .SOURCE_TYPE_YAML ) {
40
- docHelper .getDocProcessConfig ().fullProcess ("document-yaml" , context .withSourceType (sourceType ), handlerId , baos );
41
- } else {
42
- docHelper .getDocProcessConfig ().fullProcess ("document" , context , handlerId , baos );
37
+ switch ( realSourceType ) {
38
+ case DocFacadeSource .SOURCE_TYPE_JSON -> docHelper .getDocProcessConfig ().fullProcess ("document-json" , context .withSourceType ( realSourceType ), handlerId , baos );
39
+ case DocFacadeSource .SOURCE_TYPE_YAML -> docHelper .getDocProcessConfig ().fullProcess ("document-yaml" , context .withSourceType ( realSourceType ), handlerId , baos );
40
+ default -> docHelper .getDocProcessConfig ().fullProcess ("document" , context , handlerId , baos );
43
41
}
44
42
// return the output
45
43
return baos .toByteArray ();
@@ -52,7 +50,8 @@ byte[] processDocument(String handlerId, Integer sourceType) {
52
50
53
51
@ APIResponse (responseCode = "200" , description = "The Markdown document content" )
54
52
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
55
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "markdown" ) } )
53
+ @ Tag ( name = "document" )
54
+ @ Tag ( name = "markdown" )
56
55
@ Operation ( operationId = "MarkdownExample" , summary = "Example Markdown generation" ,
57
56
description = "Generates an example Markdown document using Fugerit Venus Doc handler" )
58
57
@ GET
@@ -64,7 +63,8 @@ public byte[] markdownExample(@QueryParam("sourceType") Integer sourceType) {
64
63
65
64
@ APIResponse (responseCode = "200" , description = "The HTML document content" )
66
65
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
67
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "html" ) } )
66
+ @ Tag ( name = "document" )
67
+ @ Tag ( name = "html" )
68
68
@ Operation ( operationId = "HTMLExample" , summary = "Example HTML generation" ,
69
69
description = "Generates an example HTML document using Fugerit Venus Doc handler" )
70
70
@ GET
@@ -76,7 +76,8 @@ public byte[] htmlExample(@QueryParam("sourceType") Integer sourceType) {
76
76
77
77
@ APIResponse (responseCode = "200" , description = "The AsciiDoc document content" )
78
78
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
79
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "asciidoc" ) } )
79
+ @ Tag ( name = "document" )
80
+ @ Tag ( name = "asciidoc" )
80
81
@ Operation ( operationId = "AsciiDocExample" , summary = "Example AsciiDoc generation" ,
81
82
description = "Generates an example AsciiDoc document using Fugerit Venus Doc handler" )
82
83
@ GET
@@ -88,7 +89,8 @@ public byte[] asciidocExample(@QueryParam("sourceType") Integer sourceType) {
88
89
89
90
@ APIResponse (responseCode = "200" , description = "The PDF document content" )
90
91
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
91
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "pdf" ) } )
92
+ @ Tag ( name = "document" )
93
+ @ Tag ( name = "pdf" )
92
94
@ Operation ( operationId = "PDFExample" , summary = "Example PDF generation" ,
93
95
description = "Generates an example PDF document using Fugerit Venus Doc handler" )
94
96
@ GET
@@ -100,7 +102,8 @@ public byte[] pdfExample(@QueryParam("sourceType") Integer sourceType) {
100
102
101
103
@ APIResponse (responseCode = "200" , description = "The Excel document content" )
102
104
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
103
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "excel" ) } )
105
+ @ Tag ( name = "document" )
106
+ @ Tag ( name = "excel" )
104
107
@ Operation ( operationId = "ExcelExample" , summary = "Example Excel generation" ,
105
108
description = "Generates an example Excel document using Fugerit Venus Doc handler" )
106
109
@ GET
@@ -112,7 +115,8 @@ public byte[] excelExample(@QueryParam("sourceType") Integer sourceType) {
112
115
113
116
@ APIResponse (responseCode = "200" , description = "The CSV document content" )
114
117
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
115
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "csv" ) } )
118
+ @ Tag ( name = "document" )
119
+ @ Tag ( name = "csv" )
116
120
@ Operation ( operationId = "CSVExample" , summary = "Example CSV generation" ,
117
121
description = "Generates an example CSV document using Fugerit Venus Doc handler" )
118
122
@ GET
@@ -124,7 +128,8 @@ public byte[] csvExample(@QueryParam("sourceType") Integer sourceType) {
124
128
125
129
@ APIResponse (responseCode = "200" , description = "The OpenPDF document content" )
126
130
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
127
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "openpdf" ) } )
131
+ @ Tag ( name = "document" )
132
+ @ Tag ( name = "openpdf" )
128
133
@ Operation ( operationId = "OpenPDFExample" , summary = "Example OpenPDF generation" ,
129
134
description = "Generates an example OpenPDF document using Fugerit Venus Doc handler" )
130
135
@ GET
@@ -135,7 +140,8 @@ public byte[] openpdfExample(@QueryParam("sourceType") Integer sourceType) {
135
140
}
136
141
@ APIResponse (responseCode = "200" , description = "The OpenPDFHTML document content" )
137
142
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
138
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "openpdfhtml" ) } )
143
+ @ Tag ( name = "document" )
144
+ @ Tag ( name = "openpdfhtml" )
139
145
@ Operation ( operationId = "OpenPDFHTMLExample" , summary = "Example OpenPDFHTML generation" ,
140
146
description = "Generates an example OpenPDFHTML document using Fugerit Venus Doc handler" )
141
147
@ GET
@@ -146,7 +152,8 @@ public byte[] openpdfhtmlExample(@QueryParam("sourceType") Integer sourceType) {
146
152
}
147
153
@ APIResponse (responseCode = "200" , description = "The RTF document content" )
148
154
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
149
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "rtf" ) } )
155
+ @ Tag ( name = "document" )
156
+ @ Tag ( name = "rtf" )
150
157
@ Operation ( operationId = "RTFExample" , summary = "Example RTF generation" ,
151
158
description = "Generates an example RTF document using Fugerit Venus Doc handler" )
152
159
@ GET
@@ -157,7 +164,8 @@ public byte[] rtfExample(@QueryParam("sourceType") Integer sourceType) {
157
164
}
158
165
@ APIResponse (responseCode = "200" , description = "The PDF document content" )
159
166
@ APIResponse (responseCode = "500" , description = "In case of an unexpected error" )
160
- @ Tags ( { @ Tag ( name = "document" ), @ Tag ( name = "pdf" ) } )
167
+ @ Tag ( name = "document" )
168
+ @ Tag ( name = "pdf" )
161
169
@ Operation ( operationId = "PDFA1bExample" , summary = "Example PDF/A-1b generation" ,
162
170
description = "Generates an example PDF document using Fugerit Venus Doc handler" )
163
171
@ GET
0 commit comments