• 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

68.57
/src/main/java/org/w3id/cwl/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.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#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 java.util.Map<String, Object> getExtensionFields() {
NEW
31
    return this.extensionFields_;
×
32
  }
33

34
  private Object pattern;
35

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

73
  public Object getPattern() {
74
    return this.pattern;
1✔
75
  }
76

77
  private Object required;
78

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

89
  public Object getRequired() {
90
    return this.required;
1✔
91
  }
92

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

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

148
    } else {
149
      required = null;
1✔
150
    }
151
    if (!__errors.isEmpty()) {
1✔
152
      throw new ValidationException("Trying 'RecordField'", __errors);
×
153
    }
154
    this.pattern = (Object) pattern;
1✔
155
    this.required = (Object) required;
1✔
156
  }
1✔
157
}
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