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

common-workflow-language / cwljava / #339

29 Jan 2025 01:23PM UTC coverage: 59.538% (-0.6%) from 60.167%
#339

Pull #193

github

web-flow
Merge 94c260498 into 0978523bc
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_2/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.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/salad#RecordField</I><BR> <BLOCKQUOTE>
25
 A field of a record. </BLOCKQUOTE>
26
 */
27
public class RecordFieldImpl extends SaveableImpl implements RecordField {
28
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
29
  private java.util.Map<String, Object> extensionFields_ =
×
30
      new java.util.HashMap<String, Object>();
31
  public java.util.Map<String, Object> getExtensionFields() {
NEW
32
    return this.extensionFields_;
×
33
  }
34

35
  private String name;
36

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

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

48
  private Object doc;
49

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

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

60
  private Object type;
61

62
  /**
63
   * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
64
   * <BLOCKQUOTE>
65
   * The field type. If it is an array, it indicates
66
   * that the field type is a union type of its elements.
67
   * Its elements may be duplicated.
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 RecordFieldImpl.
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 RecordFieldImpl(
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("RecordFieldImpl 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_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
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;
×
165
  }
×
166
}
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