• 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

82.93
/src/main/java/org/w3id/cwl/cwl1_2/SchemaDefRequirementImpl.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#SchemaDefRequirement</I><BR> <BLOCKQUOTE>
25
 This field consists of an array of type definitions which must be used when
26
 interpreting the `inputs` and `outputs` fields.  When a `type` field
27
 contains a IRI, the implementation must check if the type is defined in
28
 `schemaDefs` and use that definition.  If the type is not found in
29
 `schemaDefs`, it is an error.  The entries in `schemaDefs` must be
30
 processed in the order listed such that later schema definitions may refer
31
 to earlier schema definitions.
32
 
33
 - **Type definitions are allowed for `enum` and `record` types only.**
34
 - Type definitions may be shared by defining them in a file and then
35
   `$include`-ing them in the `types` field.
36
 - A file can contain a list of type definitions
37
  </BLOCKQUOTE>
38
 */
39
public class SchemaDefRequirementImpl extends SaveableImpl implements SchemaDefRequirement {
40
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
41
  private java.util.Map<String, Object> extensionFields_ =
1✔
42
      new java.util.HashMap<String, Object>();
43
  public LoadingOptions getLoadingOptions() {
NEW
44
    return this.loadingOptions_;
×
45
  }
46
  public java.util.Map<String, Object> getExtensionFields() {
47
    return this.extensionFields_;
×
48
  }
49

50
  private SchemaDefRequirement_class class_;
51

52
  /**
53
   * Getter for property <I>https://w3id.org/cwl/cwl#SchemaDefRequirement/class</I><BR>
54
   * <BLOCKQUOTE>
55
   * Always 'SchemaDefRequirement'   * </BLOCKQUOTE>
56
   */
57

58
  public SchemaDefRequirement_class getClass_() {
59
    return this.class_;
×
60
  }
61

62
  private java.util.List<Object> types;
63

64
  /**
65
   * Getter for property <I>https://w3id.org/cwl/cwl#SchemaDefRequirement/types</I><BR>
66
   * <BLOCKQUOTE>
67
   * The list of type definitions.   * </BLOCKQUOTE>
68
   */
69

70
  public java.util.List<Object> getTypes() {
71
    return this.types;
1✔
72
  }
73

74
  /**
75
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of SchemaDefRequirementImpl.
76
   *
77
   * @param __doc_            Document fragment to load this record object from (presumably a
78
                              {@link java.util.Map}).
79
   * @param __baseUri_        Base URI to generate child document IDs against.
80
   * @param __loadingOptions  Context for loading URIs and populating objects.
81
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
82
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
83
   *                             or validation of fields fails.
84
   */
85
  public SchemaDefRequirementImpl(
86
      final Object __doc_,
87
      final String __baseUri_,
88
      LoadingOptions __loadingOptions,
89
      final String __docRoot_) {
90
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
91
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
92
    // generated names.
93
    String __baseUri = __baseUri_;
1✔
94
    String __docRoot = __docRoot_;
1✔
95
    if (!(__doc_ instanceof java.util.Map)) {
1✔
96
      throw new ValidationException("SchemaDefRequirementImpl called on non-map");
×
97
    }
98
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
99
    final java.util.List<ValidationException> __errors =
1✔
100
        new java.util.ArrayList<ValidationException>();
101
    if (__loadingOptions != null) {
1✔
102
      this.loadingOptions_ = __loadingOptions;
1✔
103
    }
104
    SchemaDefRequirement_class class_;
105
    try {
106
      class_ =
1✔
107
          LoaderInstances
108
              .uri_SchemaDefRequirement_class_False_True_None_None
109
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
110
    } catch (ValidationException e) {
1✔
111
      class_ = null; // won't be used but prevents compiler from complaining.
1✔
112
      final String __message = "the `class` field is not valid because:";
1✔
113
      __errors.add(new ValidationException(__message, e));
1✔
114
    }
1✔
115
    java.util.List<Object> types;
116
    try {
117
      types =
1✔
118
          LoaderInstances
119
              .array_of_union_of_CommandInputRecordSchema_or_CommandInputEnumSchema_or_CommandInputArraySchema
120
              .loadField(__doc.get("types"), __baseUri, __loadingOptions);
1✔
121
    } catch (ValidationException e) {
1✔
122
      types = null; // won't be used but prevents compiler from complaining.
1✔
123
      final String __message = "the `types` field is not valid because:";
1✔
124
      __errors.add(new ValidationException(__message, e));
1✔
125
    }
1✔
126
    if (!__errors.isEmpty()) {
1✔
127
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
128
    }
129
    this.class_ = (SchemaDefRequirement_class) class_;
1✔
130
    this.types = (java.util.List<Object>) types;
1✔
131
    for (String field:__doc.keySet()) {
1✔
132
      if (!attrs.contains(field)) {
1✔
NEW
133
        if (field.contains(":")) {
×
NEW
134
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
135
          extensionFields_.put(expanded_field, __doc.get(field));
×
136
        }
137
      }
138
    }
1✔
139
  }
1✔
140
  private java.util.List<String> attrs = java.util.Arrays.asList("class", "types");
1✔
141
}
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