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

common-workflow-language / cwljava / #352

07 Apr 2025 10:22AM UTC coverage: 59.538% (-0.6%) from 60.167%
#352

Pull #193

github

web-flow
Merge d636f9333 into 46536cad2
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

60.87
/src/main/java/org/w3id/cwl/cwl1_1/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_1;
16

17
import org.w3id.cwl.cwl1_1.utils.LoaderInstances;
18
import org.w3id.cwl.cwl1_1.utils.LoadingOptions;
19
import org.w3id.cwl.cwl1_1.utils.LoadingOptionsBuilder;
20
import org.w3id.cwl.cwl1_1.utils.SaveableImpl;
21
import org.w3id.cwl.cwl1_1.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 placed in the designated output
26
 directory prior to executing the command line tool.  May be the result of
27
 executing an expression, such as building a configuration file from a
28
 template.
29
  </BLOCKQUOTE>
30
 */
31
public class DirentImpl extends SaveableImpl implements Dirent {
32
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
33
  private java.util.Map<String, Object> extensionFields_ =
1✔
34
      new java.util.HashMap<String, Object>();
35
  public java.util.Map<String, Object> getExtensionFields() {
NEW
36
    return this.extensionFields_;
×
37
  }
38

39
  private Object entryname;
40

41
  /**
42
   * Getter for property <I>https://w3id.org/cwl/cwl#entryname</I><BR>
43
   * <BLOCKQUOTE>
44
   * The name of the file or subdirectory to create in the output directory.
45
   * If `entry` is a File or Directory, the `entryname` field overrides the value
46
   * of `basename` of the File or Directory object.  Optional.
47
   *    * </BLOCKQUOTE>
48
   */
49

50
  public Object getEntryname() {
51
    return this.entryname;
×
52
  }
53

54
  private Object entry;
55

56
  /**
57
   * Getter for property <I>https://w3id.org/cwl/cwl#entry</I><BR>
58
   * <BLOCKQUOTE>
59
   * If the value is a string literal or an expression which evaluates to a
60
   * string, a new file must be created with the string as the file contents.
61
   * 
62
   * If the value is an expression that evaluates to a `File` object, this
63
   * indicates the referenced file should be added to the designated output
64
   * directory prior to executing the tool.
65
   * 
66
   * If the value is an expression that evaluates to a `Dirent` object, this
67
   * indicates that the File or Directory in `entry` should be added to the
68
   * designated output directory with the name in `entryname`.
69
   * 
70
   * If `writable` is false, the file may be made available using a bind
71
   * mount or file system link to avoid unnecessary copying of the input
72
   * file.
73
   *    * </BLOCKQUOTE>
74
   */
75

76
  public Object getEntry() {
77
    return this.entry;
×
78
  }
79

80
  private java.util.Optional<Boolean> writable;
81

82
  /**
83
   * Getter for property <I>https://w3id.org/cwl/cwl#Dirent/writable</I><BR>
84
   * <BLOCKQUOTE>
85
   * If true, the file or directory must be writable by the tool.  Changes
86
   * to the file or directory must be isolated and not visible by any other
87
   * CommandLineTool process.  This may be implemented by making a copy of
88
   * the original file or directory.  Default false (files and directories
89
   * read-only by default).
90
   * 
91
   * A directory marked as `writable: true` implies that all files and
92
   * subdirectories are recursively writable as well.
93
   *    * </BLOCKQUOTE>
94
   */
95

96
  public java.util.Optional<Boolean> getWritable() {
97
    return this.writable;
×
98
  }
99

100
  /**
101
   * Used by {@link org.w3id.cwl.cwl1_1.utils.RootLoader} to construct instances of DirentImpl.
102
   *
103
   * @param __doc_            Document fragment to load this record object from (presumably a
104
                              {@link java.util.Map}).
105
   * @param __baseUri_        Base URI to generate child document IDs against.
106
   * @param __loadingOptions  Context for loading URIs and populating objects.
107
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
108
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
109
   *                             or validation of fields fails.
110
   */
111
  public DirentImpl(
112
      final Object __doc_,
113
      final String __baseUri_,
114
      LoadingOptions __loadingOptions,
115
      final String __docRoot_) {
116
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
117
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
118
    // generated names.
119
    String __baseUri = __baseUri_;
1✔
120
    String __docRoot = __docRoot_;
1✔
121
    if (!(__doc_ instanceof java.util.Map)) {
1✔
122
      throw new ValidationException("DirentImpl called on non-map");
×
123
    }
124
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
125
    final java.util.List<ValidationException> __errors =
1✔
126
        new java.util.ArrayList<ValidationException>();
127
    if (__loadingOptions != null) {
1✔
128
      this.loadingOptions_ = __loadingOptions;
1✔
129
    }
130
    Object entryname;
131

132
    if (__doc.containsKey("entryname")) {
1✔
133
      try {
134
        entryname =
1✔
135
            LoaderInstances
136
                .union_of_NullInstance_or_StringInstance_or_ExpressionLoader
137
                .loadField(__doc.get("entryname"), __baseUri, __loadingOptions);
1✔
138
      } catch (ValidationException e) {
×
139
        entryname = null; // won't be used but prevents compiler from complaining.
×
140
        final String __message = "the `entryname` field is not valid because:";
×
141
        __errors.add(new ValidationException(__message, e));
×
142
      }
1✔
143

144
    } else {
145
      entryname = null;
1✔
146
    }
147
    Object entry;
148
    try {
149
      entry =
1✔
150
          LoaderInstances
151
              .union_of_StringInstance_or_ExpressionLoader
152
              .loadField(__doc.get("entry"), __baseUri, __loadingOptions);
1✔
153
    } catch (ValidationException e) {
×
154
      entry = null; // won't be used but prevents compiler from complaining.
×
155
      final String __message = "the `entry` field is not valid because:";
×
156
      __errors.add(new ValidationException(__message, e));
×
157
    }
1✔
158
    java.util.Optional<Boolean> writable;
159

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

172
    } else {
173
      writable = null;
1✔
174
    }
175
    if (!__errors.isEmpty()) {
1✔
176
      throw new ValidationException("Trying 'RecordField'", __errors);
×
177
    }
178
    this.entryname = (Object) entryname;
1✔
179
    this.entry = (Object) entry;
1✔
180
    this.writable = (java.util.Optional<Boolean>) writable;
1✔
181
  }
1✔
182
}
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