• 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/InitialWorkDirRequirementImpl.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#InitialWorkDirRequirement</I><BR> <BLOCKQUOTE>
25
 Define a list of files and subdirectories that must be staged by the workflow platform prior to executing the command line tool.
26
 Normally files are staged within the designated output directory. However, when running inside containers, files may be staged at arbitrary locations, see discussion for [`Dirent.entryname`](#Dirent). Together with `DockerRequirement.dockerOutputDirectory` it is possible to control the locations of both input and output files when running in containers. </BLOCKQUOTE>
27
 */
28
public class InitialWorkDirRequirementImpl extends SaveableImpl implements InitialWorkDirRequirement {
29
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
30
  private java.util.Map<String, Object> extensionFields_ =
1✔
31
      new java.util.HashMap<String, Object>();
32
  public LoadingOptions getLoadingOptions() {
NEW
33
    return this.loadingOptions_;
×
34
  }
35
  public java.util.Map<String, Object> getExtensionFields() {
36
    return this.extensionFields_;
×
37
  }
38

39
  private InitialWorkDirRequirement_class class_;
40

41
  /**
42
   * Getter for property <I>https://w3id.org/cwl/cwl#InitialWorkDirRequirement/class</I><BR>
43
   * <BLOCKQUOTE>
44
   * InitialWorkDirRequirement   * </BLOCKQUOTE>
45
   */
46

47
  public InitialWorkDirRequirement_class getClass_() {
48
    return this.class_;
×
49
  }
50

51
  private Object listing;
52

53
  /**
54
   * Getter for property <I>https://w3id.org/cwl/cwl#listing</I><BR>
55
   * <BLOCKQUOTE>
56
   * The list of files or subdirectories that must be staged prior
57
   * to executing the command line tool.
58
   * 
59
   * Return type of each expression must validate as `["null",
60
   * File, Directory, Dirent, {type: array, items: [File,
61
   * Directory]}]`.
62
   * 
63
   * Each `File` or `Directory` that is returned by an Expression
64
   * must be added to the designated output directory prior to
65
   * executing the tool.
66
   * 
67
   * Each `Dirent` record that is listed or returned by an
68
   * expression specifies a file to be created or staged in the
69
   * designated output directory prior to executing the tool.
70
   * 
71
   * Expressions may return null, in which case they have no effect.
72
   * 
73
   * Files or Directories which are listed in the input parameters
74
   * and appear in the `InitialWorkDirRequirement` listing must
75
   * have their `path` set to their staged location.  If the same
76
   * File or Directory appears more than once in the
77
   * `InitialWorkDirRequirement` listing, the implementation must
78
   * choose exactly one value for `path`; how this value is chosen
79
   * is undefined.
80
   *    * </BLOCKQUOTE>
81
   */
82

83
  public Object getListing() {
84
    return this.listing;
×
85
  }
86

87
  /**
88
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of InitialWorkDirRequirementImpl.
89
   *
90
   * @param __doc_            Document fragment to load this record object from (presumably a
91
                              {@link java.util.Map}).
92
   * @param __baseUri_        Base URI to generate child document IDs against.
93
   * @param __loadingOptions  Context for loading URIs and populating objects.
94
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
95
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
96
   *                             or validation of fields fails.
97
   */
98
  public InitialWorkDirRequirementImpl(
99
      final Object __doc_,
100
      final String __baseUri_,
101
      LoadingOptions __loadingOptions,
102
      final String __docRoot_) {
103
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
104
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
105
    // generated names.
106
    String __baseUri = __baseUri_;
1✔
107
    String __docRoot = __docRoot_;
1✔
108
    if (!(__doc_ instanceof java.util.Map)) {
1✔
109
      throw new ValidationException("InitialWorkDirRequirementImpl called on non-map");
×
110
    }
111
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
112
    final java.util.List<ValidationException> __errors =
1✔
113
        new java.util.ArrayList<ValidationException>();
114
    if (__loadingOptions != null) {
1✔
115
      this.loadingOptions_ = __loadingOptions;
1✔
116
    }
117
    InitialWorkDirRequirement_class class_;
118
    try {
119
      class_ =
1✔
120
          LoaderInstances
121
              .uri_InitialWorkDirRequirement_class_False_True_None_None
122
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
123
    } catch (ValidationException e) {
1✔
124
      class_ = null; // won't be used but prevents compiler from complaining.
1✔
125
      final String __message = "the `class` field is not valid because:";
1✔
126
      __errors.add(new ValidationException(__message, e));
1✔
127
    }
1✔
128
    Object listing;
129
    try {
130
      listing =
1✔
131
          LoaderInstances
132
              .union_of_ExpressionLoader_or_array_of_union_of_NullInstance_or_Dirent_or_ExpressionLoader_or_File_or_Directory_or_array_of_union_of_File_or_Directory
133
              .loadField(__doc.get("listing"), __baseUri, __loadingOptions);
1✔
134
    } catch (ValidationException e) {
1✔
135
      listing = null; // won't be used but prevents compiler from complaining.
1✔
136
      final String __message = "the `listing` field is not valid because:";
1✔
137
      __errors.add(new ValidationException(__message, e));
1✔
138
    }
1✔
139
    if (!__errors.isEmpty()) {
1✔
140
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
141
    }
142
    this.class_ = (InitialWorkDirRequirement_class) class_;
1✔
143
    this.listing = (Object) listing;
1✔
144
    for (String field:__doc.keySet()) {
1✔
145
      if (!attrs.contains(field)) {
1✔
NEW
146
        if (field.contains(":")) {
×
NEW
147
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
148
          extensionFields_.put(expanded_field, __doc.get(field));
×
149
        }
150
      }
151
    }
1✔
152
  }
1✔
153
  private java.util.List<String> attrs = java.util.Arrays.asList("class", "listing");
1✔
154
}
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