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

common-workflow-language / cwljava / #389

30 Oct 2025 05:13PM UTC coverage: 58.693% (-0.8%) from 59.538%
#389

Pull #218

github

web-flow
Merge 98b159202 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

80.49
/src/main/java/org/w3id/cwl/cwl1_2/EnvVarRequirementImpl.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#EnvVarRequirement</I><BR> <BLOCKQUOTE>
25
 Define a list of environment variables which will be set in the
26
 execution environment of the tool.  See `EnvironmentDef` for details.
27
  </BLOCKQUOTE>
28
 */
29
public class EnvVarRequirementImpl extends SaveableImpl implements EnvVarRequirement {
30
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
31
  private java.util.Map<String, Object> extensionFields_ =
1✔
32
      new java.util.HashMap<String, Object>();
33
  public LoadingOptions getLoadingOptions() {
NEW
34
    return this.loadingOptions_;
×
35
  }
36
  public java.util.Map<String, Object> getExtensionFields() {
37
    return this.extensionFields_;
×
38
  }
39

40
  private EnvVarRequirement_class class_;
41

42
  /**
43
   * Getter for property <I>https://w3id.org/cwl/cwl#EnvVarRequirement/class</I><BR>
44
   * <BLOCKQUOTE>
45
   * Always 'EnvVarRequirement'   * </BLOCKQUOTE>
46
   */
47

48
  public EnvVarRequirement_class getClass_() {
49
    return this.class_;
×
50
  }
51

52
  private java.util.List<Object> envDef;
53

54
  /**
55
   * Getter for property <I>https://w3id.org/cwl/cwl#EnvVarRequirement/envDef</I><BR>
56
   * <BLOCKQUOTE>
57
   * The list of environment variables.   * </BLOCKQUOTE>
58
   */
59

60
  public java.util.List<Object> getEnvDef() {
61
    return this.envDef;
×
62
  }
63

64
  /**
65
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of EnvVarRequirementImpl.
66
   *
67
   * @param __doc_            Document fragment to load this record object from (presumably a
68
                              {@link java.util.Map}).
69
   * @param __baseUri_        Base URI to generate child document IDs against.
70
   * @param __loadingOptions  Context for loading URIs and populating objects.
71
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
72
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
73
   *                             or validation of fields fails.
74
   */
75
  public EnvVarRequirementImpl(
76
      final Object __doc_,
77
      final String __baseUri_,
78
      LoadingOptions __loadingOptions,
79
      final String __docRoot_) {
80
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
81
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
82
    // generated names.
83
    String __baseUri = __baseUri_;
1✔
84
    String __docRoot = __docRoot_;
1✔
85
    if (!(__doc_ instanceof java.util.Map)) {
1✔
86
      throw new ValidationException("EnvVarRequirementImpl called on non-map");
×
87
    }
88
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
89
    final java.util.List<ValidationException> __errors =
1✔
90
        new java.util.ArrayList<ValidationException>();
91
    if (__loadingOptions != null) {
1✔
92
      this.loadingOptions_ = __loadingOptions;
1✔
93
    }
94
    EnvVarRequirement_class class_;
95
    try {
96
      class_ =
1✔
97
          LoaderInstances
98
              .uri_EnvVarRequirement_class_False_True_None_None
99
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
100
    } catch (ValidationException e) {
1✔
101
      class_ = null; // won't be used but prevents compiler from complaining.
1✔
102
      final String __message = "the `class` field is not valid because:";
1✔
103
      __errors.add(new ValidationException(__message, e));
1✔
104
    }
1✔
105
    java.util.List<Object> envDef;
106
    try {
107
      envDef =
1✔
108
          LoaderInstances
109
              .idmap_envDef_array_of_EnvironmentDef
110
              .loadField(__doc.get("envDef"), __baseUri, __loadingOptions);
1✔
111
    } catch (ValidationException e) {
1✔
112
      envDef = null; // won't be used but prevents compiler from complaining.
1✔
113
      final String __message = "the `envDef` field is not valid because:";
1✔
114
      __errors.add(new ValidationException(__message, e));
1✔
115
    }
1✔
116
    if (!__errors.isEmpty()) {
1✔
117
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
118
    }
119
    this.class_ = (EnvVarRequirement_class) class_;
1✔
120
    this.envDef = (java.util.List<Object>) envDef;
1✔
121
    for (String field:__doc.keySet()) {
1✔
122
      if (!attrs.contains(field)) {
1✔
NEW
123
        if (field.contains(":")) {
×
NEW
124
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
125
          extensionFields_.put(expanded_field, __doc.get(field));
×
126
        }
127
      }
128
    }
1✔
129
  }
1✔
130
  private java.util.List<String> attrs = java.util.Arrays.asList("class", "envDef");
1✔
131
}
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