• 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

0.0
/src/main/java/org/w3id/cwl/cwl1_2/CWLRecordFieldImpl.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#CWLRecordField</I><BR>
25
 */
26
public class CWLRecordFieldImpl extends SaveableImpl implements CWLRecordField {
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
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() {
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
  /**
76
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of CWLRecordFieldImpl.
77
   *
78
   * @param __doc_            Document fragment to load this record object from (presumably a
79
                              {@link java.util.Map}).
80
   * @param __baseUri_        Base URI to generate child document IDs against.
81
   * @param __loadingOptions  Context for loading URIs and populating objects.
82
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
83
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
84
   *                             or validation of fields fails.
85
   */
86
  public CWLRecordFieldImpl(
87
      final Object __doc_,
88
      final String __baseUri_,
89
      LoadingOptions __loadingOptions,
90
      final String __docRoot_) {
91
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
×
92
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
93
    // generated names.
94
    String __baseUri = __baseUri_;
×
95
    String __docRoot = __docRoot_;
×
96
    if (!(__doc_ instanceof java.util.Map)) {
×
97
      throw new ValidationException("CWLRecordFieldImpl called on non-map");
×
98
    }
99
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
×
100
    final java.util.List<ValidationException> __errors =
×
101
        new java.util.ArrayList<ValidationException>();
102
    if (__loadingOptions != null) {
×
103
      this.loadingOptions_ = __loadingOptions;
×
104
    }
105
    String name;
106

107
    if (__doc.containsKey("name")) {
×
108
      try {
109
        name =
×
110
            LoaderInstances
111
                .uri_StringInstance_True_False_None_None
112
                .loadField(__doc.get("name"), __baseUri, __loadingOptions);
×
113
      } catch (ValidationException e) {
×
114
        name = null; // won't be used but prevents compiler from complaining.
×
115
        final String __message = "the `name` field is not valid because:";
×
116
        __errors.add(new ValidationException(__message, e));
×
117
      }
×
118

119
    } else {
120
      name = null;
×
121
    }
122

123
    if (name == null) {
×
124
      if (__docRoot != null) {
×
125
        name = __docRoot;
×
126
      } else {
127
        throw new ValidationException("Missing name");
×
128
      }
129
    }
130
    __baseUri = (String) name;
×
131
    Object doc;
132

133
    if (__doc.containsKey("doc")) {
×
134
      try {
135
        doc =
×
136
            LoaderInstances
137
                .union_of_NullInstance_or_StringInstance_or_array_of_StringInstance
138
                .loadField(__doc.get("doc"), __baseUri, __loadingOptions);
×
139
      } catch (ValidationException e) {
×
140
        doc = null; // won't be used but prevents compiler from complaining.
×
141
        final String __message = "the `doc` field is not valid because:";
×
142
        __errors.add(new ValidationException(__message, e));
×
143
      }
×
144

145
    } else {
146
      doc = null;
×
147
    }
148
    Object type;
149
    try {
150
      type =
×
151
          LoaderInstances
152
              .typedsl_union_of_PrimitiveType_or_CWLRecordSchema_or_EnumSchema_or_CWLArraySchema_or_StringInstance_or_array_of_union_of_PrimitiveType_or_CWLRecordSchema_or_EnumSchema_or_CWLArraySchema_or_StringInstance_2
153
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
×
154
    } catch (ValidationException e) {
×
155
      type = null; // won't be used but prevents compiler from complaining.
×
156
      final String __message = "the `type` field is not valid because:";
×
157
      __errors.add(new ValidationException(__message, e));
×
158
    }
×
159
    if (!__errors.isEmpty()) {
×
160
      throw new ValidationException("Trying 'RecordField'", __errors);
×
161
    }
162
    this.doc = (Object) doc;
×
163
    this.name = (String) name;
×
164
    this.type = (Object) type;
×
NEW
165
    for (String field:__doc.keySet()) {
×
NEW
166
      if (!attrs.contains(field)) {
×
NEW
167
        if (field.contains(":")) {
×
NEW
168
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
169
          extensionFields_.put(expanded_field, __doc.get(field));
×
170
        }
171
      }
NEW
172
    }
×
UNCOV
173
  }
×
NEW
174
  private java.util.List<String> attrs = java.util.Arrays.asList("doc", "name", "type");
×
175
}
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