• 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/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.commonwl.cwlsdk.cwl1_1;
16

17
import org.commonwl.cwlsdk.cwl1_1.utils.LoaderInstances;
18
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptions;
19
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptionsBuilder;
20
import org.commonwl.cwlsdk.cwl1_1.utils.SaveableImpl;
21
import org.commonwl.cwlsdk.cwl1_1.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 {
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 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() {
NEW
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() {
NEW
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() {
NEW
72
    return this.type;
×
73
  }
74

75
  /**
76
   * Used by {@link org.commonwl.cwlsdk.cwl1_1.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_) {
NEW
91
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
×
92
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
93
    // generated names.
NEW
94
    String __baseUri = __baseUri_;
×
NEW
95
    String __docRoot = __docRoot_;
×
NEW
96
    if (!(__doc_ instanceof java.util.Map)) {
×
NEW
97
      throw new ValidationException("CWLRecordFieldImpl called on non-map");
×
98
    }
NEW
99
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
×
NEW
100
    final java.util.List<ValidationException> __errors =
×
101
        new java.util.ArrayList<ValidationException>();
NEW
102
    if (__loadingOptions != null) {
×
NEW
103
      this.loadingOptions_ = __loadingOptions;
×
104
    }
105
    String name;
106

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

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

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

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

145
    } else {
NEW
146
      doc = null;
×
147
    }
148
    Object type;
149
    try {
NEW
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
NEW
153
              .loadField(__doc.get("type"), __baseUri, __loadingOptions);
×
NEW
154
    } catch (ValidationException e) {
×
NEW
155
      type = null; // won't be used but prevents compiler from complaining.
×
NEW
156
      final String __message = "the `type` field is not valid because:";
×
NEW
157
      __errors.add(new ValidationException(__message, e));
×
NEW
158
    }
×
NEW
159
    if (!__errors.isEmpty()) {
×
NEW
160
      throw new ValidationException("Trying 'RecordField'", __errors);
×
161
    }
NEW
162
    this.doc = (Object) doc;
×
NEW
163
    this.name = (String) name;
×
NEW
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
    }
×
NEW
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