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

common-workflow-language / cwljava / #389

30 Oct 2025 05:13PM UTC coverage: 58.693% (-0.8%) from 59.538%
#389

Pull #218

github

web-flow
Merge 98b159202 into befd7e4b9
Pull Request #218: Populate the extensionFields; add public accessors for LoadingOptions

230 of 569 new or added lines in 67 files covered. (40.42%)

28 existing lines in 27 files now uncovered.

7535 of 12838 relevant lines covered (58.69%)

0.59 hits per line

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

80.49
/src/main/java/org/w3id/cwl/cwl1_2/InplaceUpdateRequirementImpl.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#InplaceUpdateRequirement</I><BR> <BLOCKQUOTE>
25
 
26
 If `inplaceUpdate` is true, then an implementation supporting this
27
 feature may permit tools to directly update files with `writable:
28
 true` in InitialWorkDirRequirement.  That is, as an optimization,
29
 files may be destructively modified in place as opposed to copied
30
 and updated.
31
 
32
 An implementation must ensure that only one workflow step may
33
 access a writable file at a time.  It is an error if a file which
34
 is writable by one workflow step file is accessed (for reading or
35
 writing) by any other workflow step running independently.
36
 However, a file which has been updated in a previous completed
37
 step may be used as input to multiple steps, provided it is
38
 read-only in every step.
39
 
40
 Workflow steps which modify a file must produce the modified file
41
 as output.  Downstream steps which further process the file must
42
 use the output of previous steps, and not refer to a common input
43
 (this is necessary for both ordering and correctness).
44
 
45
 Workflow authors should provide this in the `hints` section.  The
46
 intent of this feature is that workflows produce the same results
47
 whether or not InplaceUpdateRequirement is supported by the
48
 implementation, and this feature is primarily available as an
49
 optimization for particular environments.
50
 
51
 Users and implementers should be aware that workflows that
52
 destructively modify inputs may not be repeatable or reproducible.
53
 In particular, enabling this feature implies that WorkReuse should
54
 not be enabled.
55
  </BLOCKQUOTE>
56
 */
57
public class InplaceUpdateRequirementImpl extends SaveableImpl implements InplaceUpdateRequirement {
58
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
59
  private java.util.Map<String, Object> extensionFields_ =
1✔
60
      new java.util.HashMap<String, Object>();
61
  public LoadingOptions getLoadingOptions() {
NEW
62
    return this.loadingOptions_;
×
63
  }
64
  public java.util.Map<String, Object> getExtensionFields() {
65
    return this.extensionFields_;
×
66
  }
67

68
  private InplaceUpdateRequirement_class class_;
69

70
  /**
71
   * Getter for property <I>https://w3id.org/cwl/cwl#InplaceUpdateRequirement/class</I><BR>
72
   * <BLOCKQUOTE>
73
   * Always 'InplaceUpdateRequirement'   * </BLOCKQUOTE>
74
   */
75

76
  public InplaceUpdateRequirement_class getClass_() {
77
    return this.class_;
×
78
  }
79

80
  private Boolean inplaceUpdate;
81

82
  /**
83
   * Getter for property <I>https://w3id.org/cwl/cwl#InplaceUpdateRequirement/inplaceUpdate</I><BR>
84

85
   */
86

87
  public Boolean getInplaceUpdate() {
88
    return this.inplaceUpdate;
×
89
  }
90

91
  /**
92
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of InplaceUpdateRequirementImpl.
93
   *
94
   * @param __doc_            Document fragment to load this record object from (presumably a
95
                              {@link java.util.Map}).
96
   * @param __baseUri_        Base URI to generate child document IDs against.
97
   * @param __loadingOptions  Context for loading URIs and populating objects.
98
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
99
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
100
   *                             or validation of fields fails.
101
   */
102
  public InplaceUpdateRequirementImpl(
103
      final Object __doc_,
104
      final String __baseUri_,
105
      LoadingOptions __loadingOptions,
106
      final String __docRoot_) {
107
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
108
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
109
    // generated names.
110
    String __baseUri = __baseUri_;
1✔
111
    String __docRoot = __docRoot_;
1✔
112
    if (!(__doc_ instanceof java.util.Map)) {
1✔
113
      throw new ValidationException("InplaceUpdateRequirementImpl called on non-map");
×
114
    }
115
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
116
    final java.util.List<ValidationException> __errors =
1✔
117
        new java.util.ArrayList<ValidationException>();
118
    if (__loadingOptions != null) {
1✔
119
      this.loadingOptions_ = __loadingOptions;
1✔
120
    }
121
    InplaceUpdateRequirement_class class_;
122
    try {
123
      class_ =
1✔
124
          LoaderInstances
125
              .uri_InplaceUpdateRequirement_class_False_True_None_None
126
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
127
    } catch (ValidationException e) {
1✔
128
      class_ = null; // won't be used but prevents compiler from complaining.
1✔
129
      final String __message = "the `class` field is not valid because:";
1✔
130
      __errors.add(new ValidationException(__message, e));
1✔
131
    }
1✔
132
    Boolean inplaceUpdate;
133
    try {
134
      inplaceUpdate =
1✔
135
          LoaderInstances
136
              .BooleanInstance
137
              .loadField(__doc.get("inplaceUpdate"), __baseUri, __loadingOptions);
1✔
138
    } catch (ValidationException e) {
1✔
139
      inplaceUpdate = null; // won't be used but prevents compiler from complaining.
1✔
140
      final String __message = "the `inplaceUpdate` field is not valid because:";
1✔
141
      __errors.add(new ValidationException(__message, e));
1✔
142
    }
1✔
143
    if (!__errors.isEmpty()) {
1✔
144
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
145
    }
146
    this.class_ = (InplaceUpdateRequirement_class) class_;
1✔
147
    this.inplaceUpdate = (Boolean) inplaceUpdate;
1✔
148
    for (String field:__doc.keySet()) {
1✔
149
      if (!attrs.contains(field)) {
1✔
NEW
150
        if (field.contains(":")) {
×
NEW
151
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
152
          extensionFields_.put(expanded_field, __doc.get(field));
×
153
        }
154
      }
155
    }
1✔
156
  }
1✔
157
  private java.util.List<String> attrs = java.util.Arrays.asList("class", "inplaceUpdate");
1✔
158
}
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