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

common-workflow-language / cwljava / #394

31 Oct 2025 04:10PM UTC coverage: 57.972% (-1.6%) from 59.538%
#394

push

github

mr-c
rename package to a namespace that we control

7575 of 12994 new or added lines in 261 files covered. (58.3%)

7752 of 13372 relevant lines covered (57.97%)

0.58 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_1/RecordFieldImpl.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>https://w3id.org/cwl/salad#RecordField</I><BR> <BLOCKQUOTE>
25
 A field of a record. </BLOCKQUOTE>
26
 */
27
public class RecordFieldImpl extends SaveableImpl implements RecordField {
NEW
28
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
NEW
29
  private java.util.Map<String, Object> extensionFields_ =
×
30
      new java.util.HashMap<String, Object>();
31
  public LoadingOptions getLoadingOptions() {
NEW
32
    return this.loadingOptions_;
×
33
  }
34
  public java.util.Map<String, Object> getExtensionFields() {
NEW
35
    return this.extensionFields_;
×
36
  }
37

38
  private String name;
39

40
  /**
41
   * Getter for property <I>https://w3id.org/cwl/salad#RecordField/name</I><BR>
42
   * <BLOCKQUOTE>
43
   * The name of the field
44
   *    * </BLOCKQUOTE>
45
   */
46

47
  public String getName() {
NEW
48
    return this.name;
×
49
  }
50

51
  private Object doc;
52

53
  /**
54
   * Getter for property <I>https://w3id.org/cwl/salad#Documented/doc</I><BR>
55
   * <BLOCKQUOTE>
56
   * A documentation string for this object, or an array of strings which should be concatenated.   * </BLOCKQUOTE>
57
   */
58

59
  public Object getDoc() {
NEW
60
    return this.doc;
×
61
  }
62

63
  private Object type;
64

65
  /**
66
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
67
   * <BLOCKQUOTE>
68
   * The field type. If it is an array, it indicates
69
   * that the field type is a union type of its elements.
70
   * Its elements may be duplicated.
71
   *    * </BLOCKQUOTE>
72
   */
73

74
  public Object getType() {
NEW
75
    return this.type;
×
76
  }
77

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

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

122
    } else {
NEW
123
      name = null;
×
124
    }
125

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

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

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