• 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

72.09
/src/main/java/org/w3id/cwl/cwl1_2/InlineJavascriptRequirementImpl.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#InlineJavascriptRequirement</I><BR> <BLOCKQUOTE>
25
 Indicates that the workflow platform must support inline Javascript expressions.
26
 If this requirement is not present, the workflow platform must not perform expression
27
 interpolation.
28
  </BLOCKQUOTE>
29
 */
30
public class InlineJavascriptRequirementImpl extends SaveableImpl implements InlineJavascriptRequirement {
31
  private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
1✔
32
  private java.util.Map<String, Object> extensionFields_ =
1✔
33
      new java.util.HashMap<String, Object>();
34
  public LoadingOptions getLoadingOptions() {
NEW
35
    return this.loadingOptions_;
×
36
  }
37
  public java.util.Map<String, Object> getExtensionFields() {
38
    return this.extensionFields_;
×
39
  }
40

41
  private InlineJavascriptRequirement_class class_;
42

43
  /**
44
   * Getter for property <I>https://w3id.org/cwl/cwl#InlineJavascriptRequirement/class</I><BR>
45
   * <BLOCKQUOTE>
46
   * Always 'InlineJavascriptRequirement'   * </BLOCKQUOTE>
47
   */
48

49
  public InlineJavascriptRequirement_class getClass_() {
50
    return this.class_;
×
51
  }
52

53
  private java.util.Optional<java.util.List<String>> expressionLib;
54

55
  /**
56
   * Getter for property <I>https://w3id.org/cwl/cwl#InlineJavascriptRequirement/expressionLib</I><BR>
57
   * <BLOCKQUOTE>
58
   * Additional code fragments that will also be inserted
59
   * before executing the expression code.  Allows for function definitions that may
60
   * be called from CWL expressions.
61
   *    * </BLOCKQUOTE>
62
   */
63

64
  public java.util.Optional<java.util.List<String>> getExpressionLib() {
65
    return this.expressionLib;
×
66
  }
67

68
  /**
69
   * Used by {@link org.w3id.cwl.cwl1_2.utils.RootLoader} to construct instances of InlineJavascriptRequirementImpl.
70
   *
71
   * @param __doc_            Document fragment to load this record object from (presumably a
72
                              {@link java.util.Map}).
73
   * @param __baseUri_        Base URI to generate child document IDs against.
74
   * @param __loadingOptions  Context for loading URIs and populating objects.
75
   * @param __docRoot_        ID at this position in the document (if available) (maybe?)
76
   * @throws ValidationException If the document fragment is not a {@link java.util.Map}
77
   *                             or validation of fields fails.
78
   */
79
  public InlineJavascriptRequirementImpl(
80
      final Object __doc_,
81
      final String __baseUri_,
82
      LoadingOptions __loadingOptions,
83
      final String __docRoot_) {
84
    super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
1✔
85
    // Prefix plumbing variables with '__' to reduce likelihood of collision with
86
    // generated names.
87
    String __baseUri = __baseUri_;
1✔
88
    String __docRoot = __docRoot_;
1✔
89
    if (!(__doc_ instanceof java.util.Map)) {
1✔
90
      throw new ValidationException("InlineJavascriptRequirementImpl called on non-map");
×
91
    }
92
    final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
1✔
93
    final java.util.List<ValidationException> __errors =
1✔
94
        new java.util.ArrayList<ValidationException>();
95
    if (__loadingOptions != null) {
1✔
96
      this.loadingOptions_ = __loadingOptions;
1✔
97
    }
98
    InlineJavascriptRequirement_class class_;
99
    try {
100
      class_ =
1✔
101
          LoaderInstances
102
              .uri_InlineJavascriptRequirement_class_False_True_None_None
103
              .loadField(__doc.get("class"), __baseUri, __loadingOptions);
1✔
104
    } catch (ValidationException e) {
1✔
105
      class_ = null; // won't be used but prevents compiler from complaining.
1✔
106
      final String __message = "the `class` field is not valid because:";
1✔
107
      __errors.add(new ValidationException(__message, e));
1✔
108
    }
1✔
109
    java.util.Optional<java.util.List<String>> expressionLib;
110

111
    if (__doc.containsKey("expressionLib")) {
1✔
112
      try {
113
        expressionLib =
1✔
114
            LoaderInstances
115
                .optional_array_of_StringInstance
116
                .loadField(__doc.get("expressionLib"), __baseUri, __loadingOptions);
1✔
117
      } catch (ValidationException e) {
×
118
        expressionLib = null; // won't be used but prevents compiler from complaining.
×
119
        final String __message = "the `expressionLib` field is not valid because:";
×
120
        __errors.add(new ValidationException(__message, e));
×
121
      }
1✔
122

123
    } else {
124
      expressionLib = null;
1✔
125
    }
126
    if (!__errors.isEmpty()) {
1✔
127
      throw new ValidationException("Trying 'RecordField'", __errors);
1✔
128
    }
129
    this.class_ = (InlineJavascriptRequirement_class) class_;
1✔
130
    this.expressionLib = (java.util.Optional<java.util.List<String>>) expressionLib;
1✔
131
    for (String field:__doc.keySet()) {
1✔
132
      if (!attrs.contains(field)) {
1✔
NEW
133
        if (field.contains(":")) {
×
NEW
134
          String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
×
NEW
135
          extensionFields_.put(expanded_field, __doc.get(field));
×
136
        }
137
      }
138
    }
1✔
139
  }
1✔
140
  private java.util.List<String> attrs = java.util.Arrays.asList("class", "expressionLib");
1✔
141
}
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