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

common-workflow-language / cwljava / #388

30 Oct 2025 04:55PM UTC coverage: 58.693% (-0.8%) from 59.538%
#388

Pull #218

github

web-flow
Merge ab8576a5b 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

62.37
/src/main/java/org/w3id/cwl/cwl1_2/CommandInputEnumSchemaImpl.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#CommandInputEnumSchema</I><BR>
25
 */
26
public class CommandInputEnumSchemaImpl extends SaveableImpl implements CommandInputEnumSchema {
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 java.util.Optional<String> name;
38

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

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

49
  private java.util.List<String> symbols;
50

51
  /**
52
   * Getter for property <I>https://w3id.org/cwl/salad#symbols</I><BR>
53
   * <BLOCKQUOTE>
54
   * Defines the set of valid symbols.   * </BLOCKQUOTE>
55
   */
56

57
  public java.util.List<String> getSymbols() {
58
    return this.symbols;
×
59
  }
60

61
  private Enum_name type;
62

63
  /**
64
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
65
   * <BLOCKQUOTE>
66
   * Must be `enum`   * </BLOCKQUOTE>
67
   */
68

69
  public Enum_name getType() {
70
    return this.type;
×
71
  }
72

73
  private java.util.Optional<String> label;
74

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

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

85
  private Object doc;
86

87
  /**
88
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
89
   * <BLOCKQUOTE>
90
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
91
   */
92

93
  public Object getDoc() {
94
    return this.doc;
×
95
  }
96

97
  private java.util.Optional<CommandLineBinding> inputBinding;
98

99
  /**
100
   * Getter for property <I>https://w3id.org/cwl/cwl#CommandLineBindable/inputBinding</I><BR>
101
   * <BLOCKQUOTE>
102
   * Describes how to turn this object into command line arguments.   * </BLOCKQUOTE>
103
   */
104

105
  public java.util.Optional<CommandLineBinding> getInputBinding() {
106
    return this.inputBinding;
×
107
  }
108

109
  /**
110
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of CommandInputEnumSchemaImpl.
111
   *
112
   * @param __doc_            Document fragment to load this record object from (presumably a
113
                              {@link java.util.Map}).
114
   * @param __baseUri_        Base URI to generate child document IDs against.
115
   * @param __loadingOptions  Context for loading URIs and populating objects.
116
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
117
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
118
   *                             or validation of fields fails.
119
   */
120
  public CommandInputEnumSchemaImpl(
121
      final Object __doc_,
122
      final String __baseUri_,
123
      LoadingOptions __loadingOptions,
124
      final String __docRoot_) {
125
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
126
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
127
    // generated names.
128
    String __baseUri = __baseUri_;
1✔
129
    String __docRoot = __docRoot_;
1✔
130
    if (!(__doc_ instanceof java.util.Map)) {
1✔
131
      throw new ValidationException("CommandInputEnumSchemaImpl called on non-map");
×
132
    }
133
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
134
    final java.util.List<ValidationException> __errors =
1✔
135
        new java.util.ArrayList<ValidationException>();
136
    if (__loadingOptions != null) {
1✔
137
      this.loadingOptions_ = __loadingOptions;
1✔
138
    }
139
    java.util.Optional<String> name;
140

141
    if (__doc.containsKey("name")) {
1✔
142
      try {
143
        name =
1✔
144
            LoaderInstances
145
                .uri_optional_StringInstance_True_False_None_None
146
                .loadField(__doc.get("name"), __baseUri, __loadingOptions);
1✔
147
      } catch (ValidationException e) {
×
148
        name = null; // won't be used but prevents compiler from complaining.
×
149
        final String __message = "the `name` field is not valid because:";
×
150
        __errors.add(new ValidationException(__message, e));
×
151
      }
1✔
152

153
    } else {
154
      name = null;
1✔
155
    }
156

157
    Boolean __original_is_null = name == null;
1✔
158
    if (name == null) {
1✔
159
      if (__docRoot != null) {
1✔
160
        name = java.util.Optional.of(__docRoot);
×
161
      } else {
162
        name = java.util.Optional.of("_:" + java.util.UUID.randomUUID().toString());
1✔
163
      }
164
    }
165
    if (__original_is_null) {
1✔
166
        __baseUri = __baseUri_;
1✔
167
    } else {
168
        __baseUri = (String) name.orElse(null);
1✔
169
    }
170
    java.util.List<String> symbols;
171
    try {
172
      symbols =
1✔
173
          LoaderInstances
174
              .uri_array_of_StringInstance_True_False_None_None
175
              .loadField(__doc.get("symbols"), __baseUri, __loadingOptions);
1✔
176
    } catch (ValidationException e) {
1✔
177
      symbols = null; // won't be used but prevents compiler from complaining.
1✔
178
      final String __message = "the `symbols` field is not valid because:";
1✔
179
      __errors.add(new ValidationException(__message, e));
1✔
180
    }
1✔
181
    Enum_name type;
182
    try {
183
      type =
1✔
184
          LoaderInstances
185
              .typedsl_Enum_name_2
186
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
1✔
187
    } catch (ValidationException e) {
1✔
188
      type = null; // won't be used but prevents compiler from complaining.
1✔
189
      final String __message = "the `type` field is not valid because:";
1✔
190
      __errors.add(new ValidationException(__message, e));
1✔
191
    }
1✔
192
    java.util.Optional<String> label;
193

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

206
    } else {
207
      label = null;
1✔
208
    }
209
    Object doc;
210

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

223
    } else {
224
      doc = null;
1✔
225
    }
226
    java.util.Optional<CommandLineBinding> inputBinding;
227

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

240
    } else {
241
      inputBinding = null;
1✔
242
    }
243
    if (!__errors.isEmpty()) {
1✔
244
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
245
    }
246
    this.name = (java.util.Optional<String>) name;
1✔
247
    this.symbols = (java.util.List<String>) symbols;
1✔
248
    this.type = (Enum_name) type;
1✔
249
    this.label = (java.util.Optional<String>) label;
1✔
250
    this.doc = (Object) doc;
1✔
251
    this.inputBinding = (java.util.Optional<CommandLineBinding>) inputBinding;
1✔
252
    for (String field:__doc.keySet()) {
1✔
253
      if (!attrs.contains(field)) {
1✔
NEW
254
        if (field.contains(":")) {
×
NEW
255
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
256
          extensionFields_.put(expanded_field, __doc.get(field));
×
257
        }
258
      }
259
    }
1✔
260
  }
1✔
261
  private java.util.List<String> attrs = java.util.Arrays.asList("name", "symbols", "type", "label", "doc", "inputBinding");
1✔
262
}
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