• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

common-workflow-language / cwljava / #421

16 Dec 2025 08:00PM UTC coverage: 57.962% (-0.01%) from 57.972%
#421

Pull #218

github

web-flow
Merge 0d5009150 into 4d3285bc2
Pull Request #218: "id" is a required field in for `Parameter`s and `WorkflowStep`s

23 of 43 new or added lines in 12 files covered. (53.49%)

10 existing lines in 10 files now uncovered.

7735 of 13345 relevant lines covered (57.96%)

0.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

48.3
/src/main/java/org/commonwl/cwlsdk/cwl1_2/WorkflowInputParameterImpl.java
1
// Copyright Common Workflow Language project contributors
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

15
package org.commonwl.cwlsdk.cwl1_2;
16

17
import org.commonwl.cwlsdk.cwl1_2.utils.LoaderInstances;
18
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptions;
19
import org.commonwl.cwlsdk.cwl1_2.utils.LoadingOptionsBuilder;
20
import org.commonwl.cwlsdk.cwl1_2.utils.SaveableImpl;
21
import org.commonwl.cwlsdk.cwl1_2.utils.ValidationException;
22

23
/**
24
* Auto-generated class implementation for <I>https://w3id.org/cwl/cwl#WorkflowInputParameter</I><BR>
25
 */
26
public class WorkflowInputParameterImpl extends SaveableImpl implements WorkflowInputParameter {
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
28
  private java.util.Map<String, Object> extensionFields_ =
1✔
29
      new java.util.HashMap<String, Object>();
30
  public LoadingOptions getLoadingOptions() {
31
    return this.loadingOptions_;
×
32
  }
33
  public java.util.Map<String, Object> getExtensionFields() {
34
    return this.extensionFields_;
×
35
  }
36

37
  private String id;
38

39
  /**
40
   * Getter for property <I>https://w3id.org/cwl/cwl#Parameter/id</I><BR>
41
   * <BLOCKQUOTE>
42
   * The unique identifier for this Parameter.   * </BLOCKQUOTE>
43
   */
44

45
  public String getId() {
46
    return this.id;
1✔
47
  }
48

49
  private java.util.Optional<String> label;
50

51
  /**
52
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
53
   * <BLOCKQUOTE>
54
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
55
   */
56

57
  public java.util.Optional<String> getLabel() {
58
    return this.label;
×
59
  }
60

61
  private Object secondaryFiles;
62

63
  /**
64
   * Getter for property <I>https://w3id.org/cwl/cwl#secondaryFiles</I><BR>
65
   * <BLOCKQUOTE>
66
   * Only valid when `type: File` or is an array of `items: File`.
67
   * 
68
   * Provides a pattern or expression specifying files or
69
   * directories that should be included alongside the primary
70
   * file.  Secondary files may be required or optional.  When not
71
   * explicitly specified, secondary files specified for `inputs`
72
   * are required and `outputs` are optional.  An implementation
73
   * must include matching Files and Directories in the
74
   * `secondaryFiles` property of the primary file.  These Files
75
   * and Directories must be transferred and staged alongside the
76
   * primary file.  An implementation may fail workflow execution
77
   * if a required secondary file does not exist.
78
   * 
79
   * If the value is an expression, the value of `self` in the expression
80
   * must be the primary input or output File object to which this binding
81
   * applies.  The `basename`, `nameroot` and `nameext` fields must be
82
   * present in `self`.  For `CommandLineTool` outputs the `path` field must
83
   * also be present.  The expression must return a filename string relative
84
   * to the path to the primary File, a File or Directory object with either
85
   * `path` or `location` and `basename` fields set, or an array consisting
86
   * of strings or File or Directory objects.  It is legal to reference an
87
   * unchanged File or Directory object taken from input as a secondaryFile.
88
   * The expression may return &quot;null&quot; in which case there is no secondaryFile
89
   * from that expression.
90
   * 
91
   * To work on non-filename-preserving storage systems, portable tool
92
   * descriptions should avoid constructing new values from `location`, but
93
   * should construct relative references using `basename` or `nameroot`
94
   * instead.
95
   * 
96
   * If a value in `secondaryFiles` is a string that is not an expression,
97
   * it specifies that the following pattern should be applied to the path
98
   * of the primary file to yield a filename relative to the primary File:
99
   * 
100
   *   1. If string ends with `?` character, remove the last `?` and mark
101
   *     the resulting secondary file as optional.
102
   *   2. If string begins with one or more caret `^` characters, for each
103
   *     caret, remove the last file extension from the path (the last
104
   *     period `.` and all following characters).  If there are no file
105
   *     extensions, the path is unchanged.
106
   *   3. Append the remainder of the string to the end of the file path.
107
   *    * </BLOCKQUOTE>
108
   */
109

110
  public Object getSecondaryFiles() {
111
    return this.secondaryFiles;
1✔
112
  }
113

114
  private java.util.Optional<Boolean> streamable;
115

116
  /**
117
   * Getter for property <I>https://w3id.org/cwl/cwl#FieldBase/streamable</I><BR>
118
   * <BLOCKQUOTE>
119
   * Only valid when `type: File` or is an array of `items: File`.
120
   * 
121
   * A value of `true` indicates that the file is read or written
122
   * sequentially without seeking.  An implementation may use this flag to
123
   * indicate whether it is valid to stream file contents using a named
124
   * pipe.  Default: `false`.
125
   *    * </BLOCKQUOTE>
126
   */
127

128
  public java.util.Optional<Boolean> getStreamable() {
129
    return this.streamable;
×
130
  }
131

132
  private Object doc;
133

134
  /**
135
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
136
   * <BLOCKQUOTE>
137
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
138
   */
139

140
  public Object getDoc() {
141
    return this.doc;
×
142
  }
143

144
  private Object format;
145

146
  /**
147
   * Getter for property <I>https://w3id.org/cwl/cwl#format</I><BR>
148
   * <BLOCKQUOTE>
149
   * Only valid when `type: File` or is an array of `items: File`.
150
   * 
151
   * This must be one or more IRIs of concept nodes
152
   * that represents file formats which are allowed as input to this
153
   * parameter, preferably defined within an ontology.  If no ontology is
154
   * available, file formats may be tested by exact match.
155
   *    * </BLOCKQUOTE>
156
   */
157

158
  public Object getFormat() {
159
    return this.format;
×
160
  }
161

162
  private java.util.Optional<Boolean> loadContents;
163

164
  /**
165
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadContents</I><BR>
166
   * <BLOCKQUOTE>
167
   * Only valid when `type: File` or is an array of `items: File`.
168
   * 
169
   * If true, the file (or each file in the array) must be a UTF-8
170
   * text file 64 KiB or smaller, and the implementation must read
171
   * the entire contents of the file (or file array) and place it
172
   * in the `contents` field of the File object for use by
173
   * expressions.  If the size of the file is greater than 64 KiB,
174
   * the implementation must raise a fatal error.
175
   *    * </BLOCKQUOTE>
176
   */
177

178
  public java.util.Optional<Boolean> getLoadContents() {
179
    return this.loadContents;
×
180
  }
181

182
  private java.util.Optional<LoadListingEnum> loadListing;
183

184
  /**
185
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadListing</I><BR>
186
   * <BLOCKQUOTE>
187
   * Only valid when `type: Directory` or is an array of `items: Directory`.
188
   * 
189
   * Specify the desired behavior for loading the `listing` field of
190
   * a Directory object for use by expressions.
191
   * 
192
   * The order of precedence for loadListing is:
193
   * 
194
   *   1. `loadListing` on an individual parameter
195
   *   2. Inherited from `LoadListingRequirement`
196
   *   3. By default: `no_listing`
197
   *    * </BLOCKQUOTE>
198
   */
199

200
  public java.util.Optional<LoadListingEnum> getLoadListing() {
201
    return this.loadListing;
×
202
  }
203

204
  private java.util.Optional<Object> default_;
205

206
  /**
207
   * Getter for property <I>https://w3id.org/cwl/salad#default</I><BR>
208
   * <BLOCKQUOTE>
209
   * The default value to use for this parameter if the parameter is missing
210
   * from the input object, or if the value of the parameter in the input
211
   * object is `null`.  Default values are applied before evaluating expressions
212
   * (e.g. dependent `valueFrom` fields).
213
   *    * </BLOCKQUOTE>
214
   */
215

216
  public java.util.Optional<Object> getDefault() {
217
    return this.default_;
×
218
  }
219

220
  private Object type;
221

222
  /**
223
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
224
   * <BLOCKQUOTE>
225
   * Specify valid types of data that may be assigned to this parameter.
226
   *    * </BLOCKQUOTE>
227
   */
228

229
  public Object getType() {
230
    return this.type;
×
231
  }
232

233
  private java.util.Optional<InputBinding> inputBinding;
234

235
  /**
236
   * Getter for property <I>https://w3id.org/cwl/cwl#WorkflowInputParameter/inputBinding</I><BR>
237
   * <BLOCKQUOTE>
238
   * Deprecated.  Preserved for v1.0 backwards compatibility.  Will be removed in
239
   * CWL v2.0.  Use `WorkflowInputParameter.loadContents` instead.
240
   *    * </BLOCKQUOTE>
241
   */
242

243
  public java.util.Optional<InputBinding> getInputBinding() {
244
    return this.inputBinding;
×
245
  }
246

247
  /**
248
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of WorkflowInputParameterImpl.
249
   *
250
   * @param __doc_            Document fragment to load this record object from (presumably a
251
                              {@link java.util.Map}).
252
   * @param __baseUri_        Base URI to generate child document IDs against.
253
   * @param __loadingOptions  Context for loading URIs and populating objects.
254
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
255
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
256
   *                             or validation of fields fails.
257
   */
258
  public WorkflowInputParameterImpl(
259
      final Object __doc_,
260
      final String __baseUri_,
261
      LoadingOptions __loadingOptions,
262
      final String __docRoot_) {
263
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
264
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
265
    // generated names.
266
    String __baseUri = __baseUri_;
1✔
267
    String __docRoot = __docRoot_;
1✔
268
    if (!(__doc_ instanceof java.util.Map)) {
1✔
269
      throw new ValidationException("WorkflowInputParameterImpl called on non-map");
×
270
    }
271
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
272
    final java.util.List<ValidationException> __errors =
1✔
273
        new java.util.ArrayList<ValidationException>();
274
    if (__loadingOptions != null) {
1✔
275
      this.loadingOptions_ = __loadingOptions;
1✔
276
    }
277
    String id;
278

279
    if (__doc.containsKey("id")) {
1✔
280
      try {
281
        id =
1✔
282
            LoaderInstances
283
                .uri_StringInstance_True_False_None_None
284
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
1✔
285
      } catch (ValidationException e) {
×
286
        id = null; // won't be used but prevents compiler from complaining.
×
287
        final String __message = "the `id` field is not valid because:";
×
288
        __errors.add(new ValidationException(__message, e));
×
289
      }
1✔
290

291
    } else {
292
      id = null;
×
293
    }
294

295
    if (id == null) {
1✔
UNCOV
296
      if (__docRoot != null) {
×
NEW
297
        id = __docRoot;
×
298
      } else {
NEW
299
        throw new ValidationException("Missing id");
×
300
      }
301
    }
302
    __baseUri = (String) id;
1✔
303
    java.util.Optional<String> label;
304

305
    if (__doc.containsKey("label")) {
1✔
306
      try {
307
        label =
×
308
            LoaderInstances
309
                .optional_StringInstance
310
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
×
311
      } catch (ValidationException e) {
×
312
        label = null; // won't be used but prevents compiler from complaining.
×
313
        final String __message = "the `label` field is not valid because:";
×
314
        __errors.add(new ValidationException(__message, e));
×
315
      }
×
316

317
    } else {
318
      label = null;
1✔
319
    }
320
    Object secondaryFiles;
321

322
    if (__doc.containsKey("secondaryFiles")) {
1✔
323
      try {
324
        secondaryFiles =
1✔
325
            LoaderInstances
326
                .secondaryfilesdsl_union_of_NullInstance_or_SecondaryFileSchema_or_array_of_SecondaryFileSchema
327
                .loadField(__doc.get("secondaryFiles"), __baseUri, __loadingOptions);
1✔
328
      } catch (ValidationException e) {
×
329
        secondaryFiles = null; // won't be used but prevents compiler from complaining.
×
330
        final String __message = "the `secondaryFiles` field is not valid because:";
×
331
        __errors.add(new ValidationException(__message, e));
×
332
      }
1✔
333

334
    } else {
335
      secondaryFiles = null;
1✔
336
    }
337
    java.util.Optional<Boolean> streamable;
338

339
    if (__doc.containsKey("streamable")) {
1✔
340
      try {
341
        streamable =
×
342
            LoaderInstances
343
                .optional_BooleanInstance
344
                .loadField(__doc.get("streamable"), __baseUri, __loadingOptions);
×
345
      } catch (ValidationException e) {
×
346
        streamable = null; // won't be used but prevents compiler from complaining.
×
347
        final String __message = "the `streamable` field is not valid because:";
×
348
        __errors.add(new ValidationException(__message, e));
×
349
      }
×
350

351
    } else {
352
      streamable = null;
1✔
353
    }
354
    Object doc;
355

356
    if (__doc.containsKey("doc")) {
1✔
357
      try {
358
        doc =
1✔
359
            LoaderInstances
360
                .union_of_NullInstance_or_StringInstance_or_array_of_StringInstance
361
                .loadField(__doc.get("doc"), __baseUri, __loadingOptions);
1✔
362
      } catch (ValidationException e) {
×
363
        doc = null; // won't be used but prevents compiler from complaining.
×
364
        final String __message = "the `doc` field is not valid because:";
×
365
        __errors.add(new ValidationException(__message, e));
×
366
      }
1✔
367

368
    } else {
369
      doc = null;
1✔
370
    }
371
    Object format;
372

373
    if (__doc.containsKey("format")) {
1✔
374
      try {
375
        format =
×
376
            LoaderInstances
377
                .uri_union_of_NullInstance_or_StringInstance_or_array_of_StringInstance_or_ExpressionLoader_True_False_None_True
378
                .loadField(__doc.get("format"), __baseUri, __loadingOptions);
×
379
      } catch (ValidationException e) {
×
380
        format = null; // won't be used but prevents compiler from complaining.
×
381
        final String __message = "the `format` field is not valid because:";
×
382
        __errors.add(new ValidationException(__message, e));
×
383
      }
×
384

385
    } else {
386
      format = null;
1✔
387
    }
388
    java.util.Optional<Boolean> loadContents;
389

390
    if (__doc.containsKey("loadContents")) {
1✔
391
      try {
392
        loadContents =
1✔
393
            LoaderInstances
394
                .optional_BooleanInstance
395
                .loadField(__doc.get("loadContents"), __baseUri, __loadingOptions);
1✔
396
      } catch (ValidationException e) {
×
397
        loadContents = null; // won't be used but prevents compiler from complaining.
×
398
        final String __message = "the `loadContents` field is not valid because:";
×
399
        __errors.add(new ValidationException(__message, e));
×
400
      }
1✔
401

402
    } else {
403
      loadContents = null;
1✔
404
    }
405
    java.util.Optional<LoadListingEnum> loadListing;
406

407
    if (__doc.containsKey("loadListing")) {
1✔
408
      try {
409
        loadListing =
1✔
410
            LoaderInstances
411
                .optional_LoadListingEnum
412
                .loadField(__doc.get("loadListing"), __baseUri, __loadingOptions);
1✔
413
      } catch (ValidationException e) {
×
414
        loadListing = null; // won't be used but prevents compiler from complaining.
×
415
        final String __message = "the `loadListing` field is not valid because:";
×
416
        __errors.add(new ValidationException(__message, e));
×
417
      }
1✔
418

419
    } else {
420
      loadListing = null;
1✔
421
    }
422
    java.util.Optional<Object> default_;
423

424
    if (__doc.containsKey("default")) {
1✔
425
      try {
426
        default_ =
1✔
427
            LoaderInstances
428
                .optional_CWLObjectType
429
                .loadField(__doc.get("default"), __baseUri, __loadingOptions);
1✔
430
      } catch (ValidationException e) {
×
431
        default_ = null; // won't be used but prevents compiler from complaining.
×
432
        final String __message = "the `default` field is not valid because:";
×
433
        __errors.add(new ValidationException(__message, e));
×
434
      }
1✔
435

436
    } else {
437
      default_ = null;
1✔
438
    }
439
    Object type;
440
    try {
441
      type =
1✔
442
          LoaderInstances
443
              .typedsl_union_of_CWLType_or_InputRecordSchema_or_InputEnumSchema_or_InputArraySchema_or_StringInstance_or_array_of_union_of_CWLType_or_InputRecordSchema_or_InputEnumSchema_or_InputArraySchema_or_StringInstance_2
444
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
445
    } catch (ValidationException e) {
×
446
      type = null; // won't be used but prevents compiler from complaining.
×
447
      final String __message = "the `type` field is not valid because:";
×
448
      __errors.add(new ValidationException(__message, e));
×
449
    }
1✔
450
    java.util.Optional<InputBinding> inputBinding;
451

452
    if (__doc.containsKey("inputBinding")) {
1✔
453
      try {
454
        inputBinding =
×
455
            LoaderInstances
456
                .optional_InputBinding
457
                .loadField(__doc.get("inputBinding"), __baseUri, __loadingOptions);
×
458
      } catch (ValidationException e) {
×
459
        inputBinding = null; // won't be used but prevents compiler from complaining.
×
460
        final String __message = "the `inputBinding` field is not valid because:";
×
461
        __errors.add(new ValidationException(__message, e));
×
462
      }
×
463

464
    } else {
465
      inputBinding = null;
1✔
466
    }
467
    if (!__errors.isEmpty()) {
1✔
468
      throw new ValidationException("Trying 'RecordField'", __errors);
×
469
    }
470
    this.label = (java.util.Optional<String>) label;
1✔
471
    this.secondaryFiles = (Object) secondaryFiles;
1✔
472
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
473
    this.doc = (Object) doc;
1✔
474
    this.id = (String) id;
1✔
475
    this.format = (Object) format;
1✔
476
    this.loadContents = (java.util.Optional<Boolean>) loadContents;
1✔
477
    this.loadListing = (java.util.Optional<LoadListingEnum>) loadListing;
1✔
478
    this.default_ = (java.util.Optional<Object>) default_;
1✔
479
    this.type = (Object) type;
1✔
480
    this.inputBinding = (java.util.Optional<InputBinding>) inputBinding;
1✔
481
    for (String field:__doc.keySet()) {
1✔
482
      if (!attrs.contains(field)) {
1✔
483
        if (field.contains(":")) {
×
484
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
485
          extensionFields_.put(expanded_field, __doc.get(field));
×
486
        }
487
      }
488
    }
1✔
489
  }
1✔
490
  private java.util.List<String> attrs = java.util.Arrays.asList("label", "secondaryFiles", "streamable", "doc", "id", "format", "loadContents", "loadListing", "default", "type", "inputBinding");
1✔
491
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc