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

common-workflow-language / cwljava / #423

17 Dec 2025 10:33AM UTC coverage: 56.982% (-1.0%) from 57.972%
#423

push

github

web-flow
refresh 2025-12 (including extensions) (#218)

* "id" is a required field in for Parameters and WorkflowSteps
* regen; drop CommandLineBindableImpl; add optional CWL extensions

185 of 577 new or added lines in 21 files covered. (32.06%)

10 existing lines in 10 files now uncovered.

7892 of 13850 relevant lines covered (56.98%)

0.57 hits per line

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

0.0
/src/main/java/org/commonwl/cwlsdk/cwl1_2/LoopInputImpl.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>http://commonwl.org/cwltool#LoopInput</I><BR>
25
 */
26
public class LoopInputImpl extends SaveableImpl implements LoopInput {
NEW
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
NEW
28
  private java.util.Map<String, Object> extensionFields_ =
×
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>http://commonwl.org/cwltool#LoopInput/id</I><BR>
41
   * <BLOCKQUOTE>
42
   * It must reference the `id` of one of the elements in the `in` field of the step.   * </BLOCKQUOTE>
43
   */
44

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

49
  private java.util.Optional<Object> default_;
50

51
  /**
52
   * Getter for property <I>https://w3id.org/cwl/salad#default</I><BR>
53
   * <BLOCKQUOTE>
54
   * The default value for this parameter to use if either there is no
55
   * `source` field, or the value produced by the `source` is `null`.  The
56
   * default must be applied prior to scattering or evaluating `valueFrom`.
57
   *    * </BLOCKQUOTE>
58
   */
59

60
  public java.util.Optional<Object> getDefault() {
NEW
61
    return this.default_;
×
62
  }
63

64
  private java.util.Optional<LinkMergeMethod> linkMerge;
65

66
  /**
67
   * Getter for property <I>http://commonwl.org/cwltool#LoopInput/linkMerge</I><BR>
68
   * <BLOCKQUOTE>
69
   * The method to use to merge multiple inbound links into a single array.
70
   * If not specified, the default method is &quot;merge_nested&quot;.
71
   *    * </BLOCKQUOTE>
72
   */
73

74
  public java.util.Optional<LinkMergeMethod> getLinkMerge() {
NEW
75
    return this.linkMerge;
×
76
  }
77

78
  private Object loopSource;
79

80
  /**
81
   * Getter for property <I>http://commonwl.org/cwltool#LoopInput/loopSource</I><BR>
82
   * <BLOCKQUOTE>
83
   * Specifies one or more of the step output parameters that will
84
   * provide input to the loop iterations after the first one (inputs
85
   * of the first iteration are the step input parameters).
86
   *    * </BLOCKQUOTE>
87
   */
88

89
  public Object getLoopSource() {
NEW
90
    return this.loopSource;
×
91
  }
92

93
  private java.util.Optional<PickValueMethod> pickValue;
94

95
  /**
96
   * Getter for property <I>http://commonwl.org/cwltool#LoopInput/pickValue</I><BR>
97
   * <BLOCKQUOTE>
98
   * The method to use to choose non-null elements among multiple sources.
99
   *    * </BLOCKQUOTE>
100
   */
101

102
  public java.util.Optional<PickValueMethod> getPickValue() {
NEW
103
    return this.pickValue;
×
104
  }
105

106
  private Object valueFrom;
107

108
  /**
109
   * Getter for property <I>http://commonwl.org/cwltool#LoopInput/valueFrom</I><BR>
110
   * <BLOCKQUOTE>
111
   * To use valueFrom, [StepInputExpressionRequirement](#StepInputExpressionRequirement) must
112
   * be specified in the workflow or workflow step requirements.
113
   * 
114
   * If `valueFrom` is a constant string value, use this as the value for
115
   * this input parameter.
116
   * 
117
   * If `valueFrom` is a parameter reference or expression, it must be
118
   * evaluated to yield the actual value to be assigned to the input field.
119
   * 
120
   * The `self` value in the parameter reference or expression must be
121
   * `null` if there is no `loopSource` field, or the value of the
122
   * parameter(s) specified in the `loopSource` field.
123
   * 
124
   * The value of `inputs` in the parameter reference or expression must be
125
   * the input object to the previous iteration of the workflow step (or the initial
126
   * inputs for the first iteration).
127
   *    * </BLOCKQUOTE>
128
   */
129

130
  public Object getValueFrom() {
NEW
131
    return this.valueFrom;
×
132
  }
133

134
  /**
135
   * Used by {@link org.commonwl.cwlsdk.cwl1_2.utils.RootLoader} to construct instances of LoopInputImpl.
136
   *
137
   * @param __doc_            Document fragment to load this record object from (presumably a
138
                              {@link java.util.Map}).
139
   * @param __baseUri_        Base URI to generate child document IDs against.
140
   * @param __loadingOptions  Context for loading URIs and populating objects.
141
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
142
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
143
   *                             or validation of fields fails.
144
   */
145
  public LoopInputImpl(
146
      final Object __doc_,
147
      final String __baseUri_,
148
      LoadingOptions __loadingOptions,
149
      final String __docRoot_) {
NEW
150
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
×
151
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
152
    // generated names.
NEW
153
    String __baseUri = __baseUri_;
×
NEW
154
    String __docRoot = __docRoot_;
×
NEW
155
    if (!(__doc_ instanceof java.util.Map)) {
×
NEW
156
      throw new ValidationException("LoopInputImpl called on non-map");
×
157
    }
NEW
158
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
×
NEW
159
    final java.util.List<ValidationException> __errors =
×
160
        new java.util.ArrayList<ValidationException>();
NEW
161
    if (__loadingOptions != null) {
×
NEW
162
      this.loadingOptions_ = __loadingOptions;
×
163
    }
164
    java.util.Optional<String> id;
165

NEW
166
    if (__doc.containsKey("id")) {
×
167
      try {
NEW
168
        id =
×
169
            LoaderInstances
170
                .uri_optional_StringInstance_True_False_None_None
NEW
171
                .loadField(__doc.get("id"), __baseUri, __loadingOptions);
×
NEW
172
      } catch (ValidationException e) {
×
NEW
173
        id = null; // won't be used but prevents compiler from complaining.
×
NEW
174
        final String __message = "the `id` field is not valid because:";
×
NEW
175
        __errors.add(new ValidationException(__message, e));
×
NEW
176
      }
×
177

178
    } else {
NEW
179
      id = null;
×
180
    }
181

NEW
182
    Boolean __original_is_null = id == null;
×
NEW
183
    if (id == null) {
×
NEW
184
      if (__docRoot != null) {
×
NEW
185
        id = java.util.Optional.of(__docRoot);
×
186
      } else {
NEW
187
        id = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
×
188
      }
189
    }
NEW
190
    if (__original_is_null) {
×
NEW
191
        __baseUri = __baseUri_;
×
192
    } else {
NEW
193
        __baseUri = (String) id.orElse(null);
×
194
    }
195
    java.util.Optional<Object> default_;
196

NEW
197
    if (__doc.containsKey("default")) {
×
198
      try {
NEW
199
        default_ =
×
200
            LoaderInstances
201
                .optional_AnyInstance
NEW
202
                .loadField(__doc.get("default"), __baseUri, __loadingOptions);
×
NEW
203
      } catch (ValidationException e) {
×
NEW
204
        default_ = null; // won't be used but prevents compiler from complaining.
×
NEW
205
        final String __message = "the `default` field is not valid because:";
×
NEW
206
        __errors.add(new ValidationException(__message, e));
×
NEW
207
      }
×
208

209
    } else {
NEW
210
      default_ = null;
×
211
    }
212
    java.util.Optional<LinkMergeMethod> linkMerge;
213

NEW
214
    if (__doc.containsKey("linkMerge")) {
×
215
      try {
NEW
216
        linkMerge =
×
217
            LoaderInstances
218
                .optional_LinkMergeMethod
NEW
219
                .loadField(__doc.get("linkMerge"), __baseUri, __loadingOptions);
×
NEW
220
      } catch (ValidationException e) {
×
NEW
221
        linkMerge = null; // won't be used but prevents compiler from complaining.
×
NEW
222
        final String __message = "the `linkMerge` field is not valid because:";
×
NEW
223
        __errors.add(new ValidationException(__message, e));
×
NEW
224
      }
×
225

226
    } else {
NEW
227
      linkMerge = null;
×
228
    }
229
    Object loopSource;
230

NEW
231
    if (__doc.containsKey("loopSource")) {
×
232
      try {
NEW
233
        loopSource =
×
234
            LoaderInstances
235
                .uri_union_of_NullInstance_or_StringInstance_or_array_of_StringInstance_False_False_1_None
NEW
236
                .loadField(__doc.get("loopSource"), __baseUri, __loadingOptions);
×
NEW
237
      } catch (ValidationException e) {
×
NEW
238
        loopSource = null; // won't be used but prevents compiler from complaining.
×
NEW
239
        final String __message = "the `loopSource` field is not valid because:";
×
NEW
240
        __errors.add(new ValidationException(__message, e));
×
NEW
241
      }
×
242

243
    } else {
NEW
244
      loopSource = null;
×
245
    }
246
    java.util.Optional<PickValueMethod> pickValue;
247

NEW
248
    if (__doc.containsKey("pickValue")) {
×
249
      try {
NEW
250
        pickValue =
×
251
            LoaderInstances
252
                .optional_PickValueMethod
NEW
253
                .loadField(__doc.get("pickValue"), __baseUri, __loadingOptions);
×
NEW
254
      } catch (ValidationException e) {
×
NEW
255
        pickValue = null; // won't be used but prevents compiler from complaining.
×
NEW
256
        final String __message = "the `pickValue` field is not valid because:";
×
NEW
257
        __errors.add(new ValidationException(__message, e));
×
NEW
258
      }
×
259

260
    } else {
NEW
261
      pickValue = null;
×
262
    }
263
    Object valueFrom;
264

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

277
    } else {
NEW
278
      valueFrom = null;
×
279
    }
NEW
280
    if (!__errors.isEmpty()) {
×
NEW
281
      throw new ValidationException("Trying 'RecordField'", __errors);
×
282
    }
NEW
283
    this.default_ = (java.util.Optional<Object>) default_;
×
NEW
284
    this.id = (java.util.Optional<String>) id;
×
NEW
285
    this.linkMerge = (java.util.Optional<LinkMergeMethod>) linkMerge;
×
NEW
286
    this.loopSource = (Object) loopSource;
×
NEW
287
    this.pickValue = (java.util.Optional<PickValueMethod>) pickValue;
×
NEW
288
    this.valueFrom = (Object) valueFrom;
×
NEW
289
    for (String field:__doc.keySet()) {
×
NEW
290
      if (!attrs.contains(field)) {
×
NEW
291
        if (field.contains(":")) {
×
NEW
292
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
293
          extensionFields_.put(expanded_field, __doc.get(field));
×
294
        }
295
      }
NEW
296
    }
×
NEW
297
  }
×
NEW
298
  private java.util.List<String> attrs = java.util.Arrays.asList("default", "id", "linkMerge", "loopSource", "pickValue", "valueFrom");
×
299
}
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