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

common-workflow-language / cwljava / #352

07 Apr 2025 10:22AM UTC coverage: 59.538% (-0.6%) from 60.167%
#352

Pull #193

github

web-flow
Merge d636f9333 into 46536cad2
Pull Request #193: Add accessor for the extension field.

0 of 129 new or added lines in 129 files covered. (0.0%)

7347 of 12340 relevant lines covered (59.54%)

0.6 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_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.w3id.cwl.cwl1_1;
16

17
import org.w3id.cwl.cwl1_1.utils.LoaderInstances;
18
import org.w3id.cwl.cwl1_1.utils.LoadingOptions;
19
import org.w3id.cwl.cwl1_1.utils.LoadingOptionsBuilder;
20
import org.w3id.cwl.cwl1_1.utils.SaveableImpl;
21
import org.w3id.cwl.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 {
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
28
  private java.util.Map<String, Object> extensionFields_ =
×
29
      new java.util.HashMap<String, Object>();
30
  public java.util.Map<String, Object> getExtensionFields() {
NEW
31
    return this.extensionFields_;
×
32
  }
33

34
  private String name;
35

36
  /**
37
   * Getter for property <I>https://w3id.org/cwl/salad#RecordField/name</I><BR>
38
   * <BLOCKQUOTE>
39
   * The name of the field
40
   *    * </BLOCKQUOTE>
41
   */
42

43
  public String getName() {
44
    return this.name;
×
45
  }
46

47
  private Object doc;
48

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

55
  public Object getDoc() {
56
    return this.doc;
×
57
  }
58

59
  private Object type;
60

61
  /**
62
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
63
   * <BLOCKQUOTE>
64
   * The field type
65
   *    * </BLOCKQUOTE>
66
   */
67

68
  public Object getType() {
69
    return this.type;
×
70
  }
71

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

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

116
    } else {
117
      name = null;
×
118
    }
119

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

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

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