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

common-workflow-language / cwljava / #352

07 Apr 2025 10:22AM UTC coverage: 59.538% (-0.6%) from 60.167%
#352

Pull #193

github

web-flow
Merge d636f9333 into 46536cad2
Pull Request #193: Add accessor for the extension field.

0 of 129 new or added lines in 129 files covered. (0.0%)

7347 of 12340 relevant lines covered (59.54%)

0.6 hits per line

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

53.52
/src/main/java/org/w3id/cwl/cwl1_2/CommandInputParameterImpl.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#CommandInputParameter</I><BR> <BLOCKQUOTE>
25
 An input parameter for a CommandLineTool. </BLOCKQUOTE>
26
 */
27
public class CommandInputParameterImpl extends SaveableImpl implements CommandInputParameter {
28
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
29
  private java.util.Map<String, Object> extensionFields_ =
1✔
30
      new java.util.HashMap<String, Object>();
31
  public java.util.Map<String, Object> getExtensionFields() {
NEW
32
    return this.extensionFields_;
×
33
  }
34

35
  private java.util.Optional<String> id;
36

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

43
  public java.util.Optional<String> getId() {
44
    return this.id;
×
45
  }
46

47
  private java.util.Optional<String> label;
48

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

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

59
  private Object secondaryFiles;
60

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

108
  public Object getSecondaryFiles() {
109
    return this.secondaryFiles;
×
110
  }
111

112
  private java.util.Optional<Boolean> streamable;
113

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

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

130
  private Object doc;
131

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

138
  public Object getDoc() {
139
    return this.doc;
×
140
  }
141

142
  private Object format;
143

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

156
  public Object getFormat() {
157
    return this.format;
×
158
  }
159

160
  private java.util.Optional<Boolean> loadContents;
161

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

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

180
  private java.util.Optional<LoadListingEnum> loadListing;
181

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

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

202
  private java.util.Optional<Object> default_;
203

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

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

218
  private Object type;
219

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

227
  public Object getType() {
228
    return this.type;
×
229
  }
230

231
  private java.util.Optional<CommandLineBinding> inputBinding;
232

233
  /**
234
   * Getter for property <I>https://w3id.org/cwl/cwl#CommandInputParameter/inputBinding</I><BR>
235
   * <BLOCKQUOTE>
236
   * Describes how to turn the input parameters of a process into
237
   * command line arguments.
238
   *    * </BLOCKQUOTE>
239
   */
240

241
  public java.util.Optional<CommandLineBinding> getInputBinding() {
242
    return this.inputBinding;
×
243
  }
244

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

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

289
    } else {
290
      id = null;
×
291
    }
292

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

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

320
    } else {
321
      label = null;
1✔
322
    }
323
    Object secondaryFiles;
324

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

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

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

354
    } else {
355
      streamable = null;
1✔
356
    }
357
    Object doc;
358

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

371
    } else {
372
      doc = null;
1✔
373
    }
374
    Object format;
375

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

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

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

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

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

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

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

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

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

467
    } else {
468
      inputBinding = null;
1✔
469
    }
470
    if (!__errors.isEmpty()) {
1✔
471
      throw new ValidationException("Trying 'RecordField'", __errors);
×
472
    }
473
    this.label = (java.util.Optional<String>) label;
1✔
474
    this.secondaryFiles = (Object) secondaryFiles;
1✔
475
    this.streamable = (java.util.Optional<Boolean>) streamable;
1✔
476
    this.doc = (Object) doc;
1✔
477
    this.id = (java.util.Optional<String>) id;
1✔
478
    this.format = (Object) format;
1✔
479
    this.loadContents = (java.util.Optional<Boolean>) loadContents;
1✔
480
    this.loadListing = (java.util.Optional<LoadListingEnum>) loadListing;
1✔
481
    this.default_ = (java.util.Optional<Object>) default_;
1✔
482
    this.type = (Object) type;
1✔
483
    this.inputBinding = (java.util.Optional<CommandLineBinding>) inputBinding;
1✔
484
  }
1✔
485
}
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