• 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

71.74
/src/main/java/org/w3id/cwl/cwl1_2/DirentImpl.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#Dirent</I><BR> <BLOCKQUOTE>
25
 Define a file or subdirectory that must be staged to a particular
26
 place prior to executing the command line tool.  May be the result
27
 of executing an expression, such as building a configuration file
28
 from a template.
29
 
30
 Usually files are staged within the [designated output directory](#Runtime_environment).
31
 However, under certain circumstances, files may be staged at
32
 arbitrary locations, see discussion for `entryname`.
33
  </BLOCKQUOTE>
34
 */
35
public class DirentImpl extends SaveableImpl implements Dirent {
36
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
37
  private java.util.Map<String, Object> extensionFields_ =
1✔
38
      new java.util.HashMap<String, Object>();
39
  public java.util.Map<String, Object> getExtensionFields() {
NEW
40
    return this.extensionFields_;
×
41
  }
42

43
  private Object entryname;
44

45
  /**
46
   * Getter for property <I>https://w3id.org/cwl/cwl#entryname</I><BR>
47
   * <BLOCKQUOTE>
48
   * The "target" name of the file or subdirectory.  If `entry` is
49
   * a File or Directory, the `entryname` field overrides the value
50
   * of `basename` of the File or Directory object.
51
   * 
52
   * * Required when `entry` evaluates to file contents only
53
   * * Optional when `entry` evaluates to a File or Directory object with a `basename`
54
   * * Invalid when `entry` evaluates to an array of File or Directory objects.
55
   * 
56
   * If `entryname` is a relative path, it specifies a name within
57
   * the designated output directory.  A relative path starting
58
   * with `../` or that resolves to location above the designated output directory is an error.
59
   * 
60
   * If `entryname` is an absolute path (starts with a slash `/`)
61
   * it is an error unless the following conditions are met:
62
   * 
63
   *   * `DockerRequirement` is present in `requirements`
64
   *   * The program is will run inside a software container
65
   *   where, from the perspective of the program, the root
66
   *   filesystem is not shared with any other user or
67
   *   running program.
68
   * 
69
   * In this case, and the above conditions are met, then
70
   * `entryname` may specify the absolute path within the container
71
   * where the file or directory must be placed.
72
   *    * </BLOCKQUOTE>
73
   */
74

75
  public Object getEntryname() {
76
    return this.entryname;
×
77
  }
78

79
  private Object entry;
80

81
  /**
82
   * Getter for property <I>https://w3id.org/cwl/cwl#entry</I><BR>
83
   * <BLOCKQUOTE>
84
   * If the value is a string literal or an expression which evaluates to a
85
   * string, a new text file must be created with the string as the file contents.
86
   * 
87
   * If the value is an expression that evaluates to a `File` or
88
   * `Directory` object, or an array of `File` or `Directory`
89
   * objects, this indicates the referenced file or directory
90
   * should be added to the designated output directory prior to
91
   * executing the tool.
92
   * 
93
   * If the value is an expression that evaluates to `null`,
94
   * nothing is added to the designated output directory, the entry
95
   * has no effect.
96
   * 
97
   * If the value is an expression that evaluates to some other
98
   * array, number, or object not consisting of `File` or
99
   * `Directory` objects, a new file must be created with the value
100
   * serialized to JSON text as the file contents.  The JSON
101
   * serialization behavior should match the behavior of string
102
   * interpolation of [Parameter
103
   * references](#Parameter_references).
104
   *    * </BLOCKQUOTE>
105
   */
106

107
  public Object getEntry() {
108
    return this.entry;
×
109
  }
110

111
  private java.util.Optional<Boolean> writable;
112

113
  /**
114
   * Getter for property <I>https://w3id.org/cwl/cwl#Dirent/writable</I><BR>
115
   * <BLOCKQUOTE>
116
   * If true, the File or Directory (or array of Files or
117
   * Directories) declared in `entry` must be writable by the tool.
118
   * 
119
   * Changes to the file or directory must be isolated and not
120
   * visible by any other CommandLineTool process.  This may be
121
   * implemented by making a copy of the original file or
122
   * directory.
123
   * 
124
   * Disruptive changes to the referenced file or directory must not
125
   * be allowed unless `InplaceUpdateRequirement.inplaceUpdate` is true.
126
   * 
127
   * Default false (files and directories read-only by default).
128
   * 
129
   * A directory marked as `writable: true` implies that all files and
130
   * subdirectories are recursively writable as well.
131
   * 
132
   * If `writable` is false, the file may be made available using a
133
   * bind mount or file system link to avoid unnecessary copying of
134
   * the input file.  Command line tools may receive an error on
135
   * attempting to rename or delete files or directories that are
136
   * not explicitly marked as writable.
137
   *    * </BLOCKQUOTE>
138
   */
139

140
  public java.util.Optional<Boolean> getWritable() {
141
    return this.writable;
×
142
  }
143

144
  /**
145
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of DirentImpl.
146
   *
147
   * @param __doc_            Document fragment to load this record object from (presumably a
148
                              {@link java.util.Map}).
149
   * @param __baseUri_        Base URI to generate child document IDs against.
150
   * @param __loadingOptions  Context for loading URIs and populating objects.
151
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
152
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
153
   *                             or validation of fields fails.
154
   */
155
  public DirentImpl(
156
      final Object __doc_,
157
      final String __baseUri_,
158
      LoadingOptions __loadingOptions,
159
      final String __docRoot_) {
160
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
161
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
162
    // generated names.
163
    String __baseUri = __baseUri_;
1✔
164
    String __docRoot = __docRoot_;
1✔
165
    if (!(__doc_ instanceof java.util.Map)) {
1✔
166
      throw new ValidationException("DirentImpl called on non-map");
×
167
    }
168
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
169
    final java.util.List<ValidationException> __errors =
1✔
170
        new java.util.ArrayList<ValidationException>();
171
    if (__loadingOptions != null) {
1✔
172
      this.loadingOptions_ = __loadingOptions;
1✔
173
    }
174
    Object entryname;
175

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

188
    } else {
189
      entryname = null;
1✔
190
    }
191
    Object entry;
192
    try {
193
      entry =
1✔
194
          LoaderInstances
195
              .union_of_StringInstance_or_ExpressionLoader
196
              .loadField(__doc.get("entry"), __baseUri, __loadingOptions);
1✔
197
    } catch (ValidationException e) {
1✔
198
      entry = null; // won't be used but prevents compiler from complaining.
1✔
199
      final String __message = "the `entry` field is not valid because:";
1✔
200
      __errors.add(new ValidationException(__message, e));
1✔
201
    }
1✔
202
    java.util.Optional<Boolean> writable;
203

204
    if (__doc.containsKey("writable")) {
1✔
205
      try {
206
        writable =
1✔
207
            LoaderInstances
208
                .optional_BooleanInstance
209
                .loadField(__doc.get("writable"), __baseUri, __loadingOptions);
1✔
210
      } catch (ValidationException e) {
×
211
        writable = null; // won't be used but prevents compiler from complaining.
×
212
        final String __message = "the `writable` field is not valid because:";
×
213
        __errors.add(new ValidationException(__message, e));
×
214
      }
1✔
215

216
    } else {
217
      writable = null;
1✔
218
    }
219
    if (!__errors.isEmpty()) {
1✔
220
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
221
    }
222
    this.entryname = (Object) entryname;
1✔
223
    this.entry = (Object) entry;
1✔
224
    this.writable = (java.util.Optional<Boolean>) writable;
1✔
225
  }
1✔
226
}
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