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

common-workflow-language / cwljava / #389

30 Oct 2025 05:13PM UTC coverage: 58.693% (-0.8%) from 59.538%
#389

Pull #218

github

web-flow
Merge 98b159202 into befd7e4b9
Pull Request #218: Populate the extensionFields; add public accessors for LoadingOptions

230 of 569 new or added lines in 67 files covered. (40.42%)

28 existing lines in 27 files now uncovered.

7535 of 12838 relevant lines covered (58.69%)

0.59 hits per line

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

44.12
/src/main/java/org/w3id/cwl/cwl1_2/CommandInputRecordFieldImpl.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.w3id.cwl.cwl1_2;
16

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

23
/**
24
* Auto-generated class implementation for <I>https://w3id.org/cwl/cwl#CommandInputRecordField</I><BR>
25
 */
26
public class CommandInputRecordFieldImpl extends SaveableImpl implements CommandInputRecordField {
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() {
34
    return this.extensionFields_;
×
35
  }
36

37
  private String name;
38

39
  /**
40
   * Getter for property <I>https://w3id.org/cwl/salad#RecordField/name</I><BR>
41
   * <BLOCKQUOTE>
42
   * The name of the field
43
   *    * </BLOCKQUOTE>
44
   */
45

46
  public String getName() {
47
    return this.name;
×
48
  }
49

50
  private Object doc;
51

52
  /**
53
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
54
   * <BLOCKQUOTE>
55
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
56
   */
57

58
  public Object getDoc() {
59
    return this.doc;
×
60
  }
61

62
  private Object type;
63

64
  /**
65
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
66
   * <BLOCKQUOTE>
67
   * The field type
68
   *    * </BLOCKQUOTE>
69
   */
70

71
  public Object getType() {
72
    return this.type;
×
73
  }
74

75
  private java.util.Optional<String> label;
76

77
  /**
78
   * Getter for property <I>https://w3id.org/cwl/cwl#Labeled/label</I><BR>
79
   * <BLOCKQUOTE>
80
   * A short, human-readable label of this object.   * </BLOCKQUOTE>
81
   */
82

83
  public java.util.Optional<String> getLabel() {
84
    return this.label;
×
85
  }
86

87
  private Object secondaryFiles;
88

89
  /**
90
   * Getter for property <I>https://w3id.org/cwl/cwl#secondaryFiles</I><BR>
91
   * <BLOCKQUOTE>
92
   * Only valid when `type: File` or is an array of `items: File`.
93
   * 
94
   * Provides a pattern or expression specifying files or
95
   * directories that should be included alongside the primary
96
   * file.  Secondary files may be required or optional.  When not
97
   * explicitly specified, secondary files specified for `inputs`
98
   * are required and `outputs` are optional.  An implementation
99
   * must include matching Files and Directories in the
100
   * `secondaryFiles` property of the primary file.  These Files
101
   * and Directories must be transferred and staged alongside the
102
   * primary file.  An implementation may fail workflow execution
103
   * if a required secondary file does not exist.
104
   * 
105
   * If the value is an expression, the value of `self` in the expression
106
   * must be the primary input or output File object to which this binding
107
   * applies.  The `basename`, `nameroot` and `nameext` fields must be
108
   * present in `self`.  For `CommandLineTool` outputs the `path` field must
109
   * also be present.  The expression must return a filename string relative
110
   * to the path to the primary File, a File or Directory object with either
111
   * `path` or `location` and `basename` fields set, or an array consisting
112
   * of strings or File or Directory objects.  It is legal to reference an
113
   * unchanged File or Directory object taken from input as a secondaryFile.
114
   * The expression may return "null" in which case there is no secondaryFile
115
   * from that expression.
116
   * 
117
   * To work on non-filename-preserving storage systems, portable tool
118
   * descriptions should avoid constructing new values from `location`, but
119
   * should construct relative references using `basename` or `nameroot`
120
   * instead.
121
   * 
122
   * If a value in `secondaryFiles` is a string that is not an expression,
123
   * it specifies that the following pattern should be applied to the path
124
   * of the primary file to yield a filename relative to the primary File:
125
   * 
126
   *   1. If string ends with `?` character, remove the last `?` and mark
127
   *     the resulting secondary file as optional.
128
   *   2. If string begins with one or more caret `^` characters, for each
129
   *     caret, remove the last file extension from the path (the last
130
   *     period `.` and all following characters).  If there are no file
131
   *     extensions, the path is unchanged.
132
   *   3. Append the remainder of the string to the end of the file path.
133
   *    * </BLOCKQUOTE>
134
   */
135

136
  public Object getSecondaryFiles() {
137
    return this.secondaryFiles;
×
138
  }
139

140
  private java.util.Optional<Boolean> streamable;
141

142
  /**
143
   * Getter for property <I>https://w3id.org/cwl/cwl#FieldBase/streamable</I><BR>
144
   * <BLOCKQUOTE>
145
   * Only valid when `type: File` or is an array of `items: File`.
146
   * 
147
   * A value of `true` indicates that the file is read or written
148
   * sequentially without seeking.  An implementation may use this flag to
149
   * indicate whether it is valid to stream file contents using a named
150
   * pipe.  Default: `false`.
151
   *    * </BLOCKQUOTE>
152
   */
153

154
  public java.util.Optional<Boolean> getStreamable() {
155
    return this.streamable;
×
156
  }
157

158
  private Object format;
159

160
  /**
161
   * Getter for property <I>https://w3id.org/cwl/cwl#format</I><BR>
162
   * <BLOCKQUOTE>
163
   * Only valid when `type: File` or is an array of `items: File`.
164
   * 
165
   * This must be one or more IRIs of concept nodes
166
   * that represents file formats which are allowed as input to this
167
   * parameter, preferably defined within an ontology.  If no ontology is
168
   * available, file formats may be tested by exact match.
169
   *    * </BLOCKQUOTE>
170
   */
171

172
  public Object getFormat() {
173
    return this.format;
×
174
  }
175

176
  private java.util.Optional<Boolean> loadContents;
177

178
  /**
179
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadContents</I><BR>
180
   * <BLOCKQUOTE>
181
   * Only valid when `type: File` or is an array of `items: File`.
182
   * 
183
   * If true, the file (or each file in the array) must be a UTF-8
184
   * text file 64 KiB or smaller, and the implementation must read
185
   * the entire contents of the file (or file array) and place it
186
   * in the `contents` field of the File object for use by
187
   * expressions.  If the size of the file is greater than 64 KiB,
188
   * the implementation must raise a fatal error.
189
   *    * </BLOCKQUOTE>
190
   */
191

192
  public java.util.Optional<Boolean> getLoadContents() {
193
    return this.loadContents;
×
194
  }
195

196
  private java.util.Optional<LoadListingEnum> loadListing;
197

198
  /**
199
   * Getter for property <I>https://w3id.org/cwl/cwl#LoadContents/loadListing</I><BR>
200
   * <BLOCKQUOTE>
201
   * Only valid when `type: Directory` or is an array of `items: Directory`.
202
   * 
203
   * Specify the desired behavior for loading the `listing` field of
204
   * a Directory object for use by expressions.
205
   * 
206
   * The order of precedence for loadListing is:
207
   * 
208
   *   1. `loadListing` on an individual parameter
209
   *   2. Inherited from `LoadListingRequirement`
210
   *   3. By default: `no_listing`
211
   *    * </BLOCKQUOTE>
212
   */
213

214
  public java.util.Optional<LoadListingEnum> getLoadListing() {
215
    return this.loadListing;
×
216
  }
217

218
  private java.util.Optional<CommandLineBinding> inputBinding;
219

220
  /**
221
   * Getter for property <I>https://w3id.org/cwl/cwl#CommandLineBindable/inputBinding</I><BR>
222
   * <BLOCKQUOTE>
223
   * Describes how to turn this object into command line arguments.   * </BLOCKQUOTE>
224
   */
225

226
  public java.util.Optional<CommandLineBinding> getInputBinding() {
227
    return this.inputBinding;
×
228
  }
229

230
  /**
231
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of CommandInputRecordFieldImpl.
232
   *
233
   * @param __doc_            Document fragment to load this record object from (presumably a
234
                              {@link java.util.Map}).
235
   * @param __baseUri_        Base URI to generate child document IDs against.
236
   * @param __loadingOptions  Context for loading URIs and populating objects.
237
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
238
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
239
   *                             or validation of fields fails.
240
   */
241
  public CommandInputRecordFieldImpl(
242
      final Object __doc_,
243
      final String __baseUri_,
244
      LoadingOptions __loadingOptions,
245
      final String __docRoot_) {
246
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
247
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
248
    // generated names.
249
    String __baseUri = __baseUri_;
1✔
250
    String __docRoot = __docRoot_;
1✔
251
    if (!(__doc_ instanceof java.util.Map)) {
1✔
252
      throw new ValidationException("CommandInputRecordFieldImpl called on non-map");
×
253
    }
254
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
255
    final java.util.List<ValidationException> __errors =
1✔
256
        new java.util.ArrayList<ValidationException>();
257
    if (__loadingOptions != null) {
1✔
258
      this.loadingOptions_ = __loadingOptions;
1✔
259
    }
260
    String name;
261

262
    if (__doc.containsKey("name")) {
1✔
263
      try {
264
        name =
1✔
265
            LoaderInstances
266
                .uri_StringInstance_True_False_None_None
267
                .loadField(__doc.get("name"), __baseUri, __loadingOptions);
1✔
268
      } catch (ValidationException e) {
×
269
        name = null; // won't be used but prevents compiler from complaining.
×
270
        final String __message = "the `name` field is not valid because:";
×
271
        __errors.add(new ValidationException(__message, e));
×
272
      }
1✔
273

274
    } else {
275
      name = null;
×
276
    }
277

278
    if (name == null) {
1✔
279
      if (__docRoot != null) {
×
280
        name = __docRoot;
×
281
      } else {
282
        throw new ValidationException("Missing name");
×
283
      }
284
    }
285
    __baseUri = (String) name;
1✔
286
    Object doc;
287

288
    if (__doc.containsKey("doc")) {
1✔
289
      try {
290
        doc =
×
291
            LoaderInstances
292
                .union_of_NullInstance_or_StringInstance_or_array_of_StringInstance
293
                .loadField(__doc.get("doc"), __baseUri, __loadingOptions);
×
294
      } catch (ValidationException e) {
×
295
        doc = null; // won't be used but prevents compiler from complaining.
×
296
        final String __message = "the `doc` field is not valid because:";
×
297
        __errors.add(new ValidationException(__message, e));
×
298
      }
×
299

300
    } else {
301
      doc = null;
1✔
302
    }
303
    Object type;
304
    try {
305
      type =
1✔
306
          LoaderInstances
307
              .typedsl_union_of_CWLType_or_CommandInputRecordSchema_or_CommandInputEnumSchema_or_CommandInputArraySchema_or_StringInstance_or_array_of_union_of_CWLType_or_CommandInputRecordSchema_or_CommandInputEnumSchema_or_CommandInputArraySchema_or_StringInstance_2
308
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
309
    } catch (ValidationException e) {
×
310
      type = null; // won't be used but prevents compiler from complaining.
×
311
      final String __message = "the `type` field is not valid because:";
×
312
      __errors.add(new ValidationException(__message, e));
×
313
    }
1✔
314
    java.util.Optional<String> label;
315

316
    if (__doc.containsKey("label")) {
1✔
317
      try {
318
        label =
×
319
            LoaderInstances
320
                .optional_StringInstance
321
                .loadField(__doc.get("label"), __baseUri, __loadingOptions);
×
322
      } catch (ValidationException e) {
×
323
        label = null; // won't be used but prevents compiler from complaining.
×
324
        final String __message = "the `label` field is not valid because:";
×
325
        __errors.add(new ValidationException(__message, e));
×
326
      }
×
327

328
    } else {
329
      label = null;
1✔
330
    }
331
    Object secondaryFiles;
332

333
    if (__doc.containsKey("secondaryFiles")) {
1✔
334
      try {
335
        secondaryFiles =
1✔
336
            LoaderInstances
337
                .secondaryfilesdsl_union_of_NullInstance_or_SecondaryFileSchema_or_array_of_SecondaryFileSchema
338
                .loadField(__doc.get("secondaryFiles"), __baseUri, __loadingOptions);
1✔
339
      } catch (ValidationException e) {
×
340
        secondaryFiles = null; // won't be used but prevents compiler from complaining.
×
341
        final String __message = "the `secondaryFiles` field is not valid because:";
×
342
        __errors.add(new ValidationException(__message, e));
×
343
      }
1✔
344

345
    } else {
346
      secondaryFiles = null;
1✔
347
    }
348
    java.util.Optional<Boolean> streamable;
349

350
    if (__doc.containsKey("streamable")) {
1✔
351
      try {
352
        streamable =
×
353
            LoaderInstances
354
                .optional_BooleanInstance
355
                .loadField(__doc.get("streamable"), __baseUri, __loadingOptions);
×
356
      } catch (ValidationException e) {
×
357
        streamable = null; // won't be used but prevents compiler from complaining.
×
358
        final String __message = "the `streamable` field is not valid because:";
×
359
        __errors.add(new ValidationException(__message, e));
×
360
      }
×
361

362
    } else {
363
      streamable = null;
1✔
364
    }
365
    Object format;
366

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

379
    } else {
380
      format = null;
1✔
381
    }
382
    java.util.Optional<Boolean> loadContents;
383

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

396
    } else {
397
      loadContents = null;
1✔
398
    }
399
    java.util.Optional<LoadListingEnum> loadListing;
400

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

413
    } else {
414
      loadListing = null;
1✔
415
    }
416
    java.util.Optional<CommandLineBinding> inputBinding;
417

418
    if (__doc.containsKey("inputBinding")) {
1✔
419
      try {
420
        inputBinding =
1✔
421
            LoaderInstances
422
                .optional_CommandLineBinding
423
                .loadField(__doc.get("inputBinding"), __baseUri, __loadingOptions);
1✔
424
      } catch (ValidationException e) {
×
425
        inputBinding = null; // won't be used but prevents compiler from complaining.
×
426
        final String __message = "the `inputBinding` field is not valid because:";
×
427
        __errors.add(new ValidationException(__message, e));
×
428
      }
1✔
429

430
    } else {
431
      inputBinding = null;
1✔
432
    }
433
    if (!__errors.isEmpty()) {
1✔
434
      throw new ValidationException("Trying 'RecordField'", __errors);
×
435
    }
436
    this.doc = (Object) doc;
1✔
437
    this.name = (String) name;
1✔
438
    this.type = (Object) type;
1✔
439
    this.label = (java.util.Optional<String>) label;
1✔
440
    this.secondaryFiles = (Object) secondaryFiles;
1✔
441
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
442
    this.format = (Object) format;
1✔
443
    this.loadContents = (java.util.Optional<Boolean>) loadContents;
1✔
444
    this.loadListing = (java.util.Optional<LoadListingEnum>) loadListing;
1✔
445
    this.inputBinding = (java.util.Optional<CommandLineBinding>) inputBinding;
1✔
446
    for (String field:__doc.keySet()) {
1✔
447
      if (!attrs.contains(field)) {
1✔
NEW
448
        if (field.contains(":")) {
×
NEW
449
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
450
          extensionFields_.put(expanded_field, __doc.get(field));
×
451
        }
452
      }
453
    }
1✔
454
  }
1✔
455
  private java.util.List<String> attrs = java.util.Arrays.asList("doc", "name", "type", "label", "secondaryFiles", "streamable", "format", "loadContents", "loadListing", "inputBinding");
1✔
456
}
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

© 2026 Coveralls, Inc