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

common-workflow-language / cwljava / #394

31 Oct 2025 04:10PM UTC coverage: 57.972% (-1.6%) from 59.538%
#394

push

github

mr-c
rename package to a namespace that we control

7575 of 12994 new or added lines in 261 files covered. (58.3%)

7752 of 13372 relevant lines covered (57.97%)

0.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.12
/src/main/java/org/commonwl/cwlsdk/cwl1_1/SecondaryFileSchemaImpl.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.commonwl.cwlsdk.cwl1_1;
16

17
import org.commonwl.cwlsdk.cwl1_1.utils.LoaderInstances;
18
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptions;
19
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptionsBuilder;
20
import org.commonwl.cwlsdk.cwl1_1.utils.SaveableImpl;
21
import org.commonwl.cwlsdk.cwl1_1.utils.ValidationException;
22

23
/**
24
* Auto-generated class implementation for <I>https://w3id.org/cwl/cwl#SecondaryFileSchema</I><BR>
25
 */
26
public class SecondaryFileSchemaImpl extends SaveableImpl implements SecondaryFileSchema {
27
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
28
  private java.util.Map<String, Object> extensionFields_ =
1✔
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() {
NEW
34
    return this.extensionFields_;
×
35
  }
36

37
  private Object pattern;
38

39
  /**
40
   * Getter for property <I>https://w3id.org/cwl/cwl#SecondaryFileSchema/pattern</I><BR>
41
   * <BLOCKQUOTE>
42
   * Provides a pattern or expression specifying files or directories that
43
   * should be included alongside the primary file.
44
   * 
45
   * If the value is an expression, the value of `self` in the expression
46
   * must be the primary input or output File object to which this binding
47
   * applies.  The `basename`, `nameroot` and `nameext` fields must be
48
   * present in `self`.  For `CommandLineTool` outputs the `path` field must
49
   * also be present.  The expression must return a filename string relative
50
   * to the path to the primary File, a File or Directory object with either
51
   * `path` or `location` and `basename` fields set, or an array consisting
52
   * of strings or File or Directory objects.  It is legal to reference an
53
   * unchanged File or Directory object taken from input as a secondaryFile.
54
   * The expression may return "null" in which case there is no secondaryFile
55
   * from that expression.
56
   * 
57
   * To work on non-filename-preserving storage systems, portable tool
58
   * descriptions should avoid constructing new values from `location`, but
59
   * should construct relative references using `basename` or `nameroot`
60
   * instead.
61
   * 
62
   * If a value in `secondaryFiles` is a string that is not an expression,
63
   * it specifies that the following pattern should be applied to the path
64
   * of the primary file to yield a filename relative to the primary File:
65
   * 
66
   *   1. If string ends with `?` character, remove the last `?` and mark
67
   *     the resulting secondary file as optional.
68
   *   2. If string begins with one or more caret `^` characters, for each
69
   *     caret, remove the last file extension from the path (the last
70
   *     period `.` and all following characters).  If there are no file
71
   *     extensions, the path is unchanged.
72
   *   3. Append the remainder of the string to the end of the file path.
73
   *    * </BLOCKQUOTE>
74
   */
75

76
  public Object getPattern() {
77
    return this.pattern;
1✔
78
  }
79

80
  private Object required;
81

82
  /**
83
   * Getter for property <I>https://w3id.org/cwl/cwl#SecondaryFileSchema/required</I><BR>
84
   * <BLOCKQUOTE>
85
   * An implementation must not fail workflow execution if `required` is
86
   * set to `false` and the expected secondary file does not exist.
87
   * Default value for `required` field is `true` for secondary files on
88
   * input and `false` for secondary files on output.
89
   *    * </BLOCKQUOTE>
90
   */
91

92
  public Object getRequired() {
93
    return this.required;
1✔
94
  }
95

96
  /**
97
   * Used by {@link org.commonwl.cwlsdk.cwl1_1.utils.RootLoader} to construct instances of SecondaryFileSchemaImpl.
98
   *
99
   * @param __doc_            Document fragment to load this record object from (presumably a
100
                              {@link java.util.Map}).
101
   * @param __baseUri_        Base URI to generate child document IDs against.
102
   * @param __loadingOptions  Context for loading URIs and populating objects.
103
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
104
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
105
   *                             or validation of fields fails.
106
   */
107
  public SecondaryFileSchemaImpl(
108
      final Object __doc_,
109
      final String __baseUri_,
110
      LoadingOptions __loadingOptions,
111
      final String __docRoot_) {
112
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
113
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
114
    // generated names.
115
    String __baseUri = __baseUri_;
1✔
116
    String __docRoot = __docRoot_;
1✔
117
    if (!(__doc_ instanceof java.util.Map)) {
1✔
NEW
118
      throw new ValidationException("SecondaryFileSchemaImpl called on non-map");
×
119
    }
120
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
121
    final java.util.List<ValidationException> __errors =
1✔
122
        new java.util.ArrayList<ValidationException>();
123
    if (__loadingOptions != null) {
1✔
124
      this.loadingOptions_ = __loadingOptions;
1✔
125
    }
126
    Object pattern;
127
    try {
128
      pattern =
1✔
129
          LoaderInstances
130
              .union_of_StringInstance_or_ExpressionLoader
131
              .loadField(__doc.get("pattern"), __baseUri, __loadingOptions);
1✔
NEW
132
    } catch (ValidationException e) {
×
NEW
133
      pattern = null; // won't be used but prevents compiler from complaining.
×
NEW
134
      final String __message = "the `pattern` field is not valid because:";
×
NEW
135
      __errors.add(new ValidationException(__message, e));
×
136
    }
1✔
137
    Object required;
138

139
    if (__doc.containsKey("required")) {
1✔
140
      try {
141
        required =
1✔
142
            LoaderInstances
143
                .union_of_NullInstance_or_BooleanInstance_or_ExpressionLoader
144
                .loadField(__doc.get("required"), __baseUri, __loadingOptions);
1✔
NEW
145
      } catch (ValidationException e) {
×
NEW
146
        required = null; // won't be used but prevents compiler from complaining.
×
NEW
147
        final String __message = "the `required` field is not valid because:";
×
NEW
148
        __errors.add(new ValidationException(__message, e));
×
149
      }
1✔
150

151
    } else {
152
      required = null;
1✔
153
    }
154
    if (!__errors.isEmpty()) {
1✔
NEW
155
      throw new ValidationException("Trying 'RecordField'", __errors);
×
156
    }
157
    this.pattern = (Object) pattern;
1✔
158
    this.required = (Object) required;
1✔
159
    for (String field:__doc.keySet()) {
1✔
160
      if (!attrs.contains(field)) {
1✔
NEW
161
        if (field.contains(":")) {
×
NEW
162
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
163
          extensionFields_.put(expanded_field, __doc.get(field));
×
164
        }
165
      }
166
    }
1✔
167
  }
1✔
168
  private java.util.List<String> attrs = java.util.Arrays.asList("pattern", "required");
1✔
169
}
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