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

common-workflow-language / cwljava / #388

30 Oct 2025 04:55PM UTC coverage: 58.693% (-0.8%) from 59.538%
#388

Pull #218

github

web-flow
Merge ab8576a5b 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

0.0
/src/main/java/org/w3id/cwl/cwl1_2/SoftwarePackageImpl.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#SoftwarePackage</I><BR>
25
 */
26
public class SoftwarePackageImpl extends SaveableImpl implements SoftwarePackage {
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
×
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() {
34
    return this.extensionFields_;
×
35
  }
36

37
  private String package_;
38

39
  /**
40
   * Getter for property <I>https://w3id.org/cwl/cwl#SoftwarePackage/package</I><BR>
41
   * <BLOCKQUOTE>
42
   * The name of the software to be made available. If the name is
43
   * common, inconsistent, or otherwise ambiguous it should be combined with
44
   * one or more identifiers in the `specs` field.
45
   *    * </BLOCKQUOTE>
46
   */
47

48
  public String getPackage() {
49
    return this.package_;
×
50
  }
51

52
  private java.util.Optional<java.util.List<String>> version;
53

54
  /**
55
   * Getter for property <I>https://w3id.org/cwl/cwl#SoftwarePackage/version</I><BR>
56
   * <BLOCKQUOTE>
57
   * The (optional) versions of the software that are known to be
58
   * compatible.
59
   *    * </BLOCKQUOTE>
60
   */
61

62
  public java.util.Optional<java.util.List<String>> getVersion() {
63
    return this.version;
×
64
  }
65

66
  private java.util.Optional<java.util.List<String>> specs;
67

68
  /**
69
   * Getter for property <I>https://w3id.org/cwl/cwl#SoftwarePackage/specs</I><BR>
70
   * <BLOCKQUOTE>
71
   * One or more [IRI](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier)s
72
   * identifying resources for installing or enabling the software named in
73
   * the `package` field. Implementations may provide resolvers which map
74
   * these software identifier IRIs to some configuration action; or they can
75
   * use only the name from the `package` field on a best effort basis.
76
   * 
77
   * For example, the IRI https://packages.debian.org/bowtie could
78
   * be resolved with `apt-get install bowtie`. The IRI
79
   * https://anaconda.org/bioconda/bowtie could be resolved with `conda
80
   * install -c bioconda bowtie`.
81
   * 
82
   * IRIs can also be system independent and used to map to a specific
83
   * software installation or selection mechanism.
84
   * Using [RRID](https://www.identifiers.org/rrid/) as an example:
85
   * https://identifiers.org/rrid/RRID:SCR_005476
86
   * could be fulfilled using the above-mentioned Debian or bioconda
87
   * package, a local installation managed by [Environment Modules](https://modules.sourceforge.net/),
88
   * or any other mechanism the platform chooses. IRIs can also be from
89
   * identifier sources that are discipline specific yet still system
90
   * independent. As an example, the equivalent [ELIXIR Tools and Data
91
   * Service Registry](https://bio.tools) IRI to the previous RRID example is
92
   * https://bio.tools/tool/bowtie2/version/2.2.8.
93
   * If supported by a given registry, implementations are encouraged to
94
   * query these system independent software identifier IRIs directly for
95
   * links to packaging systems.
96
   * 
97
   * A site specific IRI can be listed as well. For example, an academic
98
   * computing cluster using Environment Modules could list the IRI
99
   * `https://hpc.example.edu/modules/bowtie-tbb/1.22` to indicate that
100
   * `module load bowtie-tbb/1.1.2` should be executed to make available
101
   * `bowtie` version 1.1.2 compiled with the TBB library prior to running
102
   * the accompanying Workflow or CommandLineTool. Note that the example IRI
103
   * is specific to a particular institution and computing environment as
104
   * the Environment Modules system does not have a common namespace or
105
   * standardized naming convention.
106
   * 
107
   * This last example is the least portable and should only be used if
108
   * mechanisms based off of the `package` field or more generic IRIs are
109
   * unavailable or unsuitable. While harmless to other sites, site specific
110
   * software IRIs should be left out of shared CWL descriptions to avoid
111
   * clutter.
112
   *    * </BLOCKQUOTE>
113
   */
114

115
  public java.util.Optional<java.util.List<String>> getSpecs() {
116
    return this.specs;
×
117
  }
118

119
  /**
120
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of SoftwarePackageImpl.
121
   *
122
   * @param __doc_            Document fragment to load this record object from (presumably a
123
                              {@link java.util.Map}).
124
   * @param __baseUri_        Base URI to generate child document IDs against.
125
   * @param __loadingOptions  Context for loading URIs and populating objects.
126
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
127
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
128
   *                             or validation of fields fails.
129
   */
130
  public SoftwarePackageImpl(
131
      final Object __doc_,
132
      final String __baseUri_,
133
      LoadingOptions __loadingOptions,
134
      final String __docRoot_) {
135
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
×
136
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
137
    // generated names.
138
    String __baseUri = __baseUri_;
×
139
    String __docRoot = __docRoot_;
×
140
    if (!(__doc_ instanceof java.util.Map)) {
×
141
      throw new ValidationException("SoftwarePackageImpl called on non-map");
×
142
    }
143
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
×
144
    final java.util.List<ValidationException> __errors =
×
145
        new java.util.ArrayList<ValidationException>();
146
    if (__loadingOptions != null) {
×
147
      this.loadingOptions_ = __loadingOptions;
×
148
    }
149
    String package_;
150
    try {
151
      package_ =
×
152
          LoaderInstances
153
              .StringInstance
154
              .loadField(__doc.get("package"), __baseUri, __loadingOptions);
×
155
    } catch (ValidationException e) {
×
156
      package_ = null; // won't be used but prevents compiler from complaining.
×
157
      final String __message = "the `package` field is not valid because:";
×
158
      __errors.add(new ValidationException(__message, e));
×
159
    }
×
160
    java.util.Optional<java.util.List<String>> version;
161

162
    if (__doc.containsKey("version")) {
×
163
      try {
164
        version =
×
165
            LoaderInstances
166
                .optional_array_of_StringInstance
167
                .loadField(__doc.get("version"), __baseUri, __loadingOptions);
×
168
      } catch (ValidationException e) {
×
169
        version = null; // won't be used but prevents compiler from complaining.
×
170
        final String __message = "the `version` field is not valid because:";
×
171
        __errors.add(new ValidationException(__message, e));
×
172
      }
×
173

174
    } else {
175
      version = null;
×
176
    }
177
    java.util.Optional<java.util.List<String>> specs;
178

179
    if (__doc.containsKey("specs")) {
×
180
      try {
181
        specs =
×
182
            LoaderInstances
183
                .uri_optional_array_of_StringInstance_False_False_None_True
184
                .loadField(__doc.get("specs"), __baseUri, __loadingOptions);
×
185
      } catch (ValidationException e) {
×
186
        specs = null; // won't be used but prevents compiler from complaining.
×
187
        final String __message = "the `specs` field is not valid because:";
×
188
        __errors.add(new ValidationException(__message, e));
×
189
      }
×
190

191
    } else {
192
      specs = null;
×
193
    }
194
    if (!__errors.isEmpty()) {
×
195
      throw new ValidationException("Trying 'RecordField'", __errors);
×
196
    }
197
    this.package_ = (String) package_;
×
198
    this.version = (java.util.Optional<java.util.List<String>>) version;
×
199
    this.specs = (java.util.Optional<java.util.List<String>>) specs;
×
NEW
200
    for (String field:__doc.keySet()) {
×
NEW
201
      if (!attrs.contains(field)) {
×
NEW
202
        if (field.contains(":")) {
×
NEW
203
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
204
          extensionFields_.put(expanded_field, __doc.get(field));
×
205
        }
206
      }
NEW
207
    }
×
UNCOV
208
  }
×
NEW
209
  private java.util.List<String> attrs = java.util.Arrays.asList("package", "version", "specs");
×
210
}
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