• 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

61.76
/src/main/java/org/commonwl/cwlsdk/cwl1_1/InputBindingImpl.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#InputBinding</I><BR>
25
 */
26
public class InputBindingImpl extends SaveableImpl implements InputBinding {
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 java.util.Optional<Boolean> loadContents;
38

39
  /**
40
   * Getter for property <I>https://w3id.org/cwl/cwl#InputBinding/loadContents</I><BR>
41
   * <BLOCKQUOTE>
42
   * Use of `loadContents` in `InputBinding` is deprecated.
43
   * Preserved for v1.0 backwards compatability.  Will be removed in
44
   * CWL v2.0.  Use `InputParameter.loadContents` instead.
45
   * 
46
   * Only valid when `type: File` or is an array of `items: File`.
47
   * 
48
   * Read up to the first 64 KiB of text from the file and place it in the
49
   * "contents" field of the file object for use by expressions.
50
   *    * </BLOCKQUOTE>
51
   */
52

53
  public java.util.Optional<Boolean> getLoadContents() {
NEW
54
    return this.loadContents;
×
55
  }
56

57
  /**
58
   * Used by {@link org.commonwl.cwlsdk.cwl1_1.utils.RootLoader} to construct instances of InputBindingImpl.
59
   *
60
   * @param __doc_            Document fragment to load this record object from (presumably a
61
                              {@link java.util.Map}).
62
   * @param __baseUri_        Base URI to generate child document IDs against.
63
   * @param __loadingOptions  Context for loading URIs and populating objects.
64
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
65
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
66
   *                             or validation of fields fails.
67
   */
68
  public InputBindingImpl(
69
      final Object __doc_,
70
      final String __baseUri_,
71
      LoadingOptions __loadingOptions,
72
      final String __docRoot_) {
73
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
74
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
75
    // generated names.
76
    String __baseUri = __baseUri_;
1✔
77
    String __docRoot = __docRoot_;
1✔
78
    if (!(__doc_ instanceof java.util.Map)) {
1✔
NEW
79
      throw new ValidationException("InputBindingImpl called on non-map");
×
80
    }
81
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
82
    final java.util.List<ValidationException> __errors =
1✔
83
        new java.util.ArrayList<ValidationException>();
84
    if (__loadingOptions != null) {
1✔
85
      this.loadingOptions_ = __loadingOptions;
1✔
86
    }
87
    java.util.Optional<Boolean> loadContents;
88

89
    if (__doc.containsKey("loadContents")) {
1✔
90
      try {
91
        loadContents =
1✔
92
            LoaderInstances
93
                .optional_BooleanInstance
94
                .loadField(__doc.get("loadContents"), __baseUri, __loadingOptions);
1✔
NEW
95
      } catch (ValidationException e) {
×
NEW
96
        loadContents = null; // won't be used but prevents compiler from complaining.
×
NEW
97
        final String __message = "the `loadContents` field is not valid because:";
×
NEW
98
        __errors.add(new ValidationException(__message, e));
×
99
      }
1✔
100

101
    } else {
NEW
102
      loadContents = null;
×
103
    }
104
    if (!__errors.isEmpty()) {
1✔
NEW
105
      throw new ValidationException("Trying 'RecordField'", __errors);
×
106
    }
107
    this.loadContents = (java.util.Optional<Boolean>) loadContents;
1✔
108
    for (String field:__doc.keySet()) {
1✔
109
      if (!attrs.contains(field)) {
1✔
NEW
110
        if (field.contains(":")) {
×
NEW
111
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
112
          extensionFields_.put(expanded_field, __doc.get(field));
×
113
        }
114
      }
115
    }
1✔
116
  }
1✔
117
  private java.util.List<String> attrs = java.util.Arrays.asList("loadContents");
1✔
118
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc