|
| 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#CWLArraySchema</I><BR> |
| 25 | + */ |
| 26 | +public class CWLArraySchemaImpl extends SaveableImpl implements CWLArraySchema { |
| 27 | + private LoadingOptions loadingOptions_ = new LoadingOptionsBuilder().build(); |
| 28 | + private java.util.Map<String, Object> extensionFields_ = |
| 29 | + new java.util.HashMap<String, Object>(); |
| 30 | + |
| 31 | + private Object items; |
| 32 | + |
| 33 | + /** |
| 34 | + * Getter for property <I>https://w3id.org/cwl/salad#items</I><BR> |
| 35 | + * <BLOCKQUOTE> |
| 36 | + * Defines the type of the array elements. * </BLOCKQUOTE> |
| 37 | + */ |
| 38 | + |
| 39 | + public Object getItems() { |
| 40 | + return this.items; |
| 41 | + } |
| 42 | + |
| 43 | + private Array_name type; |
| 44 | + |
| 45 | + /** |
| 46 | + * Getter for property <I>https://w3id.org/cwl/salad#type</I><BR> |
| 47 | + * <BLOCKQUOTE> |
| 48 | + * Must be `array` * </BLOCKQUOTE> |
| 49 | + */ |
| 50 | + |
| 51 | + public Array_name getType() { |
| 52 | + return this.type; |
| 53 | + } |
| 54 | + |
| 55 | + /** |
| 56 | + * Used by {@link org.w3id.cwl.cwl1_1.utils.RootLoader} to construct instances of CWLArraySchemaImpl. |
| 57 | + * |
| 58 | + * @param __doc_ Document fragment to load this record object from (presumably a |
| 59 | + {@link java.util.Map}). |
| 60 | + * @param __baseUri_ Base URI to generate child document IDs against. |
| 61 | + * @param __loadingOptions Context for loading URIs and populating objects. |
| 62 | + * @param __docRoot_ ID at this position in the document (if available) (maybe?) |
| 63 | + * @throws ValidationException If the document fragment is not a {@link java.util.Map} |
| 64 | + * or validation of fields fails. |
| 65 | + */ |
| 66 | + public CWLArraySchemaImpl( |
| 67 | + final Object __doc_, |
| 68 | + final String __baseUri_, |
| 69 | + LoadingOptions __loadingOptions, |
| 70 | + final String __docRoot_) { |
| 71 | + super(__doc_, __baseUri_, __loadingOptions, __docRoot_); |
| 72 | + // Prefix plumbing variables with '__' to reduce likelihood of collision with |
| 73 | + // generated names. |
| 74 | + String __baseUri = __baseUri_; |
| 75 | + String __docRoot = __docRoot_; |
| 76 | + if (!(__doc_ instanceof java.util.Map)) { |
| 77 | + throw new ValidationException("CWLArraySchemaImpl called on non-map"); |
| 78 | + } |
| 79 | + final java.util.Map<String, Object> __doc = (java.util.Map<String, Object>) __doc_; |
| 80 | + final java.util.List<ValidationException> __errors = |
| 81 | + new java.util.ArrayList<ValidationException>(); |
| 82 | + if (__loadingOptions != null) { |
| 83 | + this.loadingOptions_ = __loadingOptions; |
| 84 | + } |
| 85 | + Object items; |
| 86 | + try { |
| 87 | + items = |
| 88 | + LoaderInstances |
| 89 | + .uri_union_of_PrimitiveType_or_CWLRecordSchema_or_EnumSchema_or_CWLArraySchema_or_StringInstance_or_array_of_union_of_PrimitiveType_or_CWLRecordSchema_or_EnumSchema_or_CWLArraySchema_or_StringInstance_False_True_2_None |
| 90 | + .loadField(__doc.get("items"), __baseUri, __loadingOptions); |
| 91 | + } catch (ValidationException e) { |
| 92 | + items = null; // won't be used but prevents compiler from complaining. |
| 93 | + final String __message = "the `items` field is not valid because:"; |
| 94 | + __errors.add(new ValidationException(__message, e)); |
| 95 | + } |
| 96 | + Array_name type; |
| 97 | + try { |
| 98 | + type = |
| 99 | + LoaderInstances |
| 100 | + .typedsl_Array_name_2 |
| 101 | + .loadField(__doc.get("type"), __baseUri, __loadingOptions); |
| 102 | + } catch (ValidationException e) { |
| 103 | + type = null; // won't be used but prevents compiler from complaining. |
| 104 | + final String __message = "the `type` field is not valid because:"; |
| 105 | + __errors.add(new ValidationException(__message, e)); |
| 106 | + } |
| 107 | + if (!__errors.isEmpty()) { |
| 108 | + throw new ValidationException("Trying 'RecordField'", __errors); |
| 109 | + } |
| 110 | + this.items = (Object) items; |
| 111 | + this.type = (Array_name) type; |
| 112 | + } |
| 113 | +} |
0 commit comments