Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[![Coverage Status](https://coveralls.io/repos/github/common-workflow-language/cwljava/badge.svg?branch=cwl-1.2.0)](https://coveralls.io/github/common-workflow-language/cwljava?branch=cwl-1.2.0)

# org.w3id.cwl.cwl1_2
# org.commonwl.cwlsdk

This project contains Java objects and utilities auto-generated by <a href="https://github.com/common-workflow-language/schema_salad">Schema Salad</a> for parsing documents corresponding to the https://w3id.org/cwl/cwl# schema.

Expand Down
4 changes: 2 additions & 2 deletions adding_new_cwl_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ git ls-files -- tests | grep cwl$ | xargs -I{} bash -c 'cwltool --relax-path-che
mkdir valid-examples; for file in $(cat valid_examples.txt); do cp ${file} valid-examples/valid_$(basename ${file}) ; done

# build the Java parser
schema-salad-tool --codegen java --codegen-package org.w3id.cwl.cwl1_1 --codegen-examples ~/cwl-v1.1/valid-examples ~/cwl-v1.1/CommonWorkflowLanguage.yml
schema-salad-tool --codegen java --codegen-package org.commonwl.cwlsdk.cwl1_1 --codegen-examples ~/cwl-v1.1/valid-examples ~/cwl-v1.1/CommonWorkflowLanguage.yml

mvn test
# copy missing files into ./src/test/resources/org/w3id/cwl/cwl1_1/utils
# copy missing files into ./src/test/resources/org/commonwl/cwlsdk/cwl1_1/utils
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.w3id.cwl.sdk</groupId>
<artifactId>cwljava</artifactId>
<groupId>org.commonwl</groupId>
<artifactId>cwlsdk</artifactId>
<packaging>jar</packaging>
<name>Common Workflow Language SDK</name>
<description><![CDATA[This project contains Java objects and utilities auto-generated by <a href="https://github.com/common-workflow-language/schema_salad">Schema Salad</a> for parsing documents corresponding to the https://w3id.org/cwl/cwl# schema.]]></description>
Expand Down Expand Up @@ -70,7 +70,7 @@
<configuration>
<archive>
<manifest>
<mainClass>org.w3id.cwl.cwl1_2.utils.Validator</mainClass>
<mainClass>org.commonwl.cwlsdk.cwl1_2.utils.Validator</mainClass>
</manifest>
</archive>
<descriptorRefs>
Expand Down
37 changes: 37 additions & 0 deletions src/main/java/org/commonwl/cwlsdk/cwl1_1/Any.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright Common Workflow Language project contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.commonwl.cwlsdk.cwl1_1;

import org.commonwl.cwlsdk.cwl1_1.utils.ValidationException;

public enum Any {
ANY("Any");

private static String[] symbols = new String[] {"Any"};
private String docVal;

private Any(final String docVal) {
this.docVal = docVal;
}

public static Any fromDocumentVal(final String docVal) {
for(final Any val : Any.values()) {
if(val.docVal.equals(docVal)) {
return val;
}
}
throw new ValidationException(String.format("Expected one of %s", Any.symbols, docVal));
}
}
42 changes: 42 additions & 0 deletions src/main/java/org/commonwl/cwlsdk/cwl1_1/ArraySchema.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright Common Workflow Language project contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.commonwl.cwlsdk.cwl1_1;

import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptions;
import org.commonwl.cwlsdk.cwl1_1.utils.Saveable;

/**
* Auto-generated interface for <I>https://w3id.org/cwl/salad#ArraySchema</I><BR>This interface is implemented by {@link ArraySchemaImpl}<BR>
*/
public interface ArraySchema extends Saveable {

java.util.Map<String, Object> getExtensionFields();
LoadingOptions getLoadingOptions();

/**
* Getter for property <I>https://w3id.org/cwl/salad#items</I><BR>
* <BLOCKQUOTE>
* Defines the type of the array elements. * </BLOCKQUOTE>
*/

Object getItems();
/**
* Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
* <BLOCKQUOTE>
* Must be `array` * </BLOCKQUOTE>
*/

Array_name getType();
}
128 changes: 128 additions & 0 deletions src/main/java/org/commonwl/cwlsdk/cwl1_1/ArraySchemaImpl.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// Copyright Common Workflow Language project contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.commonwl.cwlsdk.cwl1_1;

import org.commonwl.cwlsdk.cwl1_1.utils.LoaderInstances;
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptions;
import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptionsBuilder;
import org.commonwl.cwlsdk.cwl1_1.utils.SaveableImpl;
import org.commonwl.cwlsdk.cwl1_1.utils.ValidationException;

/**
* Auto-generated class implementation for <I>https://w3id.org/cwl/salad#ArraySchema</I><BR>
*/
public class ArraySchemaImpl extends SaveableImpl implements ArraySchema {
private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build();
private java.util.Map<String, Object> extensionFields_ =
new java.util.HashMap<String, Object>();
public LoadingOptions getLoadingOptions() {
return this.loadingOptions_;
}
public java.util.Map<String, Object> getExtensionFields() {
return this.extensionFields_;
}

private Object items;

/**
* Getter for property <I>https://w3id.org/cwl/salad#items</I><BR>
* <BLOCKQUOTE>
* Defines the type of the array elements. * </BLOCKQUOTE>
*/

public Object getItems() {
return this.items;
}

private Array_name type;

/**
* Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
* <BLOCKQUOTE>
* Must be `array` * </BLOCKQUOTE>
*/

public Array_name getType() {
return this.type;
}

/**
* Used by {@link org.commonwl.cwlsdk.cwl1_1.utils.RootLoader} to construct instances of ArraySchemaImpl.
*
* @param __doc_ Document fragment to load this record object from (presumably a
{@link java.util.Map}).
* @param __baseUri_ Base URI to generate child document IDs against.
* @param __loadingOptions Context for loading URIs and populating objects.
* @param __docRoot_ ID at this position in the document (if available) (maybe?)
* @throws ValidationException If the document fragment is not a {@link java.util.Map}
* or validation of fields fails.
*/
public ArraySchemaImpl(
final Object __doc_,
final String __baseUri_,
LoadingOptions __loadingOptions,
final String __docRoot_) {
super(__doc_, __baseUri_, __loadingOptions, __docRoot_);
// Prefix plumbing variables with '__' to reduce likelihood of collision with
// generated names.
String __baseUri = __baseUri_;
String __docRoot = __docRoot_;
if (!(__doc_ instanceof java.util.Map)) {
throw new ValidationException("ArraySchemaImpl called on non-map");
}
final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_;
final java.util.List<ValidationException> __errors =
new java.util.ArrayList<ValidationException>();
if (__loadingOptions != null) {
this.loadingOptions_ = __loadingOptions;
}
Object items;
try {
items =
LoaderInstances
.uri_union_of_PrimitiveType_or_RecordSchema_or_EnumSchema_or_ArraySchema_or_MapSchema_or_UnionSchema_or_StringInstance_or_array_of_union_of_PrimitiveType_or_RecordSchema_or_EnumSchema_or_ArraySchema_or_MapSchema_or_UnionSchema_or_StringInstance_False_True_2_None
.loadField(__doc.get("items"), __baseUri, __loadingOptions);
} catch (ValidationException e) {
items = null; // won't be used but prevents compiler from complaining.
final String __message = "the `items` field is not valid because:";
__errors.add(new ValidationException(__message, e));
}
Array_name type;
try {
type =
LoaderInstances
.typedsl_Array_name_2
.loadField(__doc.get("type"), __baseUri, __loadingOptions);
} catch (ValidationException e) {
type = null; // won't be used but prevents compiler from complaining.
final String __message = "the `type` field is not valid because:";
__errors.add(new ValidationException(__message, e));
}
if (!__errors.isEmpty()) {
throw new ValidationException("Trying 'RecordField'", __errors);
}
this.items = (Object) items;
this.type = (Array_name) type;
for (String field:__doc.keySet()) {
if (!attrs.contains(field)) {
if (field.contains(":")) {
String expanded_field = __loadingOptions.expandUrl(field, "", false, false, null);
extensionFields_.put(expanded_field, __doc.get(field));
}
}
}
}
private java.util.List<String> attrs = java.util.Arrays.asList("items", "type");
}
37 changes: 37 additions & 0 deletions src/main/java/org/commonwl/cwlsdk/cwl1_1/Array_name.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// Copyright Common Workflow Language project contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.commonwl.cwlsdk.cwl1_1;

import org.commonwl.cwlsdk.cwl1_1.utils.ValidationException;

public enum Array_name {
ARRAY("array");

private static String[] symbols = new String[] {"array"};
private String docVal;

private Array_name(final String docVal) {
this.docVal = docVal;
}

public static Array_name fromDocumentVal(final String docVal) {
for(final Array_name val : Array_name.values()) {
if(val.docVal.equals(docVal)) {
return val;
}
}
throw new ValidationException(String.format("Expected one of %s", Array_name.symbols, docVal));
}
}
42 changes: 42 additions & 0 deletions src/main/java/org/commonwl/cwlsdk/cwl1_1/CWLArraySchema.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
// Copyright Common Workflow Language project contributors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.commonwl.cwlsdk.cwl1_1;

import org.commonwl.cwlsdk.cwl1_1.utils.LoadingOptions;
import org.commonwl.cwlsdk.cwl1_1.utils.Saveable;

/**
* Auto-generated interface for <I>https://w3id.org/cwl/cwl#CWLArraySchema</I><BR>This interface is implemented by {@link CWLArraySchemaImpl}<BR>
*/
public interface CWLArraySchema extends ArraySchema, Saveable {

java.util.Map<String, Object> getExtensionFields();
LoadingOptions getLoadingOptions();

/**
* Getter for property <I>https://w3id.org/cwl/salad#items</I><BR>
* <BLOCKQUOTE>
* Defines the type of the array elements. * </BLOCKQUOTE>
*/

Object getItems();
/**
* Getter for property <I>https://w3id.org/cwl/salad#type</I><BR>
* <BLOCKQUOTE>
* Must be `array` * </BLOCKQUOTE>
*/

Array_name getType();
}
Loading
Loading