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

common-workflow-language / cwljava / #394

31 Oct 2025 04:10PM UTC coverage: 57.972% (-1.6%) from 59.538%
#394

push

github

mr-c
rename package to a namespace that we control

7575 of 12994 new or added lines in 261 files covered. (58.3%)

7752 of 13372 relevant lines covered (57.97%)

0.58 hits per line

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

50.67
/src/main/java/org/commonwl/cwlsdk/cwl1_1/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_1;
16

17
import org.commonwl.cwlsdk.cwl1_1.utils.LoaderInstances;
18
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptions;
19
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptionsBuilder;
20
import org.commonwl.cwlsdk.cwl1_1.utils.SaveableImpl;
21
import org.commonwl.cwlsdk.cwl1_1.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() {
NEW
31
    return this.loadingOptions_;
×
32
  }
33
  public java.util.Map<String, Object> getExtensionFields() {
NEW
34
    return this.extensionFields_;
×
35
  }
36

37
  private java.util.Optional<String> id;
38

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

45
  public java.util.Optional<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() {
NEW
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 "null" 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() {
NEW
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() {
NEW
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, preferrably 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() {
NEW
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
   * Read up to the first 64 KiB of text from the file and place it in the
170
   * "contents" field of the file object for use by expressions.
171
   *    * </BLOCKQUOTE>
172
   */
173

174
  public java.util.Optional<Boolean> getLoadContents() {
NEW
175
    return this.loadContents;
×
176
  }
177

178
  private java.util.Optional<LoadListingEnum> loadListing;
179

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

196
  public java.util.Optional<LoadListingEnum> getLoadListing() {
NEW
197
    return this.loadListing;
×
198
  }
199

200
  private java.util.Optional<Object> default_;
201

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

212
  public java.util.Optional<Object> getDefault() {
NEW
213
    return this.default_;
×
214
  }
215

216
  private Object type;
217

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

225
  public Object getType() {
NEW
226
    return this.type;
×
227
  }
228

229
  private java.util.Optional<InputBinding> inputBinding;
230

231
  /**
232
   * Getter for property <I>https://w3id.org/cwl/cwl#WorkflowInputParameter/inputBinding</I><BR>
233
   * <BLOCKQUOTE>
234
   * Deprecated.  Preserved for v1.0 backwards compatability.  Will be removed in
235
   * CWL v2.0.  Use `WorkflowInputParameter.loadContents` instead.
236
   *    * </BLOCKQUOTE>
237
   */
238

239
  public java.util.Optional<InputBinding> getInputBinding() {
NEW
240
    return this.inputBinding;
×
241
  }
242

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

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

287
    } else {
NEW
288
      id = null;
×
289
    }
290

291
    Boolean __original_is_null = id == null;
1✔
292
    if (id == null) {
1✔
NEW
293
      if (__docRoot != null) {
×
NEW
294
        id = java.util.Optional.of(__docRoot);
×
295
      } else {
NEW
296
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
297
      }
298
    }
299
    if (__original_is_null) {
1✔
NEW
300
        __baseUri = __baseUri_;
×
301
    } else {
302
        __baseUri = (String) id.orElse(null);
1✔
303
    }
304
    java.util.Optional<String> label;
305

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

© 2026 Coveralls, Inc