From 55b9751d97dcef6034dbc5048101d3cfbc46a382 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Nov 2023 11:03:32 +0000 Subject: [PATCH 01/73] Bump org.apache.commons:commons-compress from 1.24.0 to 1.25.0 Bumps org.apache.commons:commons-compress from 1.24.0 to 1.25.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 36493e781..714020ecc 100644 --- a/pom.xml +++ b/pom.xml @@ -59,7 +59,7 @@ 4.8.164 1.15 2.15.0 - 1.24.0 + 1.25.0 3.13.0 32.1.3-jre 5.0.1 From dbab7091984340836ce2b21a9413acc37033c2e7 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Thu, 16 Nov 2023 15:44:51 +0100 Subject: [PATCH 02/73] Extracts common JsonMapper/TypeResolver factories (#198) Signed-off-by: Frank Schnicke --- .../v3/dataformat/json/JsonDeserializer.java | 63 ++++------------ .../v3/dataformat/json/JsonMapperFactory.java | 73 +++++++++++++++++++ .../v3/dataformat/json/JsonSerializer.java | 48 +++--------- .../SimpleAbstractTypeResolverFactory.java | 37 ++++++++++ 4 files changed, 135 insertions(+), 86 deletions(-) create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java create mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index bfefb16e2..ab6275d9e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -16,20 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; -import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -41,6 +27,16 @@ import java.util.List; import java.util.stream.Collectors; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; + /** * Class for deserializing/parsing AAS JSON documents. @@ -49,43 +45,14 @@ public class JsonDeserializer { protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; + private JsonMapperFactory jsonMapperFactory; private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; public JsonDeserializer() { - initTypeResolver(); - buildMapper(); - } - - protected void buildMapper() { - mapper = JsonMapper.builder() - .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) - .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) - .annotationIntrospector(new ReflectionAnnotationIntrospector()) - .addModule(buildEnumModule()) - .addModule(buildImplementationModule()) - .build(); - ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); - } - - @SuppressWarnings("unchecked") - private void initTypeResolver() { - typeResolver = new SimpleAbstractTypeResolver(); - ReflectionHelper.DEFAULT_IMPLEMENTATIONS - .stream() - .forEach(x -> typeResolver.addMapping(x.getInterfaceType(), x.getImplementationType())); - } - - protected SimpleModule buildEnumModule() { - SimpleModule module = new SimpleModule(); - ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new EnumDeserializer<>(x))); - return module; - } - - protected SimpleModule buildImplementationModule() { - SimpleModule module = new SimpleModule(); - module.setAbstractTypes(typeResolver); - return module; + typeResolver = new SimpleAbstractTypeResolverFactory().create(); + jsonMapperFactory = new JsonMapperFactory(); + mapper = jsonMapperFactory.create(typeResolver); } /** @@ -185,7 +152,7 @@ public Environment read(java.io.File file) throws FileNotFoundException, Deseria */ public void useImplementation(Class aasInterface, Class implementation) { typeResolver.addMapping(aasInterface, implementation); - buildMapper(); + mapper = jsonMapperFactory.create(typeResolver); } /** diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java new file mode 100644 index 000000000..a849c7370 --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import java.util.Arrays; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.json.JsonMapper.Builder; +import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; +import com.fasterxml.jackson.databind.module.SimpleModule; + +/** + * Factory for creating a {@link JsonMapper} configured to produce and consume AAS Version 3 conformant JSON serializations + * + * @author schnicke + * + */ +public class JsonMapperFactory { + + public JsonMapper create(SimpleAbstractTypeResolver typeResolver) { + Builder builder = JsonMapper.builder().enable(SerializationFeature.INDENT_OUTPUT).disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) + .annotationIntrospector(new ReflectionAnnotationIntrospector()) + .serializationInclusion(JsonInclude.Include.NON_NULL); + + getModulesToInstall(typeResolver).stream().forEach(m -> builder.addModule(m)); + + JsonMapper mapper = builder.build(); + ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); + + return mapper; + } + + protected List getModulesToInstall(SimpleAbstractTypeResolver typeResolver) { + return Arrays.asList(buildEnumModule(), buildImplementationModule(typeResolver)); + } + + protected SimpleModule buildImplementationModule(SimpleAbstractTypeResolver typeResolver) { + SimpleModule module = new SimpleModule(); + module.setAbstractTypes(typeResolver); + return module; + } + + protected SimpleModule buildEnumModule() { + SimpleModule module = new SimpleModule(); + ReflectionHelper.ENUMS.forEach(x -> module.addSerializer(x, new EnumSerializer())); + ReflectionHelper.ENUMS.forEach(x -> module.addDeserializer(x, new EnumDeserializer<>(x))); + return module; + } +} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index f370de8c0..993ee925d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -16,21 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.fasterxml.jackson.databind.json.JsonMapper; -import com.fasterxml.jackson.databind.module.SimpleModule; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; - import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; @@ -41,6 +26,15 @@ import java.util.Collection; import java.util.List; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectWriter; +import com.fasterxml.jackson.databind.json.JsonMapper; + /** * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to * JSON. @@ -52,29 +46,7 @@ public class JsonSerializer { private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; public JsonSerializer() { - buildMapper(); - } - - protected void buildMapper() { - mapper = JsonMapper.builder().enable(SerializationFeature.INDENT_OUTPUT) - .enable(DeserializationFeature.ACCEPT_SINGLE_VALUE_AS_ARRAY) - .serializationInclusion(JsonInclude.Include.NON_NULL) - .addModule(buildEnumModule()) - .addModule(buildCustomSerializerModule()) - .annotationIntrospector(new ReflectionAnnotationIntrospector()) - .build(); - ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue())); - } - - protected SimpleModule buildCustomSerializerModule() { - SimpleModule module = new SimpleModule(); - return module; - } - - protected SimpleModule buildEnumModule() { - SimpleModule module = new SimpleModule(); - module.addSerializer(Enum.class, new EnumSerializer()); - return module; + mapper = new JsonMapperFactory().create(new SimpleAbstractTypeResolverFactory().create()); } /** diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java new file mode 100644 index 000000000..742af85ab --- /dev/null +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; + +/** + * Factory for creating a {@link SimpleAbstractTypeResolver} configured with the + * Default Implementations of AAS4J + * + * @author schnicke + * + */ +public class SimpleAbstractTypeResolverFactory { + @SuppressWarnings("unchecked") + public SimpleAbstractTypeResolver create() { + SimpleAbstractTypeResolver typeResolver = new SimpleAbstractTypeResolver(); + ReflectionHelper.DEFAULT_IMPLEMENTATIONS.stream().forEach(x -> typeResolver.addMapping(x.getInterfaceType(), x.getImplementationType())); + return typeResolver; + } +} From 151355d950b4ae96caffb407feafda732d4ea76e Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Mon, 20 Nov 2023 09:28:28 +0100 Subject: [PATCH 03/73] Fixes wrong namespace in AASX files (#205) Signed-off-by: Frank Schnicke --- .../v3/dataformat/aasx/AASXDeserializer.java | 119 +++++++++++------- .../v3/dataformat/aasx/AASXSerializer.java | 30 ++--- 2 files changed, 93 insertions(+), 56 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 01674fab9..ab919fb93 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -15,6 +15,15 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + import org.apache.commons.io.IOUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; @@ -28,24 +37,19 @@ import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; - -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** * The AASX package converter converts a aasx package into a list of aas, a list * of submodels a list of assets, a list of Concept descriptions */ public class AASXDeserializer { + private static Logger logger = LoggerFactory.getLogger(AASXDeserializer.class); - private static final String XML_TYPE = "http://www.admin-shell.io/aasx/relationships/aas-spec"; - private static final String AASX_ORIGIN = "/aasx/aasx-origin"; + // In an older version of AAS4J/AASX Package Explorer, + // the wrong namespace was used + private static final String AASPEC_RELTYPE_BACKWARDSCOMPATIBLE = "http://www.admin-shell.io/aasx/relationships/aas-spec"; private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; @@ -107,31 +111,79 @@ public String getXMLResourceString() throws InvalidFormatException, IOException return getXMLResourceString(this.aasxRoot); } - private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormatException, IOException { - // Get the "/aasx/aasx-origin" Part. It is Relationship source for the - // XML-Document - PackagePart originPart = aasxPackage.getPart(PackagingURIHelper.createPartName(AASX_ORIGIN)); + /** + * Retrieves a list of related files from the deserialized aasx package + * + * @return the list of file in memory + * @throws InvalidFormatException + * if aasx package format is invalid + * @throws IOException + * if creating input streams for aasx fails + * @throws DeserializationException + * if deserialization of the serialized aas environment fails + */ + public List getRelatedFiles() throws InvalidFormatException, IOException, DeserializationException { + List filePaths = parseReferencedFilePathsFromAASX(); + List files = new ArrayList<>(); + for (String filePath : filePaths) { + files.add(readFile(aasxRoot, filePath)); + } + return files; + } - // Get the Relation to the XML Document - PackageRelationshipCollection originRelationships = originPart.getRelationshipsByType(XML_TYPE); + private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormatException, IOException { + PackagePart originPart = getOriginPart(aasxPackage); - // If there is more than one or no XML-Document that is an error - if (originRelationships.size() > 1) { - throw new RuntimeException("More than one 'aasx-spec' document found in .aasx"); - } else if (originRelationships.size() == 0) { - throw new RuntimeException("No 'aasx-spec' document found in .aasx"); - } + PackageRelationshipCollection originRelationships = getXMLDocumentRelation(originPart); - // Get the PackagePart of the XML-Document PackagePart xmlPart = originPart.getRelatedPart(originRelationships.getRelationship(0)); - // Read the content from the PackagePart + return readContentFromPackagePart(xmlPart); + } + + private String readContentFromPackagePart(PackagePart xmlPart) throws IOException { InputStream stream = xmlPart.getInputStream(); StringWriter writer = new StringWriter(); IOUtils.copy(stream, writer, DEFAULT_CHARSET); return writer.toString(); } + private PackagePart getOriginPart(OPCPackage aasxPackage) throws InvalidFormatException { + return aasxPackage.getPart(PackagingURIHelper.createPartName(AASXSerializer.ORIGIN_PATH)); + } + + private PackageRelationshipCollection getXMLDocumentRelation(PackagePart originPart) throws InvalidFormatException { + String xmlPart = getXMLPart(originPart); + PackageRelationshipCollection originRelationships = originPart.getRelationshipsByType(xmlPart); + + checkNumberOfRelationsForValidity(originRelationships); + + return originRelationships; + } + + private String getXMLPart(PackagePart originPart) throws InvalidFormatException { + if (isCompatibilityModeNeeded(originPart)) { + logger.warn("AASX contains wrong Relationship namespace. This may be related to a bug in AASX Package Explorer or an old version of AAS4J. Future compatibility with the wrong namespace may not be guaranteed"); + return AASPEC_RELTYPE_BACKWARDSCOMPATIBLE; + } else { + return AASXSerializer.AASSPEC_RELTYPE; + } + } + + private boolean isCompatibilityModeNeeded(PackagePart originPart) throws InvalidFormatException { + PackageRelationshipCollection originRelationshipsBackwardsCompatible = originPart.getRelationshipsByType(AASPEC_RELTYPE_BACKWARDSCOMPATIBLE); + + return originRelationshipsBackwardsCompatible.size() > 0; + } + + private void checkNumberOfRelationsForValidity(PackageRelationshipCollection originRelationships) throws InvalidFormatException { + if (originRelationships.size() > 1) { + throw new InvalidFormatException("More than one 'aasx-spec' document found in .aasx"); + } else if (originRelationships.size() == 0) { + throw new InvalidFormatException("No 'aasx-spec' document found in .aasx"); + } + } + /** * Load the referenced filepaths in the submodels such as PDF, PNG files from * the package @@ -174,23 +226,6 @@ private List parseElements(Collection elements) { return paths; } - /** - * Retrieves a list of related files from the deserialized aasx package - * - * @return the list of file in memory - * @throws InvalidFormatException if aasx package format is invalid - * @throws IOException if creating input streams for aasx fails - * @throws DeserializationException if deserialization of the serialized aas environment fails - */ - public List getRelatedFiles() throws InvalidFormatException, IOException, DeserializationException { - List filePaths = parseReferencedFilePathsFromAASX(); - List files = new ArrayList<>(); - for (String filePath : filePaths) { - files.add(readFile(aasxRoot, filePath)); - } - return files; - } - private InMemoryFile readFile(OPCPackage aasxRoot, String filePath) throws InvalidFormatException, IOException { PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(AASXUtils.getPathFromURL(filePath))); InputStream stream = part.getInputStream(); diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 0dc26f626..ebacc682d 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -15,6 +15,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.UUID; + import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.openxml4j.opc.OPCPackage; import org.apache.poi.openxml4j.opc.PackagePart; @@ -34,14 +42,6 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.IOException; -import java.io.OutputStream; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.util.ArrayList; -import java.util.Collection; -import java.util.UUID; - /** * This class can be used to generate an .aasx file from Metamodel Objects and * the Files referred to in the Submodels @@ -52,14 +52,16 @@ public class AASXSerializer { private static final String MIME_PLAINTXT = "text/plain"; private static final String MIME_XML = "application/xml"; - private static final String ORIGIN_RELTYPE = "http://www.admin-shell.io/aasx/relationships/aasx-origin"; - private static final String ORIGIN_PATH = "/aasx/aasx-origin"; - private static final String ORIGIN_CONTENT = "Intentionally empty."; + public static final String AASX_NAMESPACE = "http://admin-shell.io/aasx/relationships"; + + public static final String ORIGIN_RELTYPE = AASX_NAMESPACE + "/aasx-origin"; + public static final String ORIGIN_PATH = "/aasx/aasx-origin"; + public static final String ORIGIN_CONTENT = "Intentionally empty."; - private static final String AASSPEC_RELTYPE = "http://www.admin-shell.io/aasx/relationships/aas-spec"; - private static final String XML_PATH = "/aasx/xml/content.xml"; + public static final String AASSPEC_RELTYPE = AASX_NAMESPACE + "/aas-spec"; + public static final String XML_PATH = "/aasx/xml/content.xml"; - private static final String AASSUPPL_RELTYPE = "http://www.admin-shell.io/aasx/relationships/aas-suppl"; + public static final String AASSUPPL_RELTYPE = AASX_NAMESPACE + "/aas-suppl"; private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; From 722c248f6da93fb7d83d04d402a6cc291fe85bb1 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:54:30 +0100 Subject: [PATCH 04/73] Removes obsolete test files (#203) --------- Signed-off-by: Frank Schnicke --- .../src/test/resources/MotorAAS_reduced.json | 262 -- .../assetAdministrationShellList.json | 108 - .../src/test/resources/empty_aas.json | 2 - .../test/resources/invalidJsonExample.json | 468 --- .../src/test/resources/jsonExample.json | 493 --- .../resources/listOfSubmodelElements.json | 92 - .../resources/submodelElementListEmpty.json | 6 - .../src/test/resources/submodelList.json | 297 -- .../resources/test_demo_full_example.json | 2878 --------------- ...xample_withEmbeddedConceptDescription.json | 3135 ----------------- ...ple_AAS_ServoDCMotor - Simplified V2.0.xml | 436 --- .../resources/ServoDCMotor_invalid_V2.0.xml | 469 --- 12 files changed, 8646 deletions(-) delete mode 100644 dataformat-json/src/test/resources/MotorAAS_reduced.json delete mode 100644 dataformat-json/src/test/resources/assetAdministrationShellList.json delete mode 100644 dataformat-json/src/test/resources/empty_aas.json delete mode 100644 dataformat-json/src/test/resources/invalidJsonExample.json delete mode 100644 dataformat-json/src/test/resources/jsonExample.json delete mode 100644 dataformat-json/src/test/resources/listOfSubmodelElements.json delete mode 100644 dataformat-json/src/test/resources/submodelElementListEmpty.json delete mode 100644 dataformat-json/src/test/resources/submodelList.json delete mode 100644 dataformat-json/src/test/resources/test_demo_full_example.json delete mode 100644 dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json delete mode 100644 dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml delete mode 100644 dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml diff --git a/dataformat-json/src/test/resources/MotorAAS_reduced.json b/dataformat-json/src/test/resources/MotorAAS_reduced.json deleted file mode 100644 index 895605423..000000000 --- a/dataformat-json/src/test/resources/MotorAAS_reduced.json +++ /dev/null @@ -1,262 +0,0 @@ -{ - "assetAdministrationShells": [ - { - "modelType": "AssetAdministrationShell", - "idShort": "ExampleMotor", - "id": "http://customer.com/aas/9175_7013_7091_9168", - "assetInformation": { - "assetKind": "Instance", - "globalAssetId": { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "http://customer.com/assets/KHBVZJSQKIY" - } - ], - "type": "GlobalReference" - }, - "specificAssetIds": [ - { - "name": "EquipmentID", - "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", - "externalSubjectId": { - "keys": [ - { - "type": "GlobalReference", - "value": "http://customer.com/Systems/ERP/012" - } - ], - "type": "GlobalReference" - } - }, - { - "name": "DeviceID", - "value": "QjYgPggjwkiHk4RrQiYSLg==", - "externalSubjectId": { - "keys": [ - { - "type": "GlobalReference", - "value": "http://customer.com/Systems/IoT/1" - } - ], - "type": "GlobalReference" - } - } - ], - "thumbnail": { - "modelType": "File", - "kind": "Instance", - "idShort": "thumbnail", - "mimeType": "image/png", - "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" - } - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" - } - ], - "type": "GlobalReference" - } - ] - } - ], - "submodels": [ - { - "modelType": "Submodel", - "semanticId": { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#01-AFZ615#016" - } - ], - "type": "GlobalReference" - }, - "kind": "Instance", - "idShort": "TechnicalData", - "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", - "submodelElements": [ - { - "modelType": "Property", - "kind": "Instance", - "semanticId": { - "keys": [ - { - "type": "ConceptDescription", - "value": "0173-1#02-BAA120#008" - } - ], - "type": "GlobalReference" - }, - "idShort": "MaxRotationSpeed", - "category": "PARAMETER", - "value": "5000", - "valueType": "xs:integer" - } - ] - }, - { - "modelType": "Submodel", - "kind": "Instance", - "idShort": "OperationalData", - "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", - "submodelElements": [ - { - "modelType": "Property", - "kind": "Instance", - "semanticId": { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" - } - ], - "type": "GlobalReference" - }, - "idShort": "RotationSpeed", - "category": "Variable", - "value": "4370", - "valueType": "xs:integer" - } - ] - } - ], - "conceptDescriptions": [ - { - "modelType": "ConceptDescription", - "idShort": "MaxRotationSpeed", - "category": "PROPERTY", - "administration": { - "version": "0", - "revision": "2" - }, - "id": "0173-1#02-BAA120#008", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [ - { - "language": "de", - "text": "max.Drehzahl" - }, - { - "language": "en", - "text": "Max.rotationspeed" - } - ], - "shortNames": [], - "unit": "1/min", - "unitId": { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#05-AAA650#002" - } - ], - "type": "GlobalReference" - }, - "sourceOfDefinition": "", - "dataType": "RealMeasure", - "definition": [ - { - "language": "de", - "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" - }, - { - "language": "en", - "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" - } - ] - } - } - ] - }, - { - "modelType": "ConceptDescription", - "idShort": "RotationSpeed", - "category": "PROPERTY", - "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [ - { - "language": "DE", - "text": "AktuelleDrehzahl" - }, - { - "language": "EN", - "text": "Actualrotationspeed" - } - ], - "shortNames": [ - { - "language": "DE", - "text": "AktuelleDrehzahl" - }, - { - "language": "EN", - "text": "ActualRotationSpeed" - } - ], - "unit": "1/min", - "unitId": { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#05-AAA650#002" - } - ], - "type": "GlobalReference" - }, - "sourceOfDefinition": "", - "dataType": "RealMeasure", - "definition": [ - { - "language": "DE", - "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" - }, - { - "language": "EN", - "text": "Actual rotationspeed with which the motor or feedingunit is operated" - } - ] - } - } - ] - } - ] -} diff --git a/dataformat-json/src/test/resources/assetAdministrationShellList.json b/dataformat-json/src/test/resources/assetAdministrationShellList.json deleted file mode 100644 index d28d05007..000000000 --- a/dataformat-json/src/test/resources/assetAdministrationShellList.json +++ /dev/null @@ -1,108 +0,0 @@ -[ - { - "idShort": "TestAssetAdministrationShell", - "description": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ], - "modelType": "AssetAdministrationShell", - "id": "https://acplt.org/Test_AssetAdministrationShell", - "administration": { - "version": "0.9", - "revision": "0" - }, - "derivedFrom": { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/TestAssetAdministrationShell2" - } - ], - "type": "ExternalReference" - }, - "assetInformation": { - "assetKind": "Instance", - "globalAssetId": { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset" - } - ], - "type": "ExternalReference" - } - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - } - ], - "type": "ExternalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - } - ], - "type": "ExternalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" - } - ], - "type": "ExternalReference" - } - ] - }, - { - "idShort": "Test_AssetAdministrationShell_Mandatory", - "modelType": "AssetAdministrationShell", - "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", - "assetInformation": { - "assetKind": "Instance", - "globalAssetId": { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset_Mandatory" - } - ], - "type": "ExternalReference" - } - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - } - ], - "type": "ExternalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel2_Mandatory" - } - ], - "type": "ExternalReference" - } - ] - } -] diff --git a/dataformat-json/src/test/resources/empty_aas.json b/dataformat-json/src/test/resources/empty_aas.json deleted file mode 100644 index 7a73a41bf..000000000 --- a/dataformat-json/src/test/resources/empty_aas.json +++ /dev/null @@ -1,2 +0,0 @@ -{ -} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/invalidJsonExample.json b/dataformat-json/src/test/resources/invalidJsonExample.json deleted file mode 100644 index e9474c928..000000000 --- a/dataformat-json/src/test/resources/invalidJsonExample.json +++ /dev/null @@ -1,468 +0,0 @@ -{ - "assetAdministrationShells": [ - { - "modelType": "AssetAdministrationShell", - "idShort": "ExampleMotor", - "id": "http://customer.com/aas/9175_7013_7091_9168", - "assetInformation": { - "assetKind": "Instance", - "globalAssetId": { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "http://customer.com/assets/KHBVZJSQKIY" - } - ], - "type": "GlobalReference" - }, - "specificAssetIds": [ - { - "name": "EquipmentID", - "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", - "externalSubjectId": { - "keys": [ - { - "type": "GlobalReference", - "value": "http://customer.com/Systems/ERP/012" - } - ], - "type": "GlobalReference" - } - }, - { - "name": "DeviceID", - "value": "QjYgPggjwkiHk4RrQiYSLg==", - "externalSubjectId": { - "keys": [ - { - "type": "GlobalReference", - "value": "http://customer.com/Systems/IoT/1" - } - ], - "type": "GlobalReference" - } - } - ], - "thumbnail": { - "modelType": "File", - "kind": "Instance", - "idShort": "thumbnail", - "contentType": "image/png", - "path": "https://github.com/admin-shell/io/blob/master/verwaltungsschale-detail-part1.png" - } - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "http.//i40.customer.com/type/1/1/7A7104BDAB57E184" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" - } - ], - "type": "GlobalReference" - } - ] - } - ], - "submodels": [ - { - "modelType": "Submodel", - "semanticId": { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#01-AFZ615#016" - } - ], - "type": "GlobalReference" - }, - "kind": "Instance", - "idShort": "TechnicalData", - "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", - "submodelElements": [ - { - "modelType": "Property", - "kind": "Instance", - "semanticId": { - "keys": [ - { - "type": "ConceptDescription", - "value": "0173-1#02-BAA120#008" - } - ], - "type": "GlobalReference" - }, - "idShort": "MaxRotationSpeed", - "category": "PARAMETER", - "value": "5000", - "valueType": "xs:integer" - } - ] - }, - { - "modelType": "Submodel", - "kind": "Instance", - "idShort": "Documentation", - "id": "http://i40.customer.com/type/1/1/1A7B62B529F19152", - "submodelElements": [ - { - "modelType": "SubmodelElementCollection", - "kind": "Instance", - "semanticId": { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" - } - ], - "type": "GlobalReference" - }, - "idShort": "OperatingManual", - "value": [ - { - "modelType": "Property", - "kind": "Instance", - "semanticId": { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" - } - ] - }, - "idShort": "Title", - "value": "OperatingManual", - "valueType": "langString" - }, - { - "modelType": "File", - "kind": "Instance", - "semanticId": { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" - } - ], - "type": "GlobalReference" - }, - "idShort": "DigitalFile_PDF", - "contentType": "application/pdf", - "value": "/aasx/OperatingManual.pdf" - } - ], - "ordered": false, - "allowDuplicates": false - } - ] - }, - { - "modelType": "Submodel", - "kind": "Instance", - "idShort": "OperationalData", - "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", - "submodelElements": [ - { - "modelType": "Property", - "kind": "Instance", - "semanticId": { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" - } - ], - "type": "GlobalReference" - }, - "idShort": "RotationSpeed", - "category": "Variable", - "value": "4370", - "valueType": "xs:integer" - } - ] - } - ], - "conceptDescriptions": [ - { - "modelType": "ConceptDescription", - "idShort": "Title", - "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [ - { - "language": "EN", - "text": "Title" - }, - { - "language": "DE", - "text": "Titel" - } - ], - "shortNames": [ - { - "language": "EN", - "text": "Title" - }, - { - "language": "DE", - "text": "Titel" - } - ], - "unit": "", - "sourceOfDefinition": "", - "dataType": "StringTranslatable", - "definition": [ - { - "language": "DE", - "text": "SprachabhängigerTiteldesDokuments." - } - ] - } - } - ] - }, - { - "modelType": "ConceptDescription", - "idShort": "DigitalFile", - "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [ - { - "language": "EN", - "text": "DigitalFile" - }, - { - "language": "DE", - "text": "DigitaleDatei" - } - ], - "shortNames": [ - { - "language": "EN", - "text": "DigitalFile" - }, - { - "language": "DE", - "text": "DigitaleDatei" - } - ], - "unit": "", - "sourceOfDefinition": "", - "dataType": "String", - "definition": [ - { - "language": "DE", - "text": "Eine Datei, die die Document Version repräsentiert. Neben der obligatorischen PDF Datei können weitere Dateien angegeben werden." - } - ] - } - } - ] - }, - { - "modelType": "ConceptDescription", - "idShort": "MaxRotationSpeed", - "category": "PROPERTY", - "administration": { - "version": "", - "revision": "2" - }, - "id": "0173-1#02-BAA120#008", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [ - { - "language": "de", - "text": "max.Drehzahl" - }, - { - "language": "en", - "text": "Max.rotationspeed" - } - ], - "unit": "1/min", - "unitId": { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#05-AAA650#002" - } - ], - "type": "GlobalReference" - }, - "sourceOfDefinition": "", - "dataType": "RealMeasure", - "definition": [ - { - "language": "de", - "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" - }, - { - "language": "en", - "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" - } - ] - } - } - ] - }, - { - "modelType": "ConceptDescription", - "idShort": "RotationSpeed", - "category": "PROPERTY", - "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [ - { - "language": "DE", - "text": "AktuelleDrehzahl" - }, - { - "language": "EN", - "text": "Actualrotationspeed" - } - ], - "shortNames": [ - { - "language": "DE", - "text": "AktuelleDrehzahl" - }, - { - "language": "EN", - "text": "ActualRotationSpeed" - } - ], - "unit": "1/min", - "unitId": { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#05-AAA650#002" - } - ], - "type": "GlobalReference" - }, - "sourceOfDefinition": "", - "dataType": "RealMeasure", - "definition": [ - { - "language": "DE", - "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" - }, - { - "language": "EN", - "text": "Actual rotationspeed with which the motor or feedingunit is operated" - } - ] - } - } - ] - }, - { - "idShort": "Document", - "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "preferredName": [ - ], - "shortNames": [ - { - "language": "EN", - "text": "Document" - }, - { - "language": "DE", - "text": "Dokument" - } - ], - "unit": "", - "sourceOfDefinition": "[ISO15519-1:2010]", - "dataType": "String", - "definition": [ - { - "language": "DE", - "text": "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann." - } - ] - } - } - ] - } - ] -} diff --git a/dataformat-json/src/test/resources/jsonExample.json b/dataformat-json/src/test/resources/jsonExample.json deleted file mode 100644 index 41fefacbd..000000000 --- a/dataformat-json/src/test/resources/jsonExample.json +++ /dev/null @@ -1,493 +0,0 @@ - -{ - "assetAdministrationShells": [ - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "http://customer.com/assets/KHBVZJSQKIY" - } - ], - "type": "GlobalReference" - }, - "specificAssetIds": [ - { - "name": "EquipmentID", - "value": "538fd1b3-f99f-4a52-9c75-72e9fa921270", - "externalSubjectId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://customer.com/Systems/ERP/012" - } - ], - "type": "GlobalReference" - } - }, - { - "name": "DeviceID", - "value": "QjYgPggjwkiHk4RrQiYSLg==", - "externalSubjectId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://customer.com/Systems/IoT/1" - } - ], - "type": "GlobalReference" - } - } - ], - "thumbnail": { - "contentType": "image/png", - "path": "file:///master/verwaltungsschale-detail-part1.png" - } - }, - "submodels": [ - { - "keys": [ - { - "type": "Submodel", - "value": "http://i40.customer.com/type/1/1/7A7104BDAB57E184" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - "type": "Submodel", - "value": "http://i40.customer.com/type/1/1/1A7B62B529F19152" - } - ], - "type": "GlobalReference" - } - ], - "id": "http://customer.com/aas/9175_7013_7091_9168", - "idShort": "ExampleMotor" - } - ], - "conceptDescriptions": [ - { - "modelType": "ConceptDescription", - "category": "PROPERTY", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": - { - "modelType": "DataSpecificationIEC61360", - "dataType": "STRING_TRANSLATABLE", - "sourceOfDefinition": "ExampleString", - "unit": "ExampleString", - "definition": [ - { - "language": "EN", - "text": "SprachabhängigerTiteldesDokuments." - } - ], - "preferredName": [ - { - "language": "EN", - "text": "Title" - }, - { - "language": "DE", - "text": "Titel" - } - ], - "shortName": [ - { - "language": "EN", - "text": "Title" - }, - { - "language": "DE", - "text": "Titel" - } - ] - } - } - ], - "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title", - "idShort": "Title" - }, - { - "modelType": "ConceptDescription", - "category": "PROPERTY", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": - { - "modelType": "DataSpecificationIEC61360", - "dataType": "STRING", - "sourceOfDefinition": "ExampleString", - "unit": "ExampleString", - "definition": [ - { - "language": "EN", - "text": "A file representing the document version. In addition to the mandatory PDF file, other files can be specified." - } - ], - "preferredName": [ - { - "language": "EN", - "text": "DigitalFile" - }, - { - "language": "EN", - "text": "DigitalFile" - } - ], - "shortName": [ - { - "language": "EN", - "text": "DigitalFile" - }, - { - "language": "DE", - "text": "DigitaleDatei" - } - ] - } - } - ], - "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile", - "idShort": "DigitalFile" - }, - { - "modelType": "ConceptDescription", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": - { - "modelType": "DataSpecificationIEC61360", - "dataType": "REAL_MEASURE", - "sourceOfDefinition": "ExampleString", - "unit": "1/min", - "unitId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#05-AAA650#002" - } - ], - "type": "GlobalReference" - }, - "definition": [ - { - "language": "de", - "text": "HöchstezulässigeDrehzahl,mitwelcherderMotoroderdieSpeiseinheitbetriebenwerdendarf" - }, - { - "language": "EN", - "text": "Greatestpermissiblerotationspeedwithwhichthemotororfeedingunitmaybeoperated" - } - ], - "preferredName": [ - { - "language": "de", - "text": "max.Drehzahl" - }, - { - "language": "en", - "text": "Max.rotationspeed" - } - ] - } - } - ], - "administration": - { - "revision": "2.1", - "version": "2" - }, - "id": "0173-1#02-BAA120#008", - "category": "PROPERTY", - "idShort": "MaxRotationSpeed" - }, - { - "modelType": "ConceptDescription", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": - { - "modelType": "DataSpecificationIEC61360", - "dataType": "REAL_MEASURE", - "sourceOfDefinition": "ExampleString", - "unit": "1/min", - "unitId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#05-AAA650#002" - } - ], - "type": "GlobalReference" - }, - "definition": [ - { - "language": "DE", - "text": "Aktuelle Drehzahl, mitwelcher der Motor oder die Speiseinheit betrieben wird" - }, - { - "language": "EN", - "text": "Actual rotationspeed with which the motor or feedingunit is operated" - } - ], - "preferredName": [ - { - "language": "DE", - "text": "AktuelleDrehzahl" - }, - { - "language": "EN", - "text": "Actualrotationspeed" - } - ], - "shortName": [ - { - "language": "DE", - "text": "AktuelleDrehzahl" - }, - { - "language": "EN", - "text": "ActualRotationSpeed" - } - ] - } - } - ], - "id": "http://customer.com/cd/1/1/18EBD56F6B43D895", - "category": "PROPERTY", - "idShort": "RotationSpeed" - }, - { - "modelType": "ConceptDescription", - "category": "PROPERTY", - "embeddedDataSpecifications": [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": - { - "modelType": "DataSpecificationIEC61360", - "dataType": "STRING", - "sourceOfDefinition": "[ISO15519-1:2010]", - "unit": "ExampleString", - "definition": [ - { - "language": "EN", - "text": "Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann." - } - ], - "preferredName": [ - { - "language": "EN", - "text": "Document" - } - ], - "shortName": [ - { - "language": "EN", - "text": "Document" - }, - { - "language": "DE", - "text": "Dokument" - } - ] - } - } - ], - "id": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document", - "idShort": "Document" - } - ], - "submodels": [ - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#01-AFZ615#016" - } - ], - "type": "GlobalReference" - }, - "id": "http://i40.customer.com/type/1/1/7A7104BDAB57E184", - "idShort": "TechnicalData", - "submodelElements": [ - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "ConceptDescription", - "value": "0173-1#02-BAA120#008" - } - ], - "type": "GlobalReference" - }, - "value": "5000", - "valueType": "xs:integer", - "category": "PARAMETER", - "idShort": "MaxRotationSpeed" - } - ] - }, - { - "modelType": "Submodel", - "kind": "Instance", - "id": "http://i40.customer.com/type/1/1/1A7B62B529F19152", - "idShort": "Documentation", - "submodelElements": [ - { - "modelType":"SubmodelElementCollection", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document" - } - ], - "type": "GlobalReference" - }, - "idShort": "OperatingManual", - "value": [ - { - "modelType": "Property", - "category": "VARIABLE", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title" - } - ], - "type": "GlobalReference" - }, - "value": "OperatingManual", - "valueType": "xs:string", - "idShort": "Title" - }, - { - "modelType": "File", - "category": "VARIABLE", - "contentType": "application/pdf", - "value": "file:///aasx/OperatingManual.pdf", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile" - } - ], - "type": "GlobalReference" - }, - "idShort": "DigitalFile_PDF" - } - ] - } - ] - }, - { - "modelType": "Submodel", - "kind": "Instance", - "id": "http://i40.customer.com/instance/1/1/AC69B1CB44F07935", - "idShort": "OperationalData", - "submodelElements": [ - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "ConceptDescription", - "value": "http://customer.com/cd/1/1/18EBD56F6B43D895" - } - ], - "type": "GlobalReference" - }, - "value": "4370", - "valueType": "xs:integer", - "category": "VARIABLE", - "idShort": "RotationSpeed" - } - ] - } - ] -} diff --git a/dataformat-json/src/test/resources/listOfSubmodelElements.json b/dataformat-json/src/test/resources/listOfSubmodelElements.json deleted file mode 100644 index 8073bcbe8..000000000 --- a/dataformat-json/src/test/resources/listOfSubmodelElements.json +++ /dev/null @@ -1,92 +0,0 @@ -[ - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int", - "kind": "ConceptQualifier" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int", - "kind": "ConceptQualifier" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - }, - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "value": "978-8234-234-342", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "978-8234-234-342" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "idShort": "InstanceId", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } -] diff --git a/dataformat-json/src/test/resources/submodelElementListEmpty.json b/dataformat-json/src/test/resources/submodelElementListEmpty.json deleted file mode 100644 index ca37a7d6a..000000000 --- a/dataformat-json/src/test/resources/submodelElementListEmpty.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "modelType" : "SubmodelElementList", - "idShort" : "submodelElementList", - "orderRelevant" : true, - "kind": "Instance" -} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/submodelList.json b/dataformat-json/src/test/resources/submodelList.json deleted file mode 100644 index 9337b3480..000000000 --- a/dataformat-json/src/test/resources/submodelList.json +++ /dev/null @@ -1,297 +0,0 @@ -[ - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", - "idShort": "Identification", - "submodelElements": [ - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int", - "kind": "ConceptQualifier" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int", - "kind": "ConceptQualifier" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - }, - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "value": "978-8234-234-342", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "978-8234-234-342" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "idShort": "InstanceId", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - ], - "description": [ - { - "language": "en-us", - "text": "An example asset identification submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" - } - ] - }, - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "version": "0.9" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", - "idShort": "BillOfMaterial", - "submodelElements": [ - { - "modelType": "Entity", - "kind": "Instance", - "entityType": "CoManagedEntity", - "statements": [ - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValue2", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValue2" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty2", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - }, - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - ], - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "idShort": "ExampleEntity", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - }, - { - "modelType": "Entity", - "entityType": "SelfManagedEntity", - "kind": "Instance", - "globalAssetId": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset2" - } - ], - "type": "GlobalReference" - }, - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "idShort": "ExampleEntity2", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - ], - "description": [ - { - "language": "en-us", - "text": "An example bill of material submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung" - } - ] - } -] diff --git a/dataformat-json/src/test/resources/test_demo_full_example.json b/dataformat-json/src/test/resources/test_demo_full_example.json deleted file mode 100644 index 5a6adcd08..000000000 --- a/dataformat-json/src/test/resources/test_demo_full_example.json +++ /dev/null @@ -1,2878 +0,0 @@ - -{ - "assetAdministrationShells": [ - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset" - } - ], - "type": "GlobalReference" - } - }, - "derivedFrom": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/TestAssetAdministrationShell2" - } - ], - "type": "GlobalReference" - }, - "submodels": [ - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" - } - ], - "type": "GlobalReference" - } - ], - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_AssetAdministrationShell", - "idShort": "TestAssetAdministrationShell", - "description": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - - }, - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset_Mandatory" - } - ], - "type": "GlobalReference" - } - }, - "submodels": [ - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel2_Mandatory" - } - ], - "type": "GlobalReference" - } - ], - "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", - "idShort": "Test_AssetAdministrationShell_Mandatory" - }, - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset_Mandatory" - } - ], - "type": "GlobalReference" - } - }, - "id": "https://acplt.org/Test_AssetAdministrationShell2_Mandatory", - "idShort": "Test_AssetAdministrationShell2_Mandatory" - }, - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset_Missing" - } - ], - "type": "GlobalReference" - } - }, - "submodels": [ - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - } - ], - "type": "GlobalReference" - } - ], - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_AssetAdministrationShell_Missing", - "idShort": "TestAssetAdministrationShell", - "description": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - - } - ], - "conceptDescriptions": [ - { - "modelType": "ConceptDescription", - "category": "PROPERTY", - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_ConceptDescription", - "idShort": "TestConceptDescription", - "isCaseOf": [ - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/DataSpecifications/Conceptdescription/TestConceptDescription" - } - ], - "type": "GlobalReference" - } - ], - "description": [ - { - "language": "en-us", - "text": "An example concept description for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-ConceptDescription für eine Test-Anwendung" - } - ] - - }, - { - "modelType": "ConceptDescription", - "category": "PROPERTY", - "id": "https://acplt.org/Test_ConceptDescription_Mandatory", - "idShort": "Test_ConceptDescription_Mandatory" - }, - { - "modelType": "ConceptDescription", - "category": "PROPERTY", - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_ConceptDescription_Missing", - "idShort": "TestConceptDescription1", - "description": [ - { - "language": "en-us", - "text": "An example concept description for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-ConceptDescription für eine Test-Anwendung" - } - ] - - }, - { - "modelType": "ConceptDescription", - "category": "PROPERTY", - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "http://acplt.org/DataSpecifciations/Example/Identification", - "idShort": "TestSpec_01", - "isCaseOf": [ - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ReferenceElements/ConceptDescriptionX" - } - ], - "type": "GlobalReference" - } - ], - "embeddedDataSpecifications": - [ - { - "dataSpecification": { - "keys": [ - { - "type": "GlobalReference", - "value": "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIEC61360" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": { - "modelType": "DataSpecificationIEC61360", - "dataType": "REAL_MEASURE", - "sourceOfDefinition": "http://acplt.org/DataSpec/ExampleDef", - "symbol": "SU", - "unit": "SpaceUnit", - "unitId": { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Units/SpaceUnit" - } - ], - "type": "GlobalReference" - }, - "value": "TEST", - "valueFormat": "string", - "valueList": { - "valueReferencePairs": [ - { - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - } - }, - { - "value": "http://acplt.org/ValueId/ExampleValueId2", - "valueId": { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId2" - } - ], - "type": "GlobalReference" - } - } - ] - }, - "definition": [ - { - "language": "de", - "text": "Dies ist eine Data Specification für Testzwecke" - }, - { - "language": "en-us", - "text": "This is a DataSpecification for testing purposes" - } - ], - "levelType": "Max", - "preferredName": [ - { - "language": "de", - "text": "Test Specification" - }, - { - "language": "en-us", - "text": "TestSpecification" - } - ], - "shortName": [ - { - "language": "de", - "text": "Test Spec" - }, - { - "language": "en-us", - "text": "TestSpec" - } - ] - } - } - ] - } - ], - "submodels": [ - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", - "idShort": "Identification", - "submodelElements": [ - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "xs:int", - "kind": "ConceptQualifier" - }, - { - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "xs:int", - "kind": "ConceptQualifier" - } - ], - "idShort": "ManufacturerName", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - - }, - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "value": "978-8234-234-342", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "978-8234-234-342" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "idShort": "InstanceId", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - - } - ], - "description": [ - { - "language": "en-us", - "text": "An example asset identification submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Identifikations-Submodel für eine Test-Anwendung" - } - ] - - }, - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "version": "0.9" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", - "idShort": "BillOfMaterial", - "submodelElements": [ - { - "modelType": "Entity", - "kind": "Instance", - "entityType": "CoManagedEntity", - "statements": [ - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValue2", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValue2" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty2", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - }, - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - ], - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "idShort": "ExampleEntity", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - - }, - { - "modelType": "Entity", - "kind": "Instance", - "entityType": "SelfManagedEntity", - "globalAssetId": - { - "keys": [ - { - - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset2" - } - ], - "type": "GlobalReference" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "idShort": "ExampleEntity2", - "description": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - - } - ], - "description": [ - { - "language": "en-us", - "text": "An example bill of material submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-BillofMaterial-Submodel für eine Test-Anwendung" - } - ] - - }, - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_Submodel", - "idShort": "TestSubmodel", - "submodelElements": [ - { - "modelType": "RelationshipElement", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleRelationshipElement", - "first": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "second": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - }, - { - "type": "Entity", - "value": "ExampleEntity" - }, - { - "type": "Property", - "value": "ExampleProperty2" - } - ], - "type": "ModelReference" - }, - "description": [ - { - "language": "en-us", - "text": "Example RelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel RelationshipElement Element" - } - ] - - }, - { - "modelType": "AnnotatedRelationshipElement", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleAnnotatedRelationshipElement", - "first": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "second": - { - "keys": [ - { - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - }, - { - "type": "Entity", - "value": "ExampleEntity" - }, - { - "type": "Property", - "value": "ExampleProperty2" - } - ], - "type": "ModelReference" - }, - "annotations": [ - { - "modelType": "Property", - "kind": "Instance", - "value": "some example annotation", - "valueType": "xs:string", - "category": "PARAMETER", - "idShort": "ExampleProperty3" - } - ], - "description": [ - { - "language": "en-us", - "text": "Example AnnotatedRelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel AnnotatedRelationshipElement Element" - } - ] - - }, - { - "modelType": "Operation", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Operations/ExampleOperation" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleOperation", - "inoutputVariables": [ - { - "value": - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty3", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - } - ], - "inputVariables": [ - { - "value": - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty1", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - } - ], - "outputVariables": [ - { - "value": - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty2", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - } - ], - "description": [ - { - "language": "en-us", - "text": "Example Operation object" - }, - { - "language": "de", - "text": "Beispiel Operation Element" - } - ] - - }, - { - "modelType": "Capability", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Capabilities/ExampleCapability" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleCapability", - "description": [ - { - "language": "en-us", - "text": "Example Capability object" - }, - { - "language": "de", - "text": "Beispiel Capability Element" - } - ] - - }, - { - "modelType": "BasicEventElement", - "kind": "Instance", - "observed": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Events/ExampleBasicEvent" - } - ], - "type": "GlobalReference" - }, - "direction": "INPUT", - "state": "ON", - "category": "PARAMETER", - "idShort": "ExampleBasicEvent", - "description": [ - { - "language": "en-us", - "text": "Example BasicEvent object" - }, - { - "language": "de", - "text": "Beispiel BasicEvent Element" - } - ], - "direction": "INPUT", - "state": "ON" - }, - { - "modelType": "SubmodelElementList", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleSubmodelElementListOrdered", - "orderRelevant": true, - "description": [ - { - "language": "en-us", - "text": "Example ExampleSubmodelElementListOrdered object" - }, - { - "language": "de", - "text": "Beispiel ExampleSubmodelElementListOrdered Element" - } - ], - "typeValueListElement": "SubmodelElement", - "value": [ - { - "modelType": "Property", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - }, - { - "modelType": "MultiLanguageProperty", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "valueId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleMultiLanguageValueId" - } - ], - "type": "GlobalReference" - }, - "category": "CONSTANT", - "idShort": "ExampleMultiLanguageProperty", - "value": [ - { - "language": "en-us", - "text": "Example value of a MultiLanguageProperty element" - }, - { - "language": "de", - "text": "Beispielswert für ein MultiLanguageProperty-Element" - } - ], - "description": [ - { - "language": "en-us", - "text": "Example MultiLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MultiLanguageProperty Element" - } - ] - - }, - { - "modelType": "Range", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "max": "100", - "min": "0", - "valueType": "xs:int", - "category": "PARAMETER", - "idShort": "ExampleRange", - "description": [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ] - - } - ] - }, - { - "modelType": "SubmodelElementCollection", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleSubmodelElementCollection", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollection object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollection Element" - } - ], - "value": [ - { - "modelType": "Blob", - "kind": "Instance", - - "contentType": "application/pdf", - "value": "AQIDBAU=", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Blobs/ExampleBlob" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleBlob", - "description": [ - { - "language": "en-us", - "text": "Example Blob object" - }, - { - "language": "de", - "text": "Beispiel Blob Element" - } - ] - - }, - { - "modelType": "File", - "kind": "Instance", - - "contentType": "application/pdf", - "value": "file:///TestFile.pdf", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Files/ExampleFile" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleFile", - "description": [ - { - "language": "en-us", - "text": "Example File object" - }, - { - "language": "de", - "text": "Beispiel File Element" - } - ] - - }, - { - "modelType": "ReferenceElement", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleReferenceElement", - "value": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "description": [ - { - "language": "en-us", - "text": "Example Reference Element object" - }, - { - "language": "de", - "text": "Beispiel Reference Element Element" - } - ] - - } - ] - } - ], - "description": [ - { - "language": "en-us", - "text": "An example submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" - } - ] - - }, - { - "modelType": "Submodel", - "kind": "Template", - "id": "https://acplt.org/Test_Submodel_Mandatory", - "idShort": "Test_Submodel_Mandatory", - "submodelElements": [ - { - "modelType": "RelationshipElement", - "kind": "Instance", - "idShort": "ExampleRelationshipElement", - "first": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListUnordered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "second": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListUnordered" - }, - { - "type": "MultiLanguageProperty", - "value": "ExampleMultiLanguageProperty" - } - ], - "type": "ModelReference" - } - }, - { - "modelType": "AnnotatedRelationshipElement", - "kind": "Instance", - "idShort": "ExampleAnnotatedRelationshipElement", - "first": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelElementCollection" - }, - { - "type": "Blob", - "value": "ExampleBlob" - } - ], - "type": "ModelReference" - }, - "second": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListUnordered" - }, - { - "type": "MultiLanguageProperty", - "value": "ExampleMultiLanguageProperty" - } - ], - "type": "ModelReference" - } - }, - { - "modelType": "Operation", - "kind": "Template", - "idShort": "ExampleOperation" - }, - { - "modelType": "Capability", - "kind": "Instance", - - "idShort": "ExampleCapability" - }, - { - "modelType": "BasicEventElement", - "kind": "Instance", - - "observed": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListUnordered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "idShort": "ExampleBasicEvent", - "direction": "OUTPUT", - "state": "OFF" - }, - { - "modelType": "SubmodelElementList", - "kind": "Instance", - - "idShort": "ExampleSubmodelElementListUnordered", - "orderRelevant": false, - "typeValueListElement": "SubmodelElement", - "value": [ - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "valueType": "xs:string", - "idShort": "ExampleProperty" - }, - { - "modelType": "MultiLanguageProperty", - "kind": "Instance", - "category": "VARIABLE", - "idShort": "ExampleMultiLanguageProperty" - }, - { - "modelType": "Range", - "kind": "Instance", - "category": "VARIABLE", - "valueType": "xs:int", - "idShort": "ExampleRange" - } - ] - }, - { - "modelType": "SubmodelElementCollection", - "kind": "Instance", - "idShort": "ExampleSubmodelElementCollection", - "value": [ - { - "modelType": "Blob", - "kind": "Instance", - "category": "VARIABLE", - "contentType": "application/pdf", - "idShort": "ExampleBlob" - }, - { - "modelType": "File", - "kind": "Instance", - "category": "VARIABLE", - "contentType": "application/pdf", - "idShort": "ExampleFile" - }, - { - "modelType": "ReferenceElement", - "kind": "Instance", - "category": "VARIABLE", - "idShort": "ExampleReferenceElement" - } - ] - }, - { - "modelType": "SubmodelElementCollection", - "kind": "Instance", - "idShort": "ExampleSubmodelElementCollection2" - } - ] - }, - { - "modelType": "Submodel", - "kind": "Instance", - "id": "https://acplt.org/Test_Submodel2_Mandatory", - "idShort": "Test_Submodel2_Mandatory" - }, - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_Submodel_Missing", - "idShort": "TestSubmodelMissing", - "submodelElements": [ - { - "modelType": "RelationshipElement", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleRelationshipElement", - "first": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "second": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "MultiLanguageProperty", - "value": "ExampleMultiLanguageProperty" - } - ], - "type": "ModelReference" - }, - "description": [ - { - "language": "en-us", - "text": "Example RelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel RelationshipElement Element" - } - ] - - }, - { - "modelType": "AnnotatedRelationshipElement", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleAnnotatedRelationshipElement", - "first": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "second": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "MultiLanguageProperty", - "value": "ExampleMultiLanguageProperty" - } - ], - "type": "ModelReference" - }, - "annotations": [ - { - "modelType": "Property", - "kind": "Instance", - "category": "VARIABLE", - "value": "some example annotation", - "valueType": "xs:string", - "category": "PARAMETER", - "idShort": "ExampleProperty" - } - ], - "description": [ - { - "language": "en-us", - "text": "Example AnnotatedRelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel AnnotatedRelationshipElement Element" - } - ] - - }, - { - "modelType": "Operation", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Operations/ExampleOperation" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleOperation", - "inoutputVariables": [ - { - "value": - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "exampleValue", - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string", - "kind": "ConceptQualifier" - } - ], - "category": "CONSTANT", - "idShort": "ExampleProperty3", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - } - ], - "inputVariables": [ - { - "value": { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "exampleValue", - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string", - "kind": "ConceptQualifier" - } - ], - "category": "CONSTANT", - "idShort": "ExampleProperty1", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - ], - "outputVariables": [ - { - "value": - { - "modelType": "Property", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "exampleValue", - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string", - "kind": "ConceptQualifier" - } - ], - "category": "CONSTANT", - "idShort": "ExampleProperty2", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - } - ], - "description": [ - { - "language": "en-us", - "text": "Example Operation object" - }, - { - "language": "de", - "text": "Beispiel Operation Element" - } - ] - - }, - { - "modelType": "Capability", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Capabilities/ExampleCapability" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleCapability", - "description": [ - { - "language": "en-us", - "text": "Example Capability object" - }, - { - "language": "de", - "text": "Beispiel Capability Element" - } - ] - - }, - { - "modelType": "BasicEventElement", - "kind": "Instance", - - "observed": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementList", - "value": "ExampleSubmodelElementListOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Events/ExampleBasicEvent" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleBasicEvent", - "direction": "INPUT", - "state": "ON", - "description": [ - { - "language": "en-us", - "text": "Example BasicEvent object" - }, - { - "language": "de", - "text": "Beispiel BasicEvent Element" - } - ], - "direction": "INPUT", - "state": "ON" - }, - { - "kind": "Instance", - - "modelType": "SubmodelElementList", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleSubmodelElementListOrdered", - "orderRelevant": true, - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementListOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementListOrdered Element" - } - ], - "typeValueListElement": "SubmodelElement", - "value": [ - { - "modelType": "Property", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "exampleValue", - "valueType": "xs:string", - "qualifiers": [ - { - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string", - "kind": "ConceptQualifier" - } - ], - "category": "CONSTANT", - "idShort": "ExampleProperty", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - }, - { - "modelType": "MultiLanguageProperty", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "category": "CONSTANT", - "idShort": "ExampleMultiLanguageProperty", - "value": [ - { - "language": "en-us", - "text": "Example value of a MultiLanguageProperty element" - }, - { - "language": "de", - "text": "Beispielswert für ein MultiLanguageProperty-Element" - } - ], - "description": [ - { - "language": "en-us", - "text": "Example MultiLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MultiLanguageProperty Element" - } - ] - }, - { - "modelType": "Range", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "max": "100", - "min": "0", - "valueType": "xs:int", - "category": "PARAMETER", - "idShort": "ExampleRange", - "description": [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ] - - } - ] - }, - { - "modelType": "SubmodelElementCollection", - "kind": "Instance", - - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleSubmodelElementCollection", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollection object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollection Element" - } - ], - "value": [ - { - "modelType": "Blob", - "kind": "Instance", - - "contentType": "application/pdf", - "value": "AQIDBAU=", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Blobs/ExampleBlob" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleBlob", - "description": [ - { - "language": "en-us", - "text": "Example Blob object" - }, - { - "language": "de", - "text": "Beispiel Blob Element" - } - ] - - }, - { - "modelType": "File", - "kind": "Instance", - "contentType": "application/pdf", - "value": "file:///TestFile.pdf", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Files/ExampleFile" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleFile", - "description": [ - { - "language": "en-us", - "text": "Example File object" - }, - { - "language": "de", - "text": "Beispiel File Element" - } - ] - - }, - { - "modelType": "ReferenceElement", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleReferenceElement", - "value": { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelElementCollection" - }, - { - "type": "File", - "value": "ExampleFile" - } - ], - "type": "ModelReference" - }, - "description": [ - { - "language": "en-us", - "text": "Example Reference Element object" - }, - { - "language": "de", - "text": "Beispiel Reference Element Element" - } - ] - - } - ] - } - ], - "description": [ - { - "language": "en-us", - "text": "An example submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" - } - ] - - }, - { - "modelType": "Submodel", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_Submodel_Template", - "idShort": "TestSubmodelTemplate", - "submodelElements": [ - { - "modelType": "RelationshipElement", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleRelationshipElement", - "first": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Template" - }, - { - "type": "Operation", - "value": "ExampleOperation" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "second": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Template" - }, - { - "type": "Operation", - "value": "ExampleOperation" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "description": [ - { - "language": "en-us", - "text": "Example RelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel RelationshipElement Element" - } - ] - - }, - { - "modelType": "AnnotatedRelationshipElement", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleAnnotatedRelationshipElement", - "first": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Template" - }, - { - "type": "Operation", - "value": "ExampleOperation" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "second": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Template" - }, - { - "type": "Operation", - "value": "ExampleOperation" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "description": [ - { - "language": "en-us", - "text": "Example AnnotatedRelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel AnnotatedRelationshipElement Element" - } - ] - }, - { - "modelType": "Operation", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Operations/ExampleOperation" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleOperation", - "inoutputVariables": [ - { - "value": - { - "modelType": "Property", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - } - ], - "inputVariables": [ - { - "value": - { - "modelType": "Property", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - } - ], - "outputVariables": [ - { - "value": - { - "modelType": "Property", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - } - } - ], - "description": [ - { - "language": "en-us", - "text": "Example Operation object" - }, - { - "language": "de", - "text": "Beispiel Operation Element" - } - ] - - }, - { - "modelType": "Capability", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Capabilities/ExampleCapability" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleCapability", - "description": [ - { - "language": "en-us", - "text": "Example Capability object" - }, - { - "language": "de", - "text": "Beispiel Capability Element" - } - ] - - }, - { - "modelType": "BasicEventElement", - "observed": - { - "keys": [ - { - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Template" - }, - { - "type": "Operation", - "value": "ExampleOperation" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "ModelReference" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Events/ExampleBasicEvent" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleBasicEvent", - "direction": "OUTPUT", - "state": "OFF", - "description": [ - { - "language": "en-us", - "text": "Example BasicEvent object" - }, - { - "language": "de", - "text": "Beispiel BasicEvent Element" - } - ], - "direction": "OUTPUT", - "state": "OFF" - }, - { - "modelType": "SubmodelElementList", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementLists/ExampleSubmodelElementListOrdered" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleSubmodelElementListOrdered", - "orderRelevant": true, - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementListOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementListOrdered Element" - } - ], - "typeValueListElement": "SubmodelElement", - "value": [ - { - "modelType": "Property", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "CONSTANT", - "idShort": "ExampleProperty", - "description": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - - }, - { - "modelType": "MultiLanguageProperty", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "category": "CONSTANT", - "idShort": "ExampleMultiLanguageProperty", - "description": [ - { - "language": "en-us", - "text": "Example MultiLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MultiLanguageProperty Element" - } - ] - - }, - { - "modelType": "Range", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "max": "100", - "valueType": "xs:int", - "category": "PARAMETER", - "idShort": "ExampleRange", - "description": [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ] - - }, - { - "modelType": "Range", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "min": "0", - "valueType": "xs:int", - "category": "PARAMETER", - "idShort": "ExampleRange2", - "description": [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ] - - } - ] - }, - { - "modelType": "SubmodelElementCollection", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleSubmodelElementCollection", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollection object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollection Element" - } - ], - "value": [ - { - "modelType": "Blob", - "contentType": "application/pdf", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Blobs/ExampleBlob" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleBlob", - "description": [ - { - "language": "en-us", - "text": "Example Blob object" - }, - { - "language": "de", - "text": "Beispiel Blob Element" - } - ] - - }, - { - "modelType": "File", - "contentType": "application/pdf", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/Files/ExampleFile" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleFile", - "description": [ - { - "language": "en-us", - "text": "Example File object" - }, - { - "language": "de", - "text": "Beispiel File Element" - } - ] - - }, - { - "modelType": "ReferenceElement", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleReferenceElement", - "description": [ - { - "language": "en-us", - "text": "Example Reference Element object" - }, - { - "language": "de", - "text": "Beispiel Reference Element Element" - } - ] - - } - ] - }, - { - "modelType": "SubmodelElementCollection", - "kind": "Template", - "semanticId": - { - "keys": [ - { - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollection" - } - ], - "type": "GlobalReference" - }, - "category": "PARAMETER", - "idShort": "ExampleSubmodelElementCollection2", - "description": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollection object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollection Element" - } - ] - - } - ], - "description": [ - { - "language": "en-us", - "text": "An example submodel for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Teilmodell für eine Test-Anwendung" - } - ] - - } - ] -} diff --git a/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json b/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json deleted file mode 100644 index 16a24778e..000000000 --- a/dataformat-json/src/test/resources/test_demo_full_example_withEmbeddedConceptDescription.json +++ /dev/null @@ -1,3135 +0,0 @@ - -{ - "assetAdministrationShells": [ - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset" - } - ], - "type": "GlobalReference" - } - }, - "derivedFrom": - { - "keys": [ - { - "type": "AssetAdministrationShell", - "value": "https://acplt.org/TestAssetAdministrationShell2" - } - ], - "type": "GlobalReference" - }, - "submodels": [ - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/Identification" - } - ], - "type": "GlobalReference" - } - ], - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_AssetAdministrationShell", - "idShort": "TestAssetAdministrationShell", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - }, - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset_Mandatory" - } - ], - "type": "GlobalReference" - } - }, - "submodels": [ - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - } - ], - "type": "GlobalReference" - }, - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel2_Mandatory" - } - ], - "type": "GlobalReference" - } - ], - "id": "https://acplt.org/Test_AssetAdministrationShell_Mandatory", - "idShort": "Test_AssetAdministrationShell_Mandatory" - }, - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset_Mandatory" - } - ], - "type": "GlobalReference" - } - }, - "id": "https://acplt.org/Test_AssetAdministrationShell2_Mandatory", - "idShort": "Test_AssetAdministrationShell2_Mandatory" - }, - { - "modelType": "AssetAdministrationShell", - "assetInformation": - { - "assetKind": "Instance", - "globalAssetId": - { - "keys": [ - { - - "type": "AssetAdministrationShell", - "value": "https://acplt.org/Test_Asset_Missing" - } - ], - "type": "GlobalReference" - } - }, - "submodels": [ - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - } - ], - "type": "GlobalReference" - } - ], - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_AssetAdministrationShell_Missing", - "idShort": "TestAssetAdministrationShell", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - } - ], - "conceptDescriptions": [ - { - "modelType": "ConceptDescription", - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_ConceptDescription", - "idShort": "TestConceptDescription", - "isCaseOf": [ - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/DataSpecifications/ConceptDescriptions/TestConceptDescription" - } - ], - "type": "GlobalReference" - } - ], - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - }, - { - "modelType": "ConceptDescription", - "id": "https://acplt.org/Test_ConceptDescription_Mandatory", - "idShort": "Test_ConceptDescription_Mandatory" - }, - { - "modelType": "ConceptDescription", - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_ConceptDescription_Missing", - "idShort": "TestConceptDescription1", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - }, - { - "modelType": "ConceptDescription", - "embeddedDataSpecifications": [ - { - "dataSpecification": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/2/0" - } - ], - "type": "GlobalReference" - }, - "dataSpecificationContent": - { - "dataType": "RealMeasure", - "sourceOfDefinition": "http://acplt.org/DataSpec/ExampleDef", - "symbol": "SU", - "unit": "SpaceUnit", - "unitId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Units/SpaceUnit" - } - ], - "type": "GlobalReference" - }, - "value": "TEST", - "valueFormat": "xs:string", - "valueList": - { - "valueReferencePairTypes": [ - { - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - } - }, - { - "value": "http://acplt.org/ValueId/ExampleValueId2", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId2" - } - ], - "type": "GlobalReference" - } - } - ] - }, - "definition": [ - { - "language": "de", - "text": "Dies ist eine Data Specification für Testzwecke" - }, - { - "language": "en-us", - "text": "This is a DataSpecification for testing purposes" - } - ], - "levelType": ["Min", "Max"], - "preferredName": [ - { - "language": "de", - "text": "Test Specification" - }, - { - "language": "en-us", - "text": "TestSpecification" - } - ], - "shortNames": [ - { - "language": "de", - "text": "Test Spec" - }, - { - "language": "en-us", - "text": "TestSpec" - } - ] - } - } - ], - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "http://acplt.org/DataSpecifciations/Example/Identification", - "idShort": "TestSpec_01", - "isCaseOf": [ - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ReferenceElements/ConceptDescriptionX" - } - ], - "type": "GlobalReference" - } - ] - } - ], - "submodels": [ - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/AssetIdentification" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/Identification", - "idShort": "Identification", - "submodelElements": [ - { - "modelType": "Property", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "0173-1#02-AAO677#002" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ACPLT", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ACPLT" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "qualifiers": [ - { - "modelType": "Qualifier", - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "value": "100", - "valueType": "Int" - }, - { - "modelType": - { - "name": "Qualifier" - }, - "type": "http://acplt.org/Qualifier/ExampleQualifier2", - "value": "50", - "valueType": "Int" - } - ], - "idShort": "ManufacturerName", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - }, - { - "modelType": "Property", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "value": "978-8234-234-342", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "978-8234-234-342" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "idShort": "InstanceId", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - } - ], - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - }, - { - "modelType": "Submodel", - "kind": "Instance", - "semanticId": - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/SubmodelTemplates/BillOfMaterial" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "version": "0.9" - }, - "id": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial", - "idShort": "BillOfMaterial", - "submodelElements": [ - { - "modelType": "Entity", - "entityType": "CoManagedEntity", - "statements": [ - { - "modelType": "Property", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValue2", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValue2" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty2", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - }, - { - "modelType": "Property", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - ], - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "idShort": "ExampleEntity", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - }, - { - "modelType": - { - "name": "Entity" - }, - "entityType": "SelfManagedEntity", - "globalAssetId": - { - "keys": [ - { - - "type": "Asset", - "value": "https://acplt.org/Test_Asset2" - } - ], - "type": "GlobalReference" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://opcfoundation.org/UA/DI/1.1/DeviceType/Serialnumber" - } - ], - "type": "GlobalReference" - }, - "idShort": "ExampleEntity2", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Legally valid designation of the natural or judicial person which is directly responsible for the design, production, packaging and labeling of a product in respect to its being brought into circulation." - }, - { - "language": "de", - "text": "Bezeichnung für eine natürliche oder juristische Person, die für die Auslegung, Herstellung und Verpackung sowie die Etikettierung eines Produkts im Hinblick auf das 'Inverkehrbringen' im eigenen Namen verantwortlich ist" - } - ] - } - } - ], - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - }, - { - "modelType": - { - "name": "Submodel" - }, - "kind": "Instance", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_Submodel", - "idShort": "TestSubmodel", - "submodelElements": [ - { - "modelType": - { - "name": "RelationshipElement" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleRelationshipElement", - "first": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "second": - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - }, - { - "type": "Entity", - "value": "ExampleEntity" - }, - { - "type": "Property", - "value": "ExampleProperty2" - } - ], - "type": "GlobalReference" - }, -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example RelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel RelationshipElement Element" - } - ] - } - }, - { - "modelType": - { - "name": "AnnotatedRelationshipElement" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleAnnotatedRelationshipElement", - "first": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "second": - { - "keys": [ - { - - "type": "Submodel", - "value": "http://acplt.org/Submodels/Assets/TestAsset/BillOfMaterial" - }, - { - "type": "Entity", - "value": "ExampleEntity" - }, - { - "type": "Property", - "value": "ExampleProperty2" - } - ], - "type": "GlobalReference" - }, - "annotation": [ - { - "modelType": - { - "name": "Property" - }, - "kind": "Instance", - "value": "some example annotation", - "valueType": "xs:string", - "category": "Parameter", - "idShort": "ExampleProperty3" - } - ], -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example AnnotatedRelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel AnnotatedRelationshipElement Element" - } - ] - } - }, - { - "modelType": - { - "name": "Operation" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Operations/ExampleOperation" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleOperation", - "inoutputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty3", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], - "inputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty1", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], - "outputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty2", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Operation object" - }, - { - "language": "de", - "text": "Beispiel Operation Element" - } - ] - } - }, - { - "modelType": - { - "name": "Capability" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Capabilities/ExampleCapability" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleCapability", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Capability object" - }, - { - "language": "de", - "text": "Beispiel Capability Element" - } - ] - } - }, - { - "modelType": - { - "name": "BasicEventElement" - }, - "observed": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Events/ExampleBasicEvent" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleBasicEvent", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example BasicEvent object" - }, - { - "language": "de", - "text": "Beispiel BasicEvent Element" - } - ] - } - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleSubmodelCollectionOrdered", - "ordered": true, - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollectionOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollectionOrdered Element" - } - ] - }, - "value": [ - { - "modelType": - { - "name": "Property" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "http://acplt.org/ValueId/ExampleValueId", - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleValueId" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - }, - { - "modelType": - { - "name": "MultiLanguageProperty" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "valueId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ValueId/ExampleMultiLanguageValueId" - } - ], - "type": "GlobalReference" - }, - "category": "Constant", - "idShort": "ExampleMultiLanguageProperty", - "value": [ - { - "language": "en-us", - "text": "Example value of a MultiLanguageProperty element" - }, - { - "language": "de", - "text": "Beispielswert für ein MulitLanguageProperty-Element" - } - ], - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example MulitLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MulitLanguageProperty Element" - } - ] - } - }, - { - "modelType": - { - "name": "Range" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "max": "100", - "min": "0", - "valueType": "Int", - "category": "Parameter", - "idShort": "ExampleRange", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ] - } - } - ] - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleSubmodelCollectionUnordered", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollectionUnordered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollectionUnordered Element" - } - ] - }, - "value": [ - { - "modelType": - { - "name": "Blob" - }, - "mimeType": "application/pdf", - "value": "AQIDBAU=", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Blobs/ExampleBlob" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleBlob", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Blob object" - }, - { - "language": "de", - "text": "Beispiel Blob Element" - } - ] - } - }, - { - "modelType": - { - "name": "File" - }, - "mimeType": "application/pdf", - "value": "/TestFile.pdf", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Files/ExampleFile" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleFile", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example File object" - }, - { - "language": "de", - "text": "Beispiel File Element" - } - ] - } - }, - { - "modelType": - { - "name": "ReferenceElement" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleReferenceElement", - "value": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel" - }, - { - "idType": "IdShort", - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "idType": "IdShort", - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Reference Element object" - }, - { - "language": "de", - "text": "Beispiel Reference Element Element" - } - ] - } - } - ] - } - ], - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - }, - { - "modelType": - { - "name": "Submodel" - }, - "kind": "Template", - "id": "https://acplt.org/Test_Submodel_Mandatory", - "idShort": "Test_Submodel_Mandatory", - "submodelElements": [ - { - "modelType": - { - "name": "RelationshipElement" - }, - "idShort": "ExampleRelationshipElement", - "first": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "second": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "MultiLanguageProperty", - "value": "ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - } - }, - { - "modelType": - { - "name": "AnnotatedRelationshipElement" - }, - "idShort": "ExampleAnnotatedRelationshipElement", - "first": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "second": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "MultiLanguageProperty", - "value": "ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - } - }, - { - "modelType": - { - "name": "Operation" - }, - "kind": "Template", - "idShort": "ExampleOperation" - }, - { - "modelType": - { - "name": "Capability" - }, - "idShort": "ExampleCapability" - }, - { - "modelType": - { - "name": "BasicEventElement" - }, - "observed": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Mandatory" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "idShort": "ExampleBasicEvent" - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "idShort": "ExampleSubmodelCollectionOrdered", - "ordered": true, - "value": [ - { - "modelType": - { - "name": "Property" - }, - "valueType": "xs:string", - "idShort": "ExampleProperty" - }, - { - "modelType": - { - "name": "MultiLanguageProperty" - }, - "idShort": "ExampleMultiLanguageProperty" - }, - { - "modelType": - { - "name": "Range" - }, - "valueType": "Int", - "idShort": "ExampleRange" - } - ] - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "idShort": "ExampleSubmodelCollectionUnordered", - "value": [ - { - "modelType": - { - "name": "Blob" - }, - "mimeType": "application/pdf", - "idShort": "ExampleBlob" - }, - { - "modelType": - { - "name": "File" - }, - "mimeType": "application/pdf", - "idShort": "ExampleFile" - }, - { - "modelType": - { - "name": "ReferenceElement" - }, - "idShort": "ExampleReferenceElement" - } - ] - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "idShort": "ExampleSubmodelCollectionUnordered2" - } - ] - }, - { - "modelType": - { - "name": "Submodel" - }, - "kind": "Instance", - "id": "https://acplt.org/Test_Submodel2_Mandatory", - "idShort": "Test_Submodel2_Mandatory" - }, - { - "modelType": - { - "name": "Submodel" - }, - "kind": "Instance", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_Submodel_Missing", - "idShort": "TestSubmodel", - "submodelElements": [ - { - "modelType": - { - "name": "RelationshipElement" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleRelationshipElement", - "first": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "second": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "MultiLanguageProperty", - "value": "ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example RelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel RelationshipElement Element" - } - ] - } - }, - { - "modelType": - { - "name": "AnnotatedRelationshipElement" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleAnnotatedRelationshipElement", - "first": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "second": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "MultiLanguageProperty", - "value": "ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "annotation": [ - { - "modelType": - { - "name": "Property" - }, - "kind": "Instance", - "value": "some example annotation", - "valueType": "xs:string", - "category": "Parameter", - "idShort": "ExampleProperty" - } - ], -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example AnnotatedRelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel AnnotatedRelationshipElement Element" - } - ] - } - }, - { - "modelType": - { - "name": "Operation" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Operations/ExampleOperation" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleOperation", - "inoutputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "exampleValue", - "valueType": "xs:string", - "qualifiers": [ - { - "modelType": - { - "name": "Qualifier" - }, - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string" - } - ], - "category": "Constant", - "idShort": "ExampleProperty3", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], - "inputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "exampleValue", - "valueType": "xs:string", - "qualifiers": [ - { - "modelType": - { - "name": "Qualifier" - }, - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string" - } - ], - "category": "Constant", - "idShort": "ExampleProperty1", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], - "outputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "exampleValue", - "valueType": "xs:string", - "qualifiers": [ - { - "modelType": - { - "name": "Qualifier" - }, - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string" - } - ], - "category": "Constant", - "idShort": "ExampleProperty2", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Operation object" - }, - { - "language": "de", - "text": "Beispiel Operation Element" - } - ] - } - }, - { - "modelType": - { - "name": "Capability" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Capabilities/ExampleCapability" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleCapability", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Capability object" - }, - { - "language": "de", - "text": "Beispiel Capability Element" - } - ] - } - }, - { - "modelType": - { - "name": "BasicEventElement" - }, - "observed": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Events/ExampleBasicEvent" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleBasicEvent", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example BasicEvent object" - }, - { - "language": "de", - "text": "Beispiel BasicEvent Element" - } - ] - } - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleSubmodelCollectionOrdered", - "ordered": true, - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollectionOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollectionOrdered Element" - } - ] - }, - "value": [ - { - "modelType": - { - "name": "Property" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "value": "exampleValue", - "valueType": "xs:string", - "qualifiers": [ - { - "modelType": - { - "name": "Qualifier" - }, - "type": "http://acplt.org/Qualifier/ExampleQualifier", - "valueType": "xs:string" - } - ], - "category": "Constant", - "idShort": "ExampleProperty", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - }, - { - "modelType": - { - "name": "MultiLanguageProperty" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "category": "Constant", - "idShort": "ExampleMultiLanguageProperty", - "value": [ - { - "language": "en-us", - "text": "Example value of a MultiLanguageProperty element" - }, - { - "language": "de", - "text": "Beispielswert für ein MulitLanguageProperty-Element" - } - ], - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example MulitLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MulitLanguageProperty Element" - } - ] - } - }, - { - "modelType": - { - "name": "Range" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "max": "100", - "min": "0", - "valueType": "Int", - "category": "Parameter", - "idShort": "ExampleRange", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ] - } - } - ] - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleSubmodelCollectionUnordered", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollectionUnordered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollectionUnordered Element" - } - ] - }, - "value": [ - { - "modelType": - { - "name": "Blob" - }, - "mimeType": "application/pdf", - "value": "AQIDBAU=", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Blobs/ExampleBlob" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleBlob", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Blob object" - }, - { - "language": "de", - "text": "Beispiel Blob Element" - } - ] - } - }, - { - "modelType": - { - "name": "File" - }, - "mimeType": "application/pdf", - "value": "/TestFile.pdf", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Files/ExampleFile" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleFile", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example File object" - }, - { - "language": "de", - "text": "Beispiel File Element" - } - ] - } - }, - { - "modelType": - { - "name": "ReferenceElement" - }, - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleReferenceElement", - "value": - { - "keys": [ - { - - "type": "Submodel", - "value": "https://acplt.org/Test_Submodel_Missing" - }, - { - "idType": "IdShort", - "type": "SubmodelElementCollection", - "value": "ExampleSubmodelCollectionOrdered" - }, - { - "idType": "IdShort", - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Reference Element object" - }, - { - "language": "de", - "text": "Beispiel Reference Element Element" - } - ] - } - } - ] - } - ], - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - }, - { - "modelType": - { - "name": "Submodel" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelTemplates/ExampleSubmodel" - } - ], - "type": "GlobalReference" - }, - "administration": - { - "revision": "0", - "version": "0.9" - }, - "id": "https://acplt.org/Test_Submodel_Template", - "idShort": "TestSubmodel", - "submodelElements": [ - { - "modelType": - { - "name": "RelationshipElement" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleRelationshipElement", - "first": - { - "keys": [ - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "second": - { - "keys": [ - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example RelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel RelationshipElement Element" - } - ] - } - }, - { - "modelType": - { - "name": "AnnotatedRelationshipElement" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/RelationshipElements/ExampleAnnotatedRelationshipElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleAnnotatedRelationshipElement", - "first": - { - "keys": [ - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "second": - { - "keys": [ - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example AnnotatedRelationshipElement object" - }, - { - "language": "de", - "text": "Beispiel AnnotatedRelationshipElement Element" - } - ] - } - }, - { - "modelType": - { - "name": "Operation" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Operations/ExampleOperation" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleOperation", - "inoutputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], - "inputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], - "outputVariable": [ - { - "value": - { - "modelType": - { - "name": "Property" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - } - } - ], -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Operation object" - }, - { - "language": "de", - "text": "Beispiel Operation Element" - } - ] - } - }, - { - "modelType": - { - "name": "Capability" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Capabilities/ExampleCapability" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleCapability", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Capability object" - }, - { - "language": "de", - "text": "Beispiel Capability Element" - } - ] - } - }, - { - "modelType": - { - "name": "BasicEventElement" - }, - "observed": - { - "keys": [ - { - "type": "Property", - "value": "ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Events/ExampleBasicEvent" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleBasicEvent", -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example BasicEvent object" - }, - { - "language": "de", - "text": "Beispiel BasicEvent Element" - } - ] - } - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionOrdered" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleSubmodelCollectionOrdered", - "ordered": true, -"description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollectionOrdered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollectionOrdered Element" - } - ] - }, - "value": [ - { - "modelType": - { - "name": "Property" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Properties/ExampleProperty" - } - ], - "type": "GlobalReference" - }, - "valueType": "xs:string", - "category": "Constant", - "idShort": "ExampleProperty", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Property object" - }, - { - "language": "de", - "text": "Beispiel Property Element" - } - ] - } - }, - { - "modelType": - { - "name": "MultiLanguageProperty" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/MultiLanguageProperties/ExampleMultiLanguageProperty" - } - ], - "type": "GlobalReference" - }, - "category": "Constant", - "idShort": "ExampleMultiLanguageProperty", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example MulitLanguageProperty object" - }, - { - "language": "de", - "text": "Beispiel MulitLanguageProperty Element" - } - ] - } - }, - { - "modelType": - { - "name": "Range" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "max": "100", - "valueType": "Int", - "category": "Parameter", - "idShort": "ExampleRange", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ] - } - }, - { - "modelType": - { - "name": "Range" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Ranges/ExampleRange" - } - ], - "type": "GlobalReference" - }, - "min": "0", - "valueType": "Int", - "category": "Parameter", - "idShort": "ExampleRange2", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Range object" - }, - { - "language": "de", - "text": "Beispiel Range Element" - } - ] - } - } - ] - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleSubmodelCollectionUnordered", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollectionUnordered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollectionUnordered Element" - } - ] - }, - "value": [ - { - "modelType": - { - "name": "Blob" - }, - "mimeType": "application/pdf", - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Blobs/ExampleBlob" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleBlob", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Blob object" - }, - { - "language": "de", - "text": "Beispiel Blob Element" - } - ] - } - }, - { - "modelType": - { - "name": "File" - }, - "mimeType": "application/pdf", - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/Files/ExampleFile" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleFile", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example File object" - }, - { - "language": "de", - "text": "Beispiel File Element" - } - ] - } - }, - { - "modelType": - { - "name": "ReferenceElement" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/ReferenceElements/ExampleReferenceElement" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleReferenceElement", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example Reference Element object" - }, - { - "language": "de", - "text": "Beispiel Reference Element Element" - } - ] - } - } - ] - }, - { - "modelType": - { - "name": "SubmodelElementCollection" - }, - "kind": "Template", - "semanticId": - { - "keys": [ - { - - "type": "GlobalReference", - "value": "http://acplt.org/SubmodelElementCollections/ExampleSubmodelElementCollectionUnordered" - } - ], - "type": "GlobalReference" - }, - "category": "Parameter", - "idShort": "ExampleSubmodelCollectionUnordered2", - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "Example SubmodelElementCollectionUnordered object" - }, - { - "language": "de", - "text": "Beispiel SubmodelElementCollectionUnordered Element" - } - ] - } - } - ], - "description": { - "langStrings": [ - { - "language": "en-us", - "text": "An Example Asset Administration Shell for the test application" - }, - { - "language": "de", - "text": "Ein Beispiel-Verwaltungsschale für eine Test-Anwendung" - } - ] - } - } - ] -} diff --git a/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml b/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml deleted file mode 100644 index 4d4a18d3d..000000000 --- a/dataformat-xml/src/test/resources/Example_AAS_ServoDCMotor - Simplified V2.0.xml +++ /dev/null @@ -1,436 +0,0 @@ - - - - - ExampleMotor - - http://customer.com/aas/9175_7013_7091_9168 - - - Instance - - GlobalReference - - - AssetAdministrationShell - http://customer.com/assets/KHBVZJSQKIY - - - - - - - GlobalReference - - - Submodel - http://i40.customer.com/instance/1/1/AC69B1CB44F07935 - - - - - GlobalReference - - - Submodel - http://i40.customer.com/type/1/1/1A7B62B529F19152 - - - - - GlobalReference - - - Submodel - http://i40.customer.com/type/1/1/7A7104BDAB57E184 - - - - - - - - - Documentation - - http://i40.customer.com/type/1/1/1A7B62B529F19152 - - Instance - - - OperatingManual - Instance - - GlobalReference - - - ConceptDescription - http://www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document - - - - - - Parameter - DigitalFile_PDF - Instance - - GlobalReference - - - ConceptDescription - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile - - - - file:///aasx/OperatingManual.pdf - application/pdf - - - Title - Instance - - GlobalReference - - - ConceptDescription - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title - - - - - - en - Operating Manual - - - - - - - - - TechnicalData - - http://i40.customer.com/type/1/1/7A7104BDAB57E184 - - Instance - - GlobalReference - - - ConceptDescription - 0173-1#01-AFZ615#016 - - - - - - Parameter - MaxRotationSpeed - Instance - - GlobalReference - - - ConceptDescription - 0173-1#02-BAA120#008 - - - - xs:int - 5000 - - - - - OperationalData - - http://i40.customer.com/instance/1/1/AC69B1CB44F07935 - - Instance - - - Variable - RotationSpeed - Instance - - GlobalReference - - - ConceptDescription - http://customer.com/cd/1/1/18EBD56F6B43D895 - - - - xs:int - 4370 - - - - - - - MaxRotationSpeed - - 2 - 0 - - - 0173-1#02-BAA120#008 - - - - - GlobalReference - - - ConceptDescription - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas - - - - - - - - de - max. Drehzahl - - - en - Max. rotation speed - - - - 1/min - - - GlobalReference - - - ConceptDescription - 0173-1#05-AAA650#002 - - - - REAL_MEASURE - - - de - Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf - - - en - Greatest permissible rotation speed with which the motor or feeding unit may be operated - - - - - - - - - - Title - - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title - - - - - GlobalReference - - - ConceptDescription - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - - - de - Titel - - - en - Title - - - - - de - Titel - - - STRING_TRANSLATABLE - - - de - Sprachabhängiger Titel des Dokuments. - - - - - - - - - RotationSpeed - - http://customer.com/cd/1/1/18EBD56F6B43D895 - - - - - GlobalReference - - - ConceptDescription - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas - - - - - - - - de - Aktuelle Drehzahl - - - en - Actual rotation speed - - - - - en - RotationSpeed - - - - 1/min - - - GlobalReference - - - ConceptDescription - 0173-1#05-AAA650#002 - - - - REAL_MEASURE - - - de - Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird - - - en - Actual rotation speed with which the motor or feeding unit is operated - - - - - - - - - Document - - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Document - - - - - GlobalReference - - - ConceptDescription - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas - - - - - - - - de - Dokument - - - en - Document - - - - - en - Document - - - - [ISO 15519-1:2010] - - IRI - - - de - Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - - - - - - - - - DigitalFile - - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile - - - - - GlobalReference - - - ConceptDescription - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationaas - - - - - - - - de - Digitale Datei - - - - - de - digitale Datei - - - IRI - - - de - Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden. - - - - - - - - - \ No newline at end of file diff --git a/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml b/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml deleted file mode 100644 index ba39af8bd..000000000 --- a/dataformat-xml/src/test/resources/ServoDCMotor_invalid_V2.0.xml +++ /dev/null @@ -1,469 +0,0 @@ - - - - - - ExampleMotor - - CONSTANT - - http://customer.com/aas/9175_7013_7091_9168 - - - - - http://customer.com/assets/KHBVZJSQKIY - - - - - - - - - http://i40.customer.com/instance/1/1/AC69B1CB44F07935 - - - - - - - http://i40.customer.com/type/1/1/1A7B62B529F19152 - - - - - - - http://i40.customer.com/type/1/1/7A7104BDAB57E184 - - - - - - - - - - Documentation - - - CONSTANT - - - http://i40.customer.com/type/1/1/1A7B62B529F19152 - - Instance - - - - - - OperatingManual - - Instance - - - - www.vdi2770.com/blatt1/Entwurf/Okt18/cd/Document - - - - - - - - DigitalFile_PDF - - - PARAMETER - - Instance - - - - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile - - - - - application/pdf - - - /aasx/OperatingManual.pdf - - - - - - - Title - - Instance - - - - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title - - - - - - Operating Manual - - - - - - false - false - - - - - - - TechnicalData - - - CONSTANT - - - http://i40.customer.com/type/1/1/7A7104BDAB57E184 - - Instance - - - - 0173-1#01-AFZ615#016 - - - - - - - - MaxRotationSpeed - - - PARAMETER - - Instance - - - - 0173-1#02-BAA120#008 - - - - - integer - - - 5000 - - - - - - - - - OperationalData - - - VARIABLE - - - http://i40.customer.com/instance/1/1/AC69B1CB44F07935 - - - Instance - - - - - - - - RotationSpeed - - - VARIABLE - - Instance - - - - http://customer.com/cd/1/1/18EBD56F6B43D895 - - - - - - - - - - integer - - - 4370 - - - - - - - - - - - MaxRotationSpeed - - PROPERTY - - 0173-1#02-BAA120#008 - - - 2 - 0 - - - - - REAL_MEASURE - - - Höchste zulässige Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben werden darf - - - Greatest permissible rotation speed with which the motor or feeding unit may be operated - - - - - max. Drehzahl - - - Max. rotation speed - - - - - - - - 1/min - - - - - 0173-1#05-AAA650#002 - - - - - - - - - - - - - Title - - PROPERTY - - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Description/Title - - - - - STRING_TRANSLATABLE - - - Sprachabhängiger Titel des Dokuments. - - - - - Titel - - - Title - - - - - Titel - - - - - - - - - - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - - - RotationSpeed - - PROPERTY - - http://customer.com/cd/1/1/18EBD56F6B43D895 - - - - - - REAL_MEASURE - - - Aktuelle Drehzahl, mit welcher der Motor oder die Speiseinheit betrieben wird - - - Actual rotation speed with which the motor or feeding unit is operated - - - - - Aktuelle Drehzahl - - - Actual rotation speed - - - - - RotationSpeed - - - - - 1/min - - - - - 0173-1#05-AAA650#002 - - - - - - - - - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - - - Document - - - COLLECTION - - - - - - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/Document - - - - - URL - - - Feste und geordnete Menge von für die Verwendung durch Personen bestimmte Informationen, die verwaltet und als Einheit zwischen Benutzern und System ausgetauscht werden kann. - - - - - Dokument - - - Document - - - - - Document - - - - [ISO 15519-1:2010] - - - - - - - - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - - - - DigitalFile - - - DOCUMENT - - - http://vdi2770.com/blatt1/Entwurf/Okt18/cd/StoredDocumentRepresentation/DigitalFile - - - - - URL - - - Eine Datei, die die DocumentVersion repräsentiert. Neben der obligatorischen PDF/A Datei können weitere Dateien angegeben werden. - - - - - Digitale Datei - - - - - digitale Datei - - - - - - - - - - http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360 - - - - - - - From e6d0f85d3dc108eb4c383af974ec04642b0fa066 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:33:56 +0100 Subject: [PATCH 05/73] Bump org.apache.maven.plugins:maven-project-info-reports-plugin (#206) Bumps [org.apache.maven.plugins:maven-project-info-reports-plugin](https://github.com/apache/maven-project-info-reports-plugin) from 3.4.5 to 3.5.0. - [Commits](https://github.com/apache/maven-project-info-reports-plugin/compare/maven-project-info-reports-plugin-3.4.5...maven-project-info-reports-plugin-3.5.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-project-info-reports-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- model/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/pom.xml b/model/pom.xml index adf5b86a5..2236bd2f1 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -21,7 +21,7 @@ 1.8 1.5.0 3.6.2 - 3.4.5 + 3.5.0 0xDFCC34A6 diff --git a/pom.xml b/pom.xml index 714020ecc..2743e4799 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 3.0.1 3.3.0 3.6.2 - 3.4.5 + 3.5.0 3.3.0 0.8.11 4.8.164 From 2313f790910026cae53f1d5a56d38ab1c65ac8a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:34:02 +0100 Subject: [PATCH 06/73] Bump io.github.classgraph:classgraph from 4.8.164 to 4.8.165 (#204) Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.164 to 4.8.165. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](https://github.com/classgraph/classgraph/compare/classgraph-4.8.164...classgraph-4.8.165) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2743e4799..018e7e8d2 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 3.5.0 3.3.0 0.8.11 - 4.8.164 + 4.8.165 1.15 2.15.0 1.25.0 From 845e2fab0aedc0d251c364cda1458c42ca5f0ad1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Nov 2023 15:34:09 +0100 Subject: [PATCH 07/73] Bump jackson.version from 2.15.3 to 2.16.0 (#199) Bumps `jackson.version` from 2.15.3 to 2.16.0. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.15.3 to 2.16.0 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-core` from 2.15.3 to 2.16.0 - [Release notes](https://github.com/FasterXML/jackson-core/releases) - [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.15.3...jackson-core-2.16.0) Updates `com.fasterxml.jackson.core:jackson-annotations` from 2.15.3 to 2.16.0 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.dataformat:jackson-dataformat-xml` from 2.15.3 to 2.16.0 - [Commits](https://github.com/FasterXML/jackson-dataformat-xml/compare/jackson-dataformat-xml-2.15.3...jackson-dataformat-xml-2.16.0) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.core:jackson-core dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-type: direct:production update-type: version-update:semver-minor - dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-xml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 018e7e8d2..e29823f70 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 32.1.3-jre 5.0.1 2.2 - 2.15.3 + 2.16.0 2.0.1.Final 2.3.1 2.1.0 From beb0303ac8991eea7234d528a21355370cf2b2d9 Mon Sep 17 00:00:00 2001 From: Frank Schnicke Date: Tue, 21 Nov 2023 16:04:16 +0100 Subject: [PATCH 08/73] Updates version to 1.0.0-milestone-04 Signed-off-by: Frank Schnicke --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index e29823f70..a79ea2149 100644 --- a/pom.xml +++ b/pom.xml @@ -40,9 +40,9 @@ 1 0 0 - -SNAPSHOT + -milestone-04 ${revision.major}.${revision.minor}.${revision.patch}${revision.suffix} - 1.0.0-SNAPSHOT + 1.0.0-milestone-04 UTF-8 UTF-8 From e95d27b70ebddb4fb7ba308d4ca4b92869fe0821 Mon Sep 17 00:00:00 2001 From: Frank Schnicke Date: Wed, 22 Nov 2023 07:39:54 +0100 Subject: [PATCH 09/73] Removes obsolete key name Signed-off-by: Frank Schnicke --- model/pom.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/model/pom.xml b/model/pom.xml index 2236bd2f1..c33c7f90c 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -22,7 +22,6 @@ 1.5.0 3.6.2 3.5.0 - 0xDFCC34A6 From 46483e260082cc437e341988a820cbc1961ce366 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Nov 2023 10:56:48 +0000 Subject: [PATCH 10/73] Bump org.apache.commons:commons-lang3 from 3.13.0 to 3.14.0 Bumps org.apache.commons:commons-lang3 from 3.13.0 to 3.14.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-lang3 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a79ea2149..88cdf56d3 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 1.15 2.15.0 1.25.0 - 3.13.0 + 3.14.0 32.1.3-jre 5.0.1 2.2 From e0f5eccda0ab157ad6a9b5a7c35a7242e59d0c90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 10:45:49 +0000 Subject: [PATCH 11/73] Bump org.apache.poi:poi-ooxml from 5.2.4 to 5.2.5 Bumps org.apache.poi:poi-ooxml from 5.2.4 to 5.2.5. --- updated-dependencies: - dependency-name: org.apache.poi:poi-ooxml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 88cdf56d3..4e4fce269 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 4.13.2 1.1.1 2.7.8 - 5.2.4 + 5.2.5 2.0.9 1.3.2 4.4.1 From ff9af0b6cd872121672b3df65b949acb60fd9a79 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:14:43 +0000 Subject: [PATCH 12/73] Bump actions/setup-java from 3 to 4 Bumps [actions/setup-java](https://github.com/actions/setup-java) from 3 to 4. - [Release notes](https://github.com/actions/setup-java/releases) - [Commits](https://github.com/actions/setup-java/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-java dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/maven-deploy-to-maven-central.yml | 2 +- .github/workflows/maven-publish-snapshots.yml | 2 +- .github/workflows/maven-run-tests.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/maven-deploy-to-maven-central.yml b/.github/workflows/maven-deploy-to-maven-central.yml index 695ade856..11e4dd0dc 100644 --- a/.github/workflows/maven-deploy-to-maven-central.yml +++ b/.github/workflows/maven-deploy-to-maven-central.yml @@ -16,7 +16,7 @@ jobs: - uses: actions/checkout@v4 - name: Set up JDK 1.8 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 11 distribution: 'adopt' diff --git a/.github/workflows/maven-publish-snapshots.yml b/.github/workflows/maven-publish-snapshots.yml index 89d78c646..97274da10 100644 --- a/.github/workflows/maven-publish-snapshots.yml +++ b/.github/workflows/maven-publish-snapshots.yml @@ -19,7 +19,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'adopt' diff --git a/.github/workflows/maven-run-tests.yml b/.github/workflows/maven-run-tests.yml index 107b154c4..43724271d 100644 --- a/.github/workflows/maven-run-tests.yml +++ b/.github/workflows/maven-run-tests.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set up JDK 11 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '11' distribution: 'adopt' From c8530d72c5d7bab37235c3478d043db1ab0cbd35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Nov 2023 10:58:49 +0000 Subject: [PATCH 13/73] Bump commons-io:commons-io from 2.15.0 to 2.15.1 Bumps commons-io:commons-io from 2.15.0 to 2.15.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 88cdf56d3..9d62b3cbc 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 0.8.11 4.8.165 1.15 - 2.15.0 + 2.15.1 1.25.0 3.14.0 32.1.3-jre From df597678167055addf33e1d1ed97246161e90172 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 10:52:06 +0000 Subject: [PATCH 14/73] Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.6.2 to 3.6.3 Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.2 to 3.6.3. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.2...maven-javadoc-plugin-3.6.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- model/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/pom.xml b/model/pom.xml index c33c7f90c..262b6ef46 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -20,7 +20,7 @@ 1.8 1.8 1.5.0 - 3.6.2 + 3.6.3 3.5.0 diff --git a/pom.xml b/pom.xml index 9d62b3cbc..e23c1ae62 100644 --- a/pom.xml +++ b/pom.xml @@ -52,7 +52,7 @@ 1.5.0 3.0.1 3.3.0 - 3.6.2 + 3.6.3 3.5.0 3.3.0 0.8.11 From 3ac51014a69281afa7648aec4afd4a353ab71e81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 10:52:18 +0000 Subject: [PATCH 15/73] Bump org.mockito:mockito-core from 5.7.0 to 5.8.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.7.0 to 5.8.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.7.0...v5.8.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9d62b3cbc..1bc59cbf3 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 4.4.1 2.12.1 2.9.1 - 5.7.0 + 5.8.0 0.0.20131108.vaadin1 From f1bdbabcb7b22bf68fdbd82b4421681dfd52c699 Mon Sep 17 00:00:00 2001 From: sebbader-sap <107036549+sebbader-sap@users.noreply.github.com> Date: Tue, 5 Dec 2023 16:14:35 +0100 Subject: [PATCH 16/73] Adding CustomDataspecification Feature and UnitTests (#207) * add custom dataspecification * add successful json test * start xml test * fix dataspecification behavior for xml * move CustomDataSpecification into model * reuse same environment for JSON and XML tests * rename DataSpecification to DummyDataSpecfication --- .../aas4j/v3/dataformat/core/Examples.java | 61 +++++++++++++ .../model/DefaultDummyDataSpecification.java | 89 +++++++++++++++++++ .../v3/model/DummyDataSpecification.java | 37 ++++++++ .../model/DummyDataSpecificationBuilder.java | 42 +++++++++ .../dataformat/json/JsonSerializerTest.java | 33 +++++++ ...mbeddedDataSpecificationsDeserializer.java | 36 +++++--- .../EmbeddedDataSpecificationSerializer.java | 19 ++-- .../v3/dataformat/xml/XmlSerializerTest.java | 31 +++++++ .../v3/model/CustomDataSpecification.java | 24 +++++ .../v3/model/DataSpecificationContent.java | 3 +- 10 files changed, 356 insertions(+), 19 deletions(-) create mode 100644 dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DefaultDummyDataSpecification.java create mode 100644 dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DummyDataSpecification.java create mode 100644 dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DummyDataSpecificationBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CustomDataSpecification.java diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java index d8bc3ef3b..4a0fc95f8 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java @@ -17,15 +17,23 @@ import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; public class Examples { @@ -77,4 +85,57 @@ public class Examples { .build()) .build()) .build(); + + + public static final Environment ENVIRONMENT_WITH_DUMMYDATASPEC = new DefaultEnvironment.Builder() + .submodels( + new DefaultSubmodel.Builder() + .id("urn:test") + .submodelElements(new DefaultFile.Builder() + .idShort("myIdShort").value("FileValue") + .build()) + .embeddedDataSpecifications( + new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent( + new DefaultDummyDataSpecification.Builder() + .name(new DefaultLangStringNameType.Builder() + .language("en").text("myName").build()) + .text("myText") + .pages(42) + .build()) + .dataSpecification( + new DefaultReference.Builder() + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys( + new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("https://admin-shell.io/aas/3/0/CustomDataSpecification") + .build() + ) + .build() + ) + .build()) + .embeddedDataSpecifications( + new DefaultEmbeddedDataSpecification.Builder().dataSpecificationContent( + new DefaultDataSpecificationIec61360.Builder() + .dataType(DataTypeIec61360.BLOB) + .definition(new DefaultLangStringDefinitionTypeIec61360.Builder() + .language("en").text("myDefinition") + .build()) + .build() + ) + .dataSpecification( + new DefaultReference.Builder() + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys( + new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360") + .build() + ) + .build() + ) + .build()) + .build() + ).build(); } diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DefaultDummyDataSpecification.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DefaultDummyDataSpecification.java new file mode 100644 index 000000000..8bd13c738 --- /dev/null +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DefaultDummyDataSpecification.java @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import java.util.Objects; + +/** + * This interface is needed to test the serialization/deserialization of a custom data specification content. + * See: https://github.com/eclipse-aas4j/aas4j/issues/196 + */ +public class DefaultDummyDataSpecification implements DummyDataSpecification { + private LangStringNameType name; + private String text; + private int pages; + + public LangStringNameType getName() { + return name; + } + + public void setName(LangStringNameType name) { + this.name = name; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + + public int getPages() { + return pages; + }; + public void setPages(int pages) { + this.pages = pages; + } + + @Override + public int hashCode() { + return Objects.hash(this.name, this.text, this.pages); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultDummyDataSpecification other = (DefaultDummyDataSpecification) obj; + return Objects.equals(this.name, other.name) && + Objects.equals(this.text, other.text) && + Objects.equals(this.pages, other.pages); + } + } + + /** + * This builder class can be used to construct a DefaultCustomDataSpecificationContent. + */ + public static class Builder extends DummyDataSpecificationBuilder { + + @Override + protected DefaultDummyDataSpecification.Builder getSelf() { + return this; + } + + @Override + protected DefaultDummyDataSpecification newBuildingInstance() { + return new DefaultDummyDataSpecification(); + } + } +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DummyDataSpecification.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DummyDataSpecification.java new file mode 100644 index 000000000..349ea00e5 --- /dev/null +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DummyDataSpecification.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +/** + * This interface is needed to test the serialization/deserialization of a custom data specification content. + * See: https://github.com/eclipse-aas4j/aas4j/issues/196 + */ +public interface DummyDataSpecification extends CustomDataSpecification { + + LangStringNameType getName(); + + void setName(LangStringNameType name); + + + String getText(); + + void setText(String text); + + + int getPages(); + + void setPages(int pages); +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DummyDataSpecificationBuilder.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DummyDataSpecificationBuilder.java new file mode 100644 index 000000000..490ae42f7 --- /dev/null +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/model/DummyDataSpecificationBuilder.java @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.builder.ExtendableBuilder; + +/** + * This interface is needed to test the serialization/deserialization of a custom data specification content. + * + * See: https://github.com/eclipse-aas4j/aas4j/issues/196 + */ +public abstract class DummyDataSpecificationBuilder> extends ExtendableBuilder { + + public B name(LangStringNameType name) { + getBuildingInstance().setName(name); + return getSelf(); + } + + public B text(String text) { + getBuildingInstance().setText(text); + return getSelf(); + } + + public B pages(int pages) { + getBuildingInstance().setPages(pages); + return getSelf(); + } +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index bc4597532..dfd22388a 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,10 +19,14 @@ import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.json.JSONException; @@ -40,6 +45,7 @@ import java.util.Set; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; public class JsonSerializerTest { @@ -91,6 +97,33 @@ public void testSerializeEmptyReferableList() throws SerializationException { assertEquals("[]", serialized); } + /** + * This test ensures that future DataSpecificationContents can be added without adjustments in the code. + * + * @throws SerializationException + * @throws DeserializationException + */ + @Test + public void testSerializeCustomDataSpecification() throws SerializationException, DeserializationException { + JsonSerializer serializer = new JsonSerializer(); + JsonDeserializer deserializer = new JsonDeserializer(); + + // This is the only way to make the serialization to work. + Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); + subtypes.add(DefaultDummyDataSpecification.class); + + Environment origin = org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.ENVIRONMENT_WITH_DUMMYDATASPEC ; + + String jsonString = serializer.write(origin); + assertNotNull(jsonString); + + Environment copy = deserializer.read(jsonString); + assertNotNull(copy); + + assertTrue(origin.equals(copy)); + } + + private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { String expected = exampleData.fileContent(); String actual = new JsonSerializer().write(exampleData.getModel()); diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java index 7aa3b263b..ea0b54ff6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -16,22 +16,22 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import java.io.IOException; +import java.util.Iterator; +import java.util.Set; -public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { +public class EmbeddedDataSpecificationsDeserializer extends JsonDeserializer { - private static final String PROP_DATA_SPECIFICATION_CONTENT = "dataSpecificationIec61360"; @Override - public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { + public DataSpecificationContent deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException { ObjectNode node = DeserializationHelper.getRootObjectNode(parser); if (node == null) { return null; @@ -41,13 +41,23 @@ public DataSpecificationIec61360 deserialize(JsonParser parser, DeserializationC } - private DataSpecificationIec61360 createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { - JsonNode nodeContent = node.get(PROP_DATA_SPECIFICATION_CONTENT); - return createDefaultDataSpecificationIec61360FromNode(parser, nodeContent); - } - - private DataSpecificationIec61360 createDefaultDataSpecificationIec61360FromNode(JsonParser parser, JsonNode nodeContent) throws IOException { - return DeserializationHelper.createInstanceFromNode(parser, nodeContent, DefaultDataSpecificationIec61360.class); + private DataSpecificationContent createEmbeddedDataSpecificationsFromContent(JsonParser parser, JsonNode node) throws IOException { + String class_name = node.fieldNames().next(); + Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); + Iterator> iter = subtypes.iterator(); + while (iter.hasNext()) { + Class clazz = iter.next(); + if (clazz.getSimpleName().toLowerCase().contains(class_name.toLowerCase())) { + try { + JsonNode nodeContent = node.get(class_name); + return (DataSpecificationContent) DeserializationHelper.createInstanceFromNode(parser, nodeContent, clazz); + } catch (Exception e) { + // do nothing and try next in list + } + } + }; + + throw new IOException("Was expecting a known subclass of DataSpecificationContent but found " + class_name); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java index cfad82bb1..b70aaf051 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java @@ -20,7 +20,8 @@ import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.databind.jsontype.TypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationIec61360; +import com.google.common.base.CaseFormat; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import java.io.IOException; @@ -30,22 +31,30 @@ * of a reference. Uses DataSpecificationManager to resolve java type to * reference. */ -public class EmbeddedDataSpecificationSerializer extends JsonSerializer { +public class EmbeddedDataSpecificationSerializer extends JsonSerializer { @Override - public void serialize(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider) + public void serialize(DataSpecificationContent data, JsonGenerator generator, SerializerProvider provider) throws IOException { if (data == null) { return; } + String class_name = "dataSpecification"; // default + try { + // known limitation: Only one interface must be implemented by the class, and the name of this interface must match exactly to the name of the DataSpecification + class_name = data.getClass().getInterfaces()[0].getSimpleName(); + } catch (Exception e) { + // do nothing and continue with the default + } + class_name = CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, class_name); generator.writeStartObject(); - generator.writeObjectField("dataSpecificationIec61360", data); + generator.writeObjectField(class_name, data); generator.writeEndObject(); } @Override - public void serializeWithType(DataSpecificationIec61360 data, JsonGenerator generator, SerializerProvider provider, + public void serializeWithType(DataSpecificationContent data, JsonGenerator generator, SerializerProvider provider, TypeSerializer typedSerializer) throws IOException, JsonProcessingException { serialize(data, generator, provider); } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index aaa6b2e13..469a163df 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -17,14 +17,18 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; @@ -54,6 +58,7 @@ import java.util.Set; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; @@ -186,6 +191,32 @@ public void serializeAASWithExtensionMaximal() throws SerializationException, SA } + /** + * This test ensures that future DataSpecificationContents can be added without adjustments in the code. + * + * @throws SerializationException + * @throws DeserializationException + */ + @Test + public void testSerializeCustomDataSpecification() throws SerializationException, DeserializationException, SAXException { + XmlSerializer serializer = new XmlSerializer(); + XmlDeserializer deserializer = new XmlDeserializer(); + + // This is the only way to make the serialization to work. + Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); + subtypes.add(DefaultDummyDataSpecification.class); + + String xmlString = serializer.write(Examples.ENVIRONMENT_WITH_DUMMYDATASPEC); + assertNotNull(xmlString); + + validateAgainstXsdSchema(xmlString); + + Environment copy = deserializer.read(xmlString); + assertNotNull(copy); + + assertTrue(Examples.ENVIRONMENT_WITH_DUMMYDATASPEC.equals(copy)); + } + private Set validateAgainstXsdSchema(String xml) throws SAXException { return new XmlSchemaValidator().validateSchema(xml); } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CustomDataSpecification.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CustomDataSpecification.java new file mode 100644 index 000000000..a9a3eacd5 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/CustomDataSpecification.java @@ -0,0 +1,24 @@ +/* + * Copyright (C) 2023 SAP SE or an SAP affiliate company. + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +/** + * This interface is needed to test the serialization/deserialization of a custom data specification content. + * See: https://github.com/eclipse-aas4j/aas4j/issues/196 + */ +public interface CustomDataSpecification extends DataSpecificationContent { + +} \ No newline at end of file diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java index 7fd9aaeec..1fb8d800d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataSpecificationContent.java @@ -25,7 +25,8 @@ * and meta information about the template itself. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = DataSpecificationIec61360.class) + @KnownSubtypes.Type(value = DataSpecificationIec61360.class), + @KnownSubtypes.Type(value = CustomDataSpecification.class) }) public interface DataSpecificationContent { From e818238fcaad17cdb3a155070acc22e248013661 Mon Sep 17 00:00:00 2001 From: Michael Jacoby Date: Thu, 7 Dec 2023 12:22:43 +0100 Subject: [PATCH 17/73] Update AasUtils to v3.0 (asString, resolve, sameAs) (#179) * update AasUtils to v3.0 (asString, resolve, sameAs) * change default behavior of AasUtils.sameAs(...) to not compare referredSemanticId and add method overload taking additional parameter * add more unit tests for AasUtilsTest.java (#212) * address review comments: fix copyright & test cases --------- Co-authored-by: emildinchev <74680648+emildinchev@users.noreply.github.com> --- .../internal/util/GetChildrenVisitor.java | 82 ++++ .../internal/util/GetIdentifierVisitor.java | 51 +++ ...ssetAdministrationShellElementVisitor.java | 10 +- ...ministrationShellElementWalkerVisitor.java | 36 +- .../v3/dataformat/core/util/AasUtils.java | 291 +++++++------ .../aas4j/v3/dataformat/core/Examples.java | 2 +- .../v3/dataformat/core/util/AasUtilsTest.java | 401 ++++++++++++++++-- 7 files changed, 683 insertions(+), 190 deletions(-) create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/GetChildrenVisitor.java create mode 100644 dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/GetIdentifierVisitor.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/GetChildrenVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/GetChildrenVisitor.java new file mode 100644 index 000000000..1122e7afa --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/GetChildrenVisitor.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * 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.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.visitor.AssetAdministrationShellElementVisitor; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; + +public class GetChildrenVisitor implements AssetAdministrationShellElementVisitor { + + private final List children = new ArrayList<>(); + private Environment environment; + + public GetChildrenVisitor() { + } + + public void reset() { + children.clear(); + } + + public GetChildrenVisitor(Environment environment) { + this.environment = environment; + } + + public List getChildren() { + return children; + } + + @Override + public void visit(Environment environment) { + children.addAll(environment.getAssetAdministrationShells()); + children.addAll(environment.getConceptDescriptions()); + children.addAll(environment.getSubmodels()); + } + + @Override + public void visit(AssetAdministrationShell assetAdministrationShell) { + List submodelIds = assetAdministrationShell.getSubmodels().stream() + .map(x -> x.getKeys().get(x.getKeys().size() - 1).getValue()) + .collect(Collectors.toList()); + if (environment != null) { + children.addAll(environment.getSubmodels().stream() + .filter(x -> submodelIds.contains(x.getId())) + .collect(Collectors.toList())); + } + } + + @Override + public void visit(Submodel submodel) { + children.addAll(submodel.getSubmodelElements()); + } + + @Override + public void visit(SubmodelElementCollection submodelElementCollection) { + children.addAll(submodelElementCollection.getValue()); + } + + @Override + public void visit(SubmodelElementList submodelElementList) { + children.addAll(submodelElementList.getValue()); + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/GetIdentifierVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/GetIdentifierVisitor.java new file mode 100644 index 000000000..e3df45436 --- /dev/null +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/GetIdentifierVisitor.java @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * 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.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.visitor.AssetAdministrationShellElementVisitor; +import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + +public class GetIdentifierVisitor implements AssetAdministrationShellElementVisitor { + + private String identifier; + + public static String getIdentifier(Referable referable) { + GetIdentifierVisitor visitor = new GetIdentifierVisitor(); + visitor.visit(referable); + return visitor.getIdentifier(); + } + + public String getIdentifier() { + return identifier; + } + + @Override + public void visit(Referable referable) { + if (referable != null) { + identifier = referable.getIdShort(); + } + AssetAdministrationShellElementVisitor.super.visit(referable); + } + + @Override + public void visit(Identifiable identifiable) { + if (identifiable != null) { + identifier = identifiable.getId(); + } + AssetAdministrationShellElementVisitor.super.visit(identifiable); + } +} diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java index d0e27b8f7..24eb8f9d5 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementVisitor.java @@ -58,6 +58,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; public interface AssetAdministrationShellElementVisitor { @@ -171,6 +172,8 @@ public default void visit(SubmodelElement submodelElement) { visit((Capability) submodelElement); } else if (SubmodelElementCollection.class.isAssignableFrom(type)) { visit((SubmodelElementCollection) submodelElement); + } else if (SubmodelElementList.class.isAssignableFrom(type)) { + visit((SubmodelElementList) submodelElement); } else if (Operation.class.isAssignableFrom(type)) { visit((Operation) submodelElement); } else if (EventElement.class.isAssignableFrom(type)) { @@ -231,8 +234,8 @@ public default void visit(Capability capability) { public default void visit(ConceptDescription conceptDescription) { } - public default void visit(DataSpecificationContent dataSpecificationContent) { - } + public default void visit(DataSpecificationContent dataSpecificationContent) { + } public default void visit(Entity entity) { } @@ -297,6 +300,9 @@ public default void visit(Submodel submodel) { public default void visit(SubmodelElementCollection submodelElementCollection) { } + public default void visit(SubmodelElementList submodelElementList) { + } + public default void visit(Resource resource) { } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java index 3c51c7700..f373b8620 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/visitor/AssetAdministrationShellElementWalkerVisitor.java @@ -46,6 +46,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; public interface AssetAdministrationShellElementWalkerVisitor extends AssetAdministrationShellElementVisitor { @@ -129,7 +130,7 @@ public default void visit(HasSemantics hasSemantics) { return; } visit(hasSemantics.getSemanticId()); - hasSemantics.getSupplementalSemanticIds().forEach(x->visit(x)); + hasSemantics.getSupplementalSemanticIds().forEach(x -> visit(x)); AssetAdministrationShellElementVisitor.super.visit(hasSemantics); } @@ -208,36 +209,36 @@ public default void visit(Referable referable) { } @Override - public default void visit(LangStringNameType langString){ - if (langString == null){ + public default void visit(LangStringNameType langString) { + if (langString == null) { return; } AssetAdministrationShellElementVisitor.super.visit(langString); - }; + } @Override - public default void visit(LangStringPreferredNameTypeIec61360 langString){ - if (langString == null){ + public default void visit(LangStringPreferredNameTypeIec61360 langString) { + if (langString == null) { return; } AssetAdministrationShellElementVisitor.super.visit(langString); - }; + } @Override - public default void visit(LangStringDefinitionTypeIec61360 langString){ - if (langString == null){ + public default void visit(LangStringDefinitionTypeIec61360 langString) { + if (langString == null) { return; } AssetAdministrationShellElementVisitor.super.visit(langString); - }; + } @Override - public default void visit(LangStringTextType langString){ - if (langString == null){ + public default void visit(LangStringTextType langString) { + if (langString == null) { return; } AssetAdministrationShellElementVisitor.super.visit(langString); - }; + } @Override public default void visit(Reference reference) { @@ -315,6 +316,15 @@ public default void visit(SubmodelElementCollection submodelElementCollection) { AssetAdministrationShellElementVisitor.super.visit(submodelElementCollection); } + @Override + public default void visit(SubmodelElementList submodelElementList) { + if (submodelElementList == null) { + return; + } + submodelElementList.getValue().forEach(x -> visit(x)); + AssetAdministrationShellElementVisitor.super.visit(submodelElementList); + } + @Override public default void visit(Operation operation) { if (operation == null) { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index 1621c2c92..fac5cfeb7 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -15,36 +15,38 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; -import com.google.common.reflect.TypeToken; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.beans.PropertyDescriptor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.IdentifiableCollector; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.Operation; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.lang.reflect.InvocationTargetException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; +import com.google.common.reflect.TypeToken; +import java.util.Map; +import java.util.Objects; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.GetChildrenVisitor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.GetIdentifierVisitor; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; /** * Provides utility functions related to AAS @@ -53,26 +55,62 @@ public class AasUtils { private static final Logger log = LoggerFactory.getLogger(AasUtils.class); - private static final String REFERENCE_ELEMENT_DELIMITER = ", "; + private static final String REFERENCE_ELEMENT_DELIMITER = ", "; + + private static final Map REFERENCE_TYPE_REPRESENTATION = Map.of( + ReferenceTypes.EXTERNAL_REFERENCE, "ExternalRef", + ReferenceTypes.MODEL_REFERENCE, "ModelRef"); private AasUtils() { } - /** - * Formats a Reference as string - * - * @param reference - * Reference to serialize - * @return string representation of the reference for serialization, null if - * reference is null - */ - private static String asString(Reference reference) { - if (reference == null) { - return null; - } - return String.format("[%s]%s", reference.getType(), - reference.getKeys().stream().map(x -> String.format("(%s)%s", EnumSerializer.serializeEnumName(x.getType().name()), x.getValue())).collect(Collectors.joining(REFERENCE_ELEMENT_DELIMITER))); - } + /** + * Formats a Reference as string + * + * @param reference Reference to serialize + * @return string representation of the reference for serialization, null if reference is null + */ + public static String asString(Reference reference) { + return asString(reference, true, true); + } + + /** + * Serializes a {@link Reference} to string. + * + * @param reference the reference to serialize + * @param includeReferenceType if reference type information should be included + * @param includeReferredSemanticId if referred semanticId should be included + * @return the serialized reference or null if reference is null, reference.keys is null or reference does not + * contain any keys + */ + public static String asString(Reference reference, boolean includeReferenceType, boolean includeReferredSemanticId) { + if (Objects.isNull(reference) || Objects.isNull(reference.getKeys()) || reference.getKeys().isEmpty()) { + return null; + } + String result = ""; + if (includeReferenceType) { + String referredSemanticId = includeReferredSemanticId + ? asString(reference.getReferredSemanticId(), includeReferenceType, false) + : ""; + result = String.format("[%s%s]", + asString(reference.getType()), + (Objects.nonNull(referredSemanticId) && !referredSemanticId.isBlank()) ? String.format("- %s -", referredSemanticId) + : ""); + } + result += reference.getKeys().stream() + .map(x -> String.format("(%s)%s", + EnumSerializer.serializeEnumName(x.getType().name()), + x.getValue())) + .collect(Collectors.joining(", ")); + return result; + } + + private static String asString(ReferenceTypes referenceType) { + if (!REFERENCE_TYPE_REPRESENTATION.containsKey(referenceType)) { + throw new IllegalArgumentException(String.format("Unsupported reference type '%s'", referenceType)); + } + return REFERENCE_TYPE_REPRESENTATION.get(referenceType); + } /** * Creates a reference for an Identifiable instance using provided implementation types for reference and key @@ -128,9 +166,9 @@ public static KeyTypes referableToKeyType(Referable referable) { * @return a Java interface representing the provided KeyElements type or null if no matching Class/interface could * be found. It also returns abstract types like SUBMODEL_ELEMENT or DATA_ELEMENT */ - private static Class keyTypeToClass(KeyTypes key) { + private static Class keyTypeToClass(KeyTypes key) { return Stream.concat(ReflectionHelper.INTERFACES.stream(), ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream()) - .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) + .filter(x -> x.getSimpleName().equals(EnumSerializer.serializeEnumName(key.name()))) .findAny() .orElse(null); } @@ -188,36 +226,53 @@ public static Reference toReference(Reference parent, Referable element) { } /** - * Checks if two references are refering to the same element + * Checks if two references are refering to the same element ignoring referredSemanticId. * * @param ref1 reference 1 * @param ref2 reference 2 * @return returns true if both references are refering to the same element, otherwise false */ public static boolean sameAs(Reference ref1, Reference ref2) { + return sameAs(ref1, ref2, false); + } + + /** + * Checks if two references are referring to the same element. + * + * @param ref1 reference 1 + * @param ref2 reference 2 + * @param compareReferredSemanticId true if referredSemanticId should be compared, false otherwise + * @return returns true if both references are referring to the same element, otherwise false + */ + public static boolean sameAs(Reference ref1, Reference ref2, boolean compareReferredSemanticId) { boolean ref1Empty = ref1 == null || ref1.getKeys() == null || ref1.getKeys().isEmpty(); boolean ref2Empty = ref2 == null || ref2.getKeys() == null || ref2.getKeys().isEmpty(); + if (ref1Empty != ref2Empty) { + return false; + } + if (ref1.getType() != ref2.getType()) { + return false; + } + if (compareReferredSemanticId && !sameAs(ref1.getReferredSemanticId(), ref2.getReferredSemanticId())) { + return false; + } if (ref1Empty && ref2Empty) { return true; } - if (ref1Empty != ref2Empty) { + if (ref1.getKeys().size() != ref2.getKeys().size()) { return false; } - int keyLength = Math.min(ref1.getKeys().size(), ref2.getKeys().size()); - for (int i = 0; i < keyLength; i++) { - Key ref1Key = ref1.getKeys().get(ref1.getKeys().size() - (i + 1)); - Key ref2Key = ref2.getKeys().get(ref2.getKeys().size() - (i + 1)); - Class ref1Type = keyTypeToClass(ref1Key.getType()); - Class ref2Type = keyTypeToClass(ref2Key.getType()); - if ((ref1Type == null && ref2Type != null) - || (ref1Type != null && ref2Type == null)) { + for (int i = 0; i < ref1.getKeys().size(); i++) { + Key key1 = ref1.getKeys().get(ref1.getKeys().size() - (i + 1)); + Key key2 = ref2.getKeys().get(ref2.getKeys().size() - (i + 1)); + if (Objects.isNull(key1) != Objects.isNull(key2)) { return false; } - if (ref1Type != ref2Type) { - if (!(ref1Type.isAssignableFrom(ref2Type) - || ref2Type.isAssignableFrom(ref1Type))) { - return false; - } + if (Objects.isNull(key1)) { + return true; + } + if (!Objects.equals(key1.getValue(), key2.getValue())) { + return false; } } return true; @@ -232,7 +287,7 @@ public static boolean sameAs(Reference ref1, Reference ref2) { * * @return the cloned reference */ - private static Reference clone(Reference reference, Class referenceType, Class keyType) { + private static Reference clone(Reference reference, Class referenceType, Class keyType) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } @@ -278,114 +333,52 @@ public static Referable resolve(Reference reference, Environment env) { * @return returns an instance of T if the reference could successfully be resolved, otherwise null * @throws IllegalArgumentException if something goes wrong while resolving */ - @SuppressWarnings("unchecked") - public static T resolve(Reference reference, Environment env, Class type) { + @SuppressWarnings("unchecked") + public static T resolve(Reference reference, Environment env, Class type) { if (reference == null || reference.getKeys() == null || reference.getKeys().isEmpty()) { return null; } - Set identifiables = new IdentifiableCollector(env).collect(); - Object current = null; - int i = reference.getKeys().size() - 1; - if (type != null) { - Class actualType = keyTypeToClass(reference.getKeys().get(i).getType()); - if (actualType == null) { - log.warn("reference {} could not be resolved as key type has no known class.", - asString(reference)); - return null; - } - if (!type.isAssignableFrom(actualType)) { - log.warn("reference {} could not be resolved as target type is not assignable from actual type (target: {}, actual: {})", - asString(reference), type.getName(), actualType.getName()); - return null; - } - } - for (; i >= 0; i--) { + GetChildrenVisitor findChildrenVisitor = new GetChildrenVisitor(env); + findChildrenVisitor.visit(env); + Referable current = null; + for (int i = 0; i < reference.getKeys().size(); i++) { Key key = reference.getKeys().get(i); - Class referencedType = keyTypeToClass(key.getType()); - if (referencedType != null) { - List matchingIdentifiables = identifiables.stream() - .filter(x -> referencedType.isAssignableFrom(x.getClass())) - .filter(x -> x.getId().equals(key.getValue())) - .collect(Collectors.toList()); - if (matchingIdentifiables.size() > 1) { - throw new IllegalArgumentException("found multiple matching Identifiables for id '" + key.getValue() + "'"); + try { + int index = Integer.parseInt(key.getValue()); + if (Objects.isNull(current) || !SubmodelElementList.class.isAssignableFrom(current.getClass())) { + throw new IllegalArgumentException("reference uses index notation on an element that is not a SubmodelElementList"); } - if (matchingIdentifiables.size() == 1) { - current = matchingIdentifiables.get(0); - break; + List list = ((SubmodelElementList) current).getValue(); + if (list.size() <= index) { + throw new IllegalArgumentException(String.format( + "index notation out of bounds (list size: %s, requested index: %s)", + list.size(), + index)); } + current = list.get(index); + } catch (NumberFormatException e) { + current = findChildrenVisitor.getChildren().stream() + .filter(x -> Objects.equals(key.getValue(), GetIdentifierVisitor.getIdentifier(x))) + .findFirst() + .orElseThrow(() -> new IllegalArgumentException(String.format( + "unable to resolve reference '%s' as element '%s' does not exist", + asString(reference), + key.getValue()))); } + findChildrenVisitor.reset(); + findChildrenVisitor.visit(current); } if (current == null) { return null; } - i++; - if (i == reference.getKeys().size()) { - return (T) current; - } - // follow idShort path until target - for (; i < reference.getKeys().size(); i++) { - Key key = reference.getKeys().get(i); - Class keyType = keyTypeToClass(key.getType()); - if (keyType != null) { - if (SubmodelElementList.class.isAssignableFrom(current.getClass())) { - try { - current = ((SubmodelElementList) current).getValue().get(Integer.parseInt(key.getValue())); - } catch (NumberFormatException ex) { - throw new IllegalArgumentException(String.format("invalid value for key with index %d, expected integer values >= 0, but found '%s'", - i, key.getValue())); - } catch (IndexOutOfBoundsException ex) { - throw new IllegalArgumentException(String.format("index out of bounds exception for key with index %d, expected integer values >= 0 and < %d, but found '%s'", - i, - ((SubmodelElementList) current).getValue().size(), - key.getValue())); - } - } else { - Collection collection; - if (Operation.class.isAssignableFrom(current.getClass())) { - Operation operation = (Operation) current; - collection = Stream.of(operation.getInputVariables().stream(), - operation.getOutputVariables().stream(), - operation.getInoutputVariables().stream()) - .flatMap(x -> x.map(y -> y.getValue())) - .collect(Collectors.toSet()); - } else { - List matchingProperties = getAasProperties(current.getClass()).stream() - .filter(x -> Collection.class.isAssignableFrom(x.getReadMethod().getReturnType())) - .filter(x -> TypeToken.of(x.getReadMethod().getGenericReturnType()) - .resolveType(Collection.class.getTypeParameters()[0]) - .isSupertypeOf(keyType)) - .collect(Collectors.toList()); - if (matchingProperties.isEmpty()) { - throw new IllegalArgumentException(String.format("error resolving reference - could not find matching property for type %s in class %s", - keyType.getSimpleName(), - current.getClass().getSimpleName())); - } - if (matchingProperties.size() > 1) { - throw new IllegalArgumentException(String.format("error resolving reference - found %d possible property paths for class %s (%s)", - matchingProperties.size(), - current.getClass().getSimpleName(), - matchingProperties.stream() - .map(x -> x.getName()) - .collect(Collectors.joining(", ")))); - } - try { - collection = (Collection) matchingProperties.get(0).getReadMethod().invoke(current); - } catch (IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) { - throw new IllegalArgumentException("error resolving reference", ex); - } - } - Optional next = collection.stream() - .filter(x -> ((Referable) x).getIdShort().equals(key.getValue())) - .findFirst(); - if (next.isEmpty()) { - throw new IllegalArgumentException("error resolving reference - could not find idShort " + key.getValue()); - } - current = next.get(); - } - } + if (!type.isAssignableFrom(current.getClass())) { + throw new IllegalArgumentException(String.format( + "reference '%s' could not be resolved as target type is not assignable from actual type (target: %s, actual: %s)", + asString(reference), + type.getName(), + current.getClass().getName())); } - return (T) current; + return type.cast(current); } /** @@ -396,7 +389,7 @@ public static T resolve(Reference reference, Environment e * @return a list of all properties defined in any of AAS interface implemented by type. If type does not implement * any AAS interface an empty list is returned. */ - private static List getAasProperties(Class type) { + private static List getAasProperties(Class type) { Class aasType = ReflectionHelper.getAasInterface(type); if (aasType == null) { aasType = ReflectionHelper.INTERFACES_WITHOUT_DEFAULT_IMPLEMENTATION.stream() @@ -423,4 +416,4 @@ private static List getAasProperties(Class type) { .sorted(Comparator.comparing(x -> x.getName())) .collect(Collectors.toList()); } -} \ No newline at end of file +} diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java index 4a0fc95f8..941d292d6 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 jab. + * Copyright (c) 2023 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtilsTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtilsTest.java index 1659d2e5b..247888ff4 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtilsTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtilsTest.java @@ -1,5 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,27 +20,33 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.Operation; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperation; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; +import java.util.ArrayList; + import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; @RunWith(JUnitParamsRunner.class) public class AasUtilsTest { + @Test public void whenResolve_withProperty_success() { String submodelId = "http://example.org/submodel"; @@ -68,38 +75,124 @@ public void whenResolve_withProperty_success() { Assert.assertEquals(expected, actual); } + @Test(expected = IllegalArgumentException.class) + public void whenResolve_withInvalidType_fail() { + String submodelId = "http://example.org/submodel"; + String submodelElementIdShort = "foo"; + SubmodelElement expected = new DefaultProperty.Builder() + .idShort(submodelElementIdShort) + .value("bar") + .build(); + Environment environment = new DefaultEnvironment.Builder() + .submodels(new DefaultSubmodel.Builder() + .id(submodelId) + .submodelElements(expected) + .build()) + .build(); + Reference reference = new DefaultReference.Builder() + .type(ReferenceTypes.MODEL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(submodelId) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL_ELEMENT) + .value(submodelElementIdShort) + .build()) + .build(); + AasUtils.resolve(reference, environment, Operation.class); + } + @Test - public void whenResolve_withSubmodel_success() { - assertNotNull(AasUtils.resolve(AASFull.AAS_1.getSubmodels().get(0), AASFull.createEnvironment())); + public void whenResolve_insideSubmodelElementList_success() { + String submodelId = "http://example.org/submodel"; + String submodelElementIdShort = "foo"; + String submodelElementListIdShort = "list"; + SubmodelElement expected = new DefaultProperty.Builder() + .idShort(submodelElementIdShort) + .value("bar") + .build(); + SubmodelElementList list = new DefaultSubmodelElementList.Builder() + .idShort(submodelElementListIdShort) + .value(expected) + .build(); + Environment environment = new DefaultEnvironment.Builder() + .submodels(new DefaultSubmodel.Builder() + .id(submodelId) + .submodelElements(list) + .build()) + .build(); + Reference reference = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(submodelId) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL_ELEMENT_LIST) + .value(submodelElementListIdShort) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL_ELEMENT) + .value("0") + .build()) + .build(); + Referable actual = AasUtils.resolve(reference, environment); + Assert.assertEquals(expected, actual); + } - Submodel asSubmodel = AasUtils.resolve( - AASFull.AAS_1.getSubmodels().get(0), - AASFull.createEnvironment(), - Submodel.class - ); - - assertNotNull(asSubmodel); - assertEquals(DefaultSubmodel.class, asSubmodel.getClass()); + @Test(expected = IllegalArgumentException.class) + public void whenResolve_insideSubmodelElementList_indexOutOfBounds() { + String submodelId = "http://example.org/submodel"; + String submodelElementIdShort = "foo"; + String submodelElementListIdShort = "list"; + SubmodelElement expected = new DefaultProperty.Builder() + .idShort(submodelElementIdShort) + .value("bar") + .build(); + SubmodelElementList list = new DefaultSubmodelElementList.Builder() + .idShort(submodelElementListIdShort) + .value(expected) + .build(); + Environment environment = new DefaultEnvironment.Builder() + .submodels(new DefaultSubmodel.Builder() + .id(submodelId) + .submodelElements(list) + .build()) + .build(); + Reference reference = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value(submodelId) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL_ELEMENT_LIST) + .value(submodelElementListIdShort) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL_ELEMENT) + .value("1") + .build()) + .build(); + AasUtils.resolve(reference, environment); } - + @Test - public void whenResolve_withOperation_success() { + public void whenResolve_insideSubmodelElementCollection_success() { String submodelId = "http://example.org/submodel"; String submodelElementIdShort = "foo"; - String submodelElement2IdShort = "bar"; + String submodelElementListIdShort = "list"; SubmodelElement expected = new DefaultProperty.Builder() - .idShort(submodelElement2IdShort) + .idShort(submodelElementIdShort) .value("bar") .build(); + SubmodelElementCollection list = new DefaultSubmodelElementCollection.Builder() + .idShort(submodelElementListIdShort) + .value(expected) + .build(); Environment environment = new DefaultEnvironment.Builder() .submodels(new DefaultSubmodel.Builder() .id(submodelId) - .submodelElements(new DefaultOperation.Builder() - .idShort(submodelElementIdShort) - .inputVariables(new DefaultOperationVariable.Builder() - .value(expected) - .build()) - .build()) + .submodelElements(list) .build()) .build(); Reference reference = new DefaultReference.Builder() @@ -108,18 +201,29 @@ public void whenResolve_withOperation_success() { .value(submodelId) .build()) .keys(new DefaultKey.Builder() - .type(KeyTypes.SUBMODEL_ELEMENT) - .value(submodelElementIdShort) + .type(KeyTypes.SUBMODEL_ELEMENT_LIST) + .value(submodelElementListIdShort) .build()) .keys(new DefaultKey.Builder() .type(KeyTypes.SUBMODEL_ELEMENT) - .value(submodelElement2IdShort) + .value(submodelElementIdShort) .build()) .build(); Referable actual = AasUtils.resolve(reference, environment); Assert.assertEquals(expected, actual); } + @Test + public void whenResolve_withSubmodel_success() { + Environment environment = AASFull.createEnvironment(); + Reference submodelRef = AASFull.AAS_1.getSubmodels().get(0); + Submodel expected = AASFull.SUBMODEL_3; + Referable asReferable = AasUtils.resolve(submodelRef, environment); + assertEquals(expected, asReferable); + Submodel asSubmodel = AasUtils.resolve(submodelRef, environment, Submodel.class); + assertEquals(expected, asSubmodel); + } + @Test public void whenResolve_withElementWithinSubmodelElementList_success() { String submodelId = "http://example.org/submodel"; @@ -154,4 +258,251 @@ public void whenResolve_withElementWithinSubmodelElementList_success() { Assert.assertEquals(expected, actual); } + @Test + public void whenSameAs_withDifferentKeyTypesButSameValues_success() { + String value = "0173-1#01-ADS698#010"; + Reference ref1 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + Reference ref2 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.FRAGMENT_REFERENCE) + .value(value) + .build()) + .build(); + Assert.assertTrue(AasUtils.sameAs(ref1, ref2)); + } + + @Test + public void whenSameAs_withoutKeys_success() { + Reference ref1 = new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE).build(); + ref1.setKeys(null); + Reference ref2 = new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE).build(); + ref2.setKeys(new ArrayList<>()); + Assert.assertTrue(AasUtils.sameAs(ref1, ref2)); + } + + @Test + public void whenSameAs_withoutKeysAndDifferentTypes_fail() { + Reference ref1 = new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE).build(); + ref1.setKeys(null); + Reference ref2 = new DefaultReference.Builder().type(ReferenceTypes.MODEL_REFERENCE).build(); + ref2.setKeys(new ArrayList<>()); + Assert.assertFalse(AasUtils.sameAs(ref1, ref2)); + } + + @Test + public void whenSameAs_withoutKeysAndDifferentSemaniticIDs_fail() { + Reference semanticId1 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .value("value1") + .build()) + .build(); + Reference semanticId2 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.FRAGMENT_REFERENCE) + .value("value2") + .build()) + .build(); + Reference ref1 = new DefaultReference.Builder() + .referredSemanticId(semanticId1) + .build(); + ref1.setKeys(null); + Reference ref2 = new DefaultReference.Builder() + .referredSemanticId(semanticId2) + .build(); + ref2.setKeys(new ArrayList<>()); + Assert.assertFalse(AasUtils.sameAs(ref1, ref2, true)); + } + + @Test + public void whenSameAs_withDifferentKeyTypesButSameValuesAndSemanticIDs_success() { + String value = "0173-1#01-ADS698#010"; + Reference semanticId1 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + Reference semanticId2 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.FRAGMENT_REFERENCE) + .value(value) + .build()) + .build(); + Reference ref1 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .referredSemanticId(semanticId1) + .build(); + Reference ref2 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.FRAGMENT_REFERENCE) + .value(value) + .build()) + .referredSemanticId(semanticId2) + .build(); + Assert.assertTrue(AasUtils.sameAs(ref1, ref2, true)); + } + + @Test + public void whenSameAs_withDifferentKeyTypesAndValues_fail() { + Reference ref1 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("foo") + .build()) + .build(); + Reference ref2 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.FRAGMENT_REFERENCE) + .value("bar") + .build()) + .build(); + Assert.assertFalse(AasUtils.sameAs(ref1, ref2)); + } + + @Test + public void whenSameAs_withSameKeyTypesAndValues_success() { + String value = "0173-1#01-ADS698#010"; + Reference ref1 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + Reference ref2 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + Assert.assertTrue(AasUtils.sameAs(ref1, ref2)); + } + + @Test + public void whenSameAs_withSameKeyTypesButDifferentValues_fail() { + Reference ref1 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("foo") + .build()) + .build(); + Reference ref2 = new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("bar") + .build()) + .build(); + Assert.assertFalse(AasUtils.sameAs(ref1, ref2)); + } + + @Test + public void whenSameAs_withDifferentReferredSemanticId_success() { + String value = "0173-1#01-ADS698#010"; + Reference ref1 = new DefaultReference.Builder() + .referredSemanticId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("foo") + .build()) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + Reference ref2 = new DefaultReference.Builder() + .referredSemanticId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("bar") + .build()) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + Assert.assertTrue(AasUtils.sameAs(ref1, ref2)); + } + + @Test + public void whenSameAs_withDifferentReferredSemanticId_fail() { + String value = "0173-1#01-ADS698#010"; + Reference ref1 = new DefaultReference.Builder() + .referredSemanticId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("foo") + .build()) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + Reference ref2 = new DefaultReference.Builder() + .referredSemanticId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("bar") + .build()) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + Assert.assertFalse(AasUtils.sameAs(ref1, ref2, true)); + } + + @Test + public void whenAsString_withSubmodelElementList_success() { + Reference reference = new DefaultReference.Builder() + .type(ReferenceTypes.MODEL_REFERENCE) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL) + .value("submodel") + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.SUBMODEL_ELEMENT_LIST) + .value("list") + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.PROPERTY) + .value("0") + .build()) + .build(); + String expected = "[ModelRef](Submodel)submodel, (SubmodelElementList)list, (Property)0"; + String actual = AasUtils.asString(reference); + Assert.assertEquals(expected, actual); + } + + @Test + public void whenAsString_withReferredSemanticId_success() { + String value = "0173-1#01-ADS698#010"; + Reference reference = new DefaultReference.Builder() + .type(ReferenceTypes.EXTERNAL_REFERENCE) + .referredSemanticId(new DefaultReference.Builder() + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value("foo") + .build()) + .type(ReferenceTypes.MODEL_REFERENCE) + .build()) + .keys(new DefaultKey.Builder() + .type(KeyTypes.GLOBAL_REFERENCE) + .value(value) + .build()) + .build(); + String expected = "[ExternalRef- [ModelRef](GlobalReference)foo -](GlobalReference)0173-1#01-ADS698#010"; + String actual = AasUtils.asString(reference); + Assert.assertEquals(expected, actual); + } } From 93d51f9c03886b5e48e8e2d1de7e16d19dcd5c47 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 10:56:25 +0000 Subject: [PATCH 18/73] Bump com.networknt:json-schema-validator from 1.0.87 to 1.0.88 Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.0.87 to 1.0.88. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.0.87...1.0.88) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f94b33964..69a3f9440 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.1.0 4.1.0 1.5.1 - 1.0.87 + 1.0.88 4.13.2 1.1.1 2.7.8 From 26f94999f24214bf7c44b0a029569d50b015228c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Dec 2023 10:52:35 +0000 Subject: [PATCH 19/73] Bump com.networknt:json-schema-validator from 1.0.88 to 1.1.0 Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.0.88 to 1.1.0. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.0.88...1.1.0) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69a3f9440..292bb0c49 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.1.0 4.1.0 1.5.1 - 1.0.88 + 1.1.0 4.13.2 1.1.1 2.7.8 From 0ac166daffb60de9f9fd8f2664c2f2ac66647daf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Dec 2023 10:25:32 +0000 Subject: [PATCH 20/73] Bump com.google.guava:guava from 32.1.3-jre to 33.0.0-jre Bumps [com.google.guava:guava](https://github.com/google/guava) from 32.1.3-jre to 33.0.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69a3f9440..06d3f883b 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ 2.15.1 1.25.0 3.14.0 - 32.1.3-jre + 33.0.0-jre 5.0.1 2.2 2.16.0 From f94f689f22dc93113963d4fa84cfafb8d6a1010f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 10:09:35 +0000 Subject: [PATCH 21/73] Bump jackson.version from 2.16.0 to 2.16.1 Bumps `jackson.version` from 2.16.0 to 2.16.1. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.16.0 to 2.16.1 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-core` from 2.16.0 to 2.16.1 - [Release notes](https://github.com/FasterXML/jackson-core/releases) - [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.16.0...jackson-core-2.16.1) Updates `com.fasterxml.jackson.core:jackson-annotations` from 2.16.0 to 2.16.1 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.dataformat:jackson-dataformat-xml` from 2.16.0 to 2.16.1 - [Commits](https://github.com/FasterXML/jackson-dataformat-xml/compare/jackson-dataformat-xml-2.16.0...jackson-dataformat-xml-2.16.1) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.core:jackson-core dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-xml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69a3f9440..a149ea1fe 100644 --- a/pom.xml +++ b/pom.xml @@ -64,7 +64,7 @@ 32.1.3-jre 5.0.1 2.2 - 2.16.0 + 2.16.1 2.0.1.Final 2.3.1 2.1.0 From 8d040994a60c07049e3835ef6b0cc1be92d1838d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 10:09:48 +0000 Subject: [PATCH 22/73] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.11.0 to 3.12.1. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.11.0...maven-compiler-plugin-3.12.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69a3f9440..f10eecfd3 100644 --- a/pom.xml +++ b/pom.xml @@ -47,7 +47,7 @@ UTF-8 UTF-8 - 3.11.0 + 3.12.1 3.3.1 1.5.0 3.0.1 From b3d6be57d36b2333d2909d48a74f135f04f53ab8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Dec 2023 10:22:48 +0000 Subject: [PATCH 23/73] Bump slf4j.version from 2.0.9 to 2.0.10 Bumps `slf4j.version` from 2.0.9 to 2.0.10. Updates `org.slf4j:slf4j-api` from 2.0.9 to 2.0.10 Updates `org.slf4j:slf4j-simple` from 2.0.9 to 2.0.10 --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.slf4j:slf4j-simple dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 69a3f9440..32bc68b3f 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 1.1.1 2.7.8 5.2.5 - 2.0.9 + 2.0.10 1.3.2 4.4.1 2.12.1 From 2c3f4237d2d0080fa78e5a19ad78344ee41d1f99 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Jan 2024 10:10:14 +0000 Subject: [PATCH 24/73] Bump slf4j.version from 2.0.10 to 2.0.11 Bumps `slf4j.version` from 2.0.10 to 2.0.11. Updates `org.slf4j:slf4j-api` from 2.0.10 to 2.0.11 Updates `org.slf4j:slf4j-simple` from 2.0.10 to 2.0.11 --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: org.slf4j:slf4j-simple dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d2b698b2a..0fd3a2aef 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 1.1.1 2.7.8 5.2.5 - 2.0.10 + 2.0.11 1.3.2 4.4.1 2.12.1 From f6f38cbd3a3cc30ab8a98a4bb5f064e4ac487e17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:58:40 +0000 Subject: [PATCH 25/73] Bump org.codehaus.mojo:flatten-maven-plugin from 1.5.0 to 1.6.0 Bumps [org.codehaus.mojo:flatten-maven-plugin](https://github.com/mojohaus/flatten-maven-plugin) from 1.5.0 to 1.6.0. - [Release notes](https://github.com/mojohaus/flatten-maven-plugin/releases) - [Commits](https://github.com/mojohaus/flatten-maven-plugin/compare/1.5.0...1.6.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:flatten-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- model/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/pom.xml b/model/pom.xml index 262b6ef46..599d40142 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -19,7 +19,7 @@ 1.8 1.8 - 1.5.0 + 1.6.0 3.6.3 3.5.0 diff --git a/pom.xml b/pom.xml index 0fd3a2aef..fe66adaa0 100644 --- a/pom.xml +++ b/pom.xml @@ -49,7 +49,7 @@ 3.12.1 3.3.1 - 1.5.0 + 1.6.0 3.0.1 3.3.0 3.6.3 From 5b853115ed1462f60e61aa8e24e123726bcf327c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 10:58:59 +0000 Subject: [PATCH 26/73] Bump org.mockito:mockito-core from 5.8.0 to 5.9.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.8.0 to 5.9.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.8.0...v5.9.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0fd3a2aef..3d3a4cff6 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 4.4.1 2.12.1 2.9.1 - 5.8.0 + 5.9.0 0.0.20131108.vaadin1 From 2c972190991d3a95b302afc908d4e2a1895a986f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Jan 2024 10:44:58 +0000 Subject: [PATCH 27/73] Bump com.networknt:json-schema-validator from 1.1.0 to 1.2.0 Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.1.0 to 1.2.0. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.1.0...1.2.0) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 124f76d1b..4b8994805 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.1.0 4.1.0 1.5.1 - 1.1.0 + 1.2.0 4.13.2 1.1.1 2.7.8 From 8967ad8ae31851c838cd767eb2dbcf236fb9e983 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Tue, 23 Jan 2024 15:06:34 +0100 Subject: [PATCH 28/73] Fixes AASXDeserializer getRelatedFiles crashes (#229) * Fixes AASXDeserializer getRelatedFiles crashes * Only file URLs are tried to resolve * Non-existing files lead to a warning * Update AASXDeserializer.java * Update AASXUtils.java * Update TestAASXUtils.java --------- Signed-off-by: Frank Schnicke --- dataformat-aasx/pom.xml | 5 ++ .../v3/dataformat/aasx/AASXDeserializer.java | 13 ++-- .../v3/dataformat/aasx/AASXSerializer.java | 13 ++-- .../dataformat/aasx/internal/AASXUtils.java | 57 +++++++++-------- .../deserialization/AASXDeserializerTest.java | 61 ++++++++++++++----- .../aasx/internal/TestAASXUtils.java | 57 +++++++++++++++++ pom.xml | 4 +- 7 files changed, 156 insertions(+), 54 deletions(-) create mode 100644 dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/TestAASXUtils.java diff --git a/dataformat-aasx/pom.xml b/dataformat-aasx/pom.xml index c42a42903..a55af1615 100644 --- a/dataformat-aasx/pom.xml +++ b/dataformat-aasx/pom.xml @@ -47,5 +47,10 @@ ${project.groupId} dataformat-core + + org.slf4j + slf4j-simple + test + diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index ab919fb93..069e64cd7 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -23,6 +23,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; import org.apache.commons.io.IOUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; @@ -123,10 +124,14 @@ public String getXMLResourceString() throws InvalidFormatException, IOException * if deserialization of the serialized aas environment fails */ public List getRelatedFiles() throws InvalidFormatException, IOException, DeserializationException { - List filePaths = parseReferencedFilePathsFromAASX(); + List filePaths = parseReferencedFilePathsFromAASX().stream().filter(AASXUtils::isFilePath).collect(Collectors.toList()); List files = new ArrayList<>(); for (String filePath : filePaths) { - files.add(readFile(aasxRoot, filePath)); + try { + files.add(readFile(aasxRoot, filePath)); + } catch (Exception e) { + logger.warn("Loading file " + filePath + " failed and will not be included. Exception: " + e); + } } return files; } @@ -163,7 +168,7 @@ private PackageRelationshipCollection getXMLDocumentRelation(PackagePart originP private String getXMLPart(PackagePart originPart) throws InvalidFormatException { if (isCompatibilityModeNeeded(originPart)) { - logger.warn("AASX contains wrong Relationship namespace. This may be related to a bug in AASX Package Explorer or an old version of AAS4J. Future compatibility with the wrong namespace may not be guaranteed"); + logger.warn("AASX contains wrong Relationship namespace. This may be related to the AASX being created with an old version of AASX Package Explorer or an old version of AAS4J. Future compatibility with the wrong namespace may not be guaranteed"); return AASPEC_RELTYPE_BACKWARDSCOMPATIBLE; } else { return AASXSerializer.AASSPEC_RELTYPE; @@ -227,7 +232,7 @@ private List parseElements(Collection elements) { } private InMemoryFile readFile(OPCPackage aasxRoot, String filePath) throws InvalidFormatException, IOException { - PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(AASXUtils.getPathFromURL(filePath))); + PackagePart part = aasxRoot.getPart(PackagingURIHelper.createPartName(AASXUtils.removeFilePartOfURI(filePath))); InputStream stream = part.getInputStream(); return new InMemoryFile(stream.readAllBytes(), filePath); } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index ebacc682d..f17f5b54f 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -127,11 +127,11 @@ private void storeFilesInAASX(Environment environment, Collection && aas.getAssetInformation().getDefaultThumbnail() != null && aas.getAssetInformation().getDefaultThumbnail().getPath() != null) .forEach(aas -> createParts(files, - AASXUtils.getPathFromURL(aas.getAssetInformation().getDefaultThumbnail().getPath()), + AASXUtils.removeFilePartOfURI(aas.getAssetInformation().getDefaultThumbnail().getPath()), rootPackage, xmlPart, aas.getAssetInformation().getDefaultThumbnail().getContentType())); environment.getSubmodels().forEach(sm -> findFileElements(sm.getSubmodelElements()).forEach(file -> createParts(files, - AASXUtils.getPathFromURL(file.getValue()), rootPackage, xmlPart, file.getContentType()))); + AASXUtils.removeFilePartOfURI(file.getValue()), rootPackage, xmlPart, file.getContentType()))); } /** @@ -265,7 +265,7 @@ private void prepareFilePaths(Collection submodels) { */ private InMemoryFile findFileByPath(Collection files, String path) { for (InMemoryFile file : files) { - if (AASXUtils.getPathFromURL(file.getPath()).equals(path)) { + if (AASXUtils.removeFilePartOfURI(file.getPath()).equals(path)) { return file; } } @@ -279,11 +279,10 @@ private InMemoryFile findFileByPath(Collection files, String path) * @return the prepared path */ private String preparePath(String path) { - String newPath = AASXUtils.getPathFromURL(path); - if (!newPath.startsWith("file://")) { - newPath = "file://" + newPath; + if (path.startsWith("/")) { + path = "file://" + path; } - return newPath; + return path; } } \ No newline at end of file diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java index 6b3415b3c..710318277 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/AASXUtils.java @@ -1,40 +1,45 @@ +/* + * Copyright (c) 2024 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * 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.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal; public class AASXUtils { /** - * Gets the path from a URL e.g "http://localhost:8080/path/to/test.file" - * results in "/path/to/test.file" + * Removes the file: or file:// suffix of an URI * - * @param url URL to get the path for - * @return the path from the URL + * @param uri + * URI to remove the file suffix from + * @return the URI without the file suffix */ - public static String getPathFromURL(String url) { - if (url == null) { + public static String removeFilePartOfURI(String uri) { + if (uri == null) { return null; } - if (url.contains("://")) { - - // Find the ":" and and remove the "http://" from the url - int index = url.indexOf(":") + 3; - url = url.substring(index); - - // Find the first "/" from the URL (now without the "http://") and remove - // everything before that - index = url.indexOf("/"); - url = url.substring(index); - - // Recursive call to deal with more than one server parts - // (e.g. basyx://127.0.0.1:6998//https://localhost/test/) - return getPathFromURL(url); - } else { - // Make sure the path has a / at the start - if (!url.startsWith("/")) { - url = "/" + url; - } - return url; + if (uri.startsWith("file://")) { + return uri.replaceFirst("file://", ""); + } else if (uri.startsWith("file:")) { + return uri.replaceFirst("file:", ""); } + + return uri; + } + + public static boolean isFilePath(String uri) { + return uri.startsWith("/") || uri.startsWith("file:") || uri.startsWith("./") || uri.startsWith("../"); } } diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java index 77007d622..c13042781 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java @@ -15,6 +15,20 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.deserialization; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; + +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import javax.xml.parsers.ParserConfigurationException; + import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; @@ -23,31 +37,25 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.File; +import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; import org.xml.sax.SAXException; -import javax.xml.parsers.ParserConfigurationException; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; - public class AASXDeserializerTest { @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testRoundTrip() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { - + public void roundTrip() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; byte[] thumbnail = { 0, 1, 2, 3, 4 }; @@ -56,7 +64,7 @@ public void testRoundTrip() throws SerializationException, IOException, InvalidF fileList.add(inMemoryFile); fileList.add(inMemoryFileThumbnail); - File file = tempFolder.newFile("output.aasx"); + java.io.File file = tempFolder.newFile("output.aasx"); new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); @@ -66,4 +74,27 @@ public void testRoundTrip() throws SerializationException, IOException, InvalidF assertEquals(AASSimple.createEnvironment(), deserializer.read()); assertTrue(CollectionUtils.isEqualCollection(fileList, deserializer.getRelatedFiles())); } + + @Test + public void relatedFilesAreOnlyResolvedIfWithinAASX() throws IOException, SerializationException, InvalidFormatException, DeserializationException { + Submodel fileSm = new DefaultSubmodel.Builder().id("doesNotMatter").submodelElements(createFileSubmodelElements()).build(); + Environment env = new DefaultEnvironment.Builder().submodels(fileSm).build(); + + byte[] image = { 0, 1, 2, 3, 4 }; + InMemoryFile inMemoryFile = new InMemoryFile(image, "file:///aasx/internalFile.jpg"); + + java.io.File file = tempFolder.newFile("output.aasx"); + new AASXSerializer().write(env, Collections.singleton(inMemoryFile), new FileOutputStream(file)); + + InputStream in = new FileInputStream(file); + AASXDeserializer deserializer = new AASXDeserializer(in); + + assertEquals(Collections.singletonList(inMemoryFile), deserializer.getRelatedFiles()); + } + + private static List createFileSubmodelElements() { + File internalFile = new DefaultFile.Builder().idShort("internalFile").contentType("image/jpeg").value("file:///aasx/internalFile.jpg").build(); + File externalFile = new DefaultFile.Builder().idShort("externalFile").contentType("image/jpeg").value("http://doesNotMatter.com/image").build(); + return Arrays.asList(internalFile, externalFile); + } } diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/TestAASXUtils.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/TestAASXUtils.java new file mode 100644 index 000000000..46959ea7f --- /dev/null +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/internal/TestAASXUtils.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2024 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * 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.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +public class TestAASXUtils { + + @Test + public void isFilePath() { + // Cf. RFC8089 + String[] filePaths = { + "file://a", "file:a", "./b/c", "../b/c/d", "/a" + }; + + String[] notFilePaths = { + "http://admin-shell.io/example", "ftp://admin-shell.io/example" + }; + + for (String filePath : filePaths) { + assertTrue(AASXUtils.isFilePath(filePath)); + } + + for (String filePath : notFilePaths) { + assertFalse(AASXUtils.isFilePath(filePath)); + } + } + + @Test + public void removeFilePartOfURI() { + String[] filePaths = { + "file:///a", "file:/a", "/a" + }; + + for (String filePath : filePaths) { + assertEquals("/a", AASXUtils.removeFilePartOfURI(filePath)); + } + } +} diff --git a/pom.xml b/pom.xml index 4b8994805..c8f6e0b31 100644 --- a/pom.xml +++ b/pom.xml @@ -40,9 +40,9 @@ 1 0 0 - -milestone-04 + -SNAPSHOT ${revision.major}.${revision.minor}.${revision.patch}${revision.suffix} - 1.0.0-milestone-04 + 1.0.0-SNAPSHOT UTF-8 UTF-8 From eaef35ce777e776b44c1a255d62dbb6b2e7fd2ec Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Wed, 24 Jan 2024 09:19:32 +0100 Subject: [PATCH 29/73] Fixes wrong UUID generation (#235) Fixes wrong UUID generation --- .../digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index f17f5b54f..a287b121e 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -174,7 +174,8 @@ private void saveAASX(OutputStream os, OPCPackage rootPackage) throws IOExceptio * @return UUID */ private String createUniqueID() { - return UUID.randomUUID().toString(); + // The unique id has to start with a letter (cf. xs:ID). UUIDs do this only sometimes + return "a" + UUID.randomUUID().toString(); } /** @@ -285,4 +286,4 @@ private String preparePath(String path) { return path; } -} \ No newline at end of file +} From 7ab3e32c9bd85e47c2df7fc0fe4d66e5d30dcc88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:02:03 +0000 Subject: [PATCH 30/73] Bump org.mockito:mockito-core from 5.9.0 to 5.10.0 Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.9.0 to 5.10.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.9.0...v5.10.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c8f6e0b31..8617e0dfb 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ 4.4.1 2.12.1 2.9.1 - 5.9.0 + 5.10.0 0.0.20131108.vaadin1 From 2eaf2445f72998f4ca75c11c7d75de89431f38ab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 10:59:01 +0000 Subject: [PATCH 31/73] Bump com.networknt:json-schema-validator from 1.2.0 to 1.3.0 Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.2.0 to 1.3.0. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.2.0...1.3.0) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c8f6e0b31..652ed9775 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.1.0 4.1.0 1.5.1 - 1.2.0 + 1.3.0 4.13.2 1.1.1 2.7.8 From 7d23642ceb08497a8d2140b5edb0fac4e451b292 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Wed, 31 Jan 2024 08:16:37 +0100 Subject: [PATCH 32/73] Adds handling of emptry entries (#238) Signed-off-by: Frank Schnicke --- dataformat-xml/pom.xml | 6 +- .../NoEntryWrapperListDeserializer.java | 33 ++++--- .../dataformat/xml/XMLDeserializerTest.java | 12 ++- .../src/test/resources/empty_entries.xml | 88 +++++++++++++++++++ 4 files changed, 123 insertions(+), 16 deletions(-) create mode 100644 dataformat-xml/src/test/resources/empty_entries.xml diff --git a/dataformat-xml/pom.xml b/dataformat-xml/pom.xml index 4ed49f74a..66680ae23 100644 --- a/dataformat-xml/pom.xml +++ b/dataformat-xml/pom.xml @@ -61,7 +61,6 @@ org.slf4j slf4j-api - test ${project.groupId} @@ -71,5 +70,10 @@ com.fasterxml.jackson.core jackson-core + + org.slf4j + slf4j-simple + test + diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/NoEntryWrapperListDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/NoEntryWrapperListDeserializer.java index 3134a00a4..320ea53f0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/NoEntryWrapperListDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/NoEntryWrapperListDeserializer.java @@ -15,6 +15,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -23,19 +31,15 @@ import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - /** * Custom deserializer for lists without individual list entry wrappers for parametrized classes. * * @param deserialized class within the list */ -public class NoEntryWrapperListDeserializer extends JsonDeserializer> { +public class NoEntryWrapperListDeserializer extends JsonDeserializer> { protected final String elementName; private CustomJsonNodeDeserializer nodeDeserializer; + private static Logger logger = LoggerFactory.getLogger(NoEntryWrapperListDeserializer.class); public NoEntryWrapperListDeserializer(String elementName, CustomJsonNodeDeserializer nodeDeserializer) { this.elementName = elementName; @@ -44,12 +48,17 @@ public NoEntryWrapperListDeserializer(String elementName, CustomJsonNodeDeserial @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { - ObjectNode node = DeserializationHelper.getRootObjectNode(parser); - JsonNode langStringNode = node.get(elementName); - if (langStringNode.isObject()) { - return createEntriesFromObjectNode(langStringNode, parser); - } else { - return createEntriesFromArrayNode((ArrayNode) langStringNode, parser); + try { + ObjectNode node = DeserializationHelper.getRootObjectNode(parser); + JsonNode langStringNode = node.get(elementName); + if (langStringNode.isObject()) { + return createEntriesFromObjectNode(langStringNode, parser); + } else { + return createEntriesFromArrayNode((ArrayNode) langStringNode, parser); + } + } catch (ClassCastException e) { + logger.info("Found empty list items (e.g., '' of dataSpecificationIec61360) in XML. This is most likely an error."); + return new ArrayList(); } } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java index f3d698768..db1ba2ec6 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java @@ -15,6 +15,9 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; +import java.io.FileNotFoundException; +import java.util.List; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; @@ -30,9 +33,6 @@ import org.junit.Test; import org.xml.sax.SAXException; -import java.io.FileNotFoundException; -import java.util.List; - public class XMLDeserializerTest { @Test @@ -133,4 +133,10 @@ public void deserializeAASWithExtensionMaximal() throws SerializationException, Assert.assertEquals(Examples.EXTENSION_MAXIMAL, env); } + + @Test + public void deserializeWithEmptyKeys() throws FileNotFoundException, DeserializationException { + java.io.File file = new java.io.File("src/test/resources/empty_entries.xml"); + new XmlDeserializer().read(file); + } } diff --git a/dataformat-xml/src/test/resources/empty_entries.xml b/dataformat-xml/src/test/resources/empty_entries.xml new file mode 100644 index 000000000..255b2c71a --- /dev/null +++ b/dataformat-xml/src/test/resources/empty_entries.xml @@ -0,0 +1,88 @@ + + + + Nameplate + https://example.com/ids/sm/2593_9052_1042_2364 + Template + + ExternalReference + + + GlobalReference + https://admin-shell.io/zvei/nameplate/2/0/Nameplate + + + + + + ManufacturerName + + + en + Note: see also [IRDI] 0112/2///61987#ABA565#007 manufacturer Note: mandatory property according to EU Machine Directive 2006/42/EC. + + + + ExternalReference + + + GlobalReference + 0173-1#02-AAO677#002 + + + + + + Multiplicity + xs:string + One + + + + + + ExternalReference + + + GlobalReference + http://admin-shell.io/DataSpecificationTemplates/DataSpecificationIEC61360/3/0 + + + + + + + + + + + + ModelReference + + + + + + + + + + + + de + Muster AG + + + en + Muster AG + + + + ExternalReference + + + + + + + \ No newline at end of file From beee681fb8300af492f833bba90553f20718d5f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 10:09:45 +0000 Subject: [PATCH 33/73] Bump com.networknt:json-schema-validator from 1.3.0 to 1.3.1 Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.0 to 1.3.1. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.3.0...1.3.1) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 77c7c276c..c6c345cac 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.1.0 4.1.0 1.5.1 - 1.3.0 + 1.3.1 4.13.2 1.1.1 2.7.8 From 8c516b56d7eef92a99c7d03032d59cef49d3de10 Mon Sep 17 00:00:00 2001 From: sebbader-sap <107036549+sebbader-sap@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:41:52 +0100 Subject: [PATCH 34/73] Add AAS Part 2 / API Model Classes (#161) * add AAS Part 2 model classes & de-/serialization --- .../core/serialization/EnumSerializer.java | 5 +- .../aas4j/v3/dataformat/core/Examples.java | 2 +- .../v3/dataformat/json/JsonDeserializer.java | 304 +++++------------- .../v3/dataformat/json/JsonSerializer.java | 207 +++++------- .../AnnotatedRelationshipElementMixin.java | 30 -- .../mixins/AssetAdministrationShellMixin.java | 8 +- .../json/mixins/AssetInformationMixin.java | 13 +- .../v3/dataformat/json/mixins/BlobMixin.java | 3 +- .../json/mixins/ConceptDescriptionMixin.java | 30 -- .../DataSpecificationIec61360Mixin.java | 27 +- ...{PropertyMixin.java => EndpointMixin.java} | 15 +- .../dataformat/json/mixins/EntityMixin.java | 12 +- .../json/mixins/EnvironmentMixin.java | 14 +- .../json/mixins/ExtensionMixin.java | 3 +- .../v3/dataformat/json/mixins/FileMixin.java | 3 +- .../mixins/HasDataSpecificationMixin.java | 37 --- .../json/mixins/HasSemanticsMixin.java | 27 -- .../json/mixins/IdentifiableMixin.java | 3 +- .../v3/dataformat/json/mixins/KeyMixin.java | 8 +- .../mixins/MultiLanguagePropertyMixin.java | 37 --- .../json/mixins/OperationMixin.java | 42 --- .../json/mixins/OperationVariableMixin.java | 6 +- .../json/mixins/QualifierMixin.java | 11 +- .../v3/dataformat/json/mixins/RangeMixin.java | 3 +- .../json/mixins/ReferableMixin.java | 37 --- .../json/mixins/ReferenceMixin.java | 18 +- .../json/mixins/RelationshipElementMixin.java | 8 +- .../json/mixins/SpecificAssetIdMixin.java | 28 -- .../SubmodelElementCollectionMixin.java | 30 -- .../json/mixins/SubmodelElementListMixin.java | 41 +-- .../dataformat/json/mixins/SubmodelMixin.java | 43 --- .../json/mixins/ValueReferencePairMixin.java | 28 -- .../dataformat/json/JsonDeserializerTest.java | 239 ++++++++++++-- .../json/JsonReferableDeserializerTest.java | 149 --------- .../json/JsonReferableSerializerTest.java | 152 --------- .../dataformat/json/JsonSerializerTest.java | 257 +++++++++++---- .../ReflectionAnnotationIntrospectorTest.java | 17 +- .../v3/dataformat/json/util/ExampleData.java | 12 + .../v3/dataformat/json/util/Examples.java | 189 +++++++++-- .../AssetAdministrationShellDescriptor.json | 122 +++++++ .../resources/Environment-CustomDataSpec.json | 48 +++ .../src/test/resources/OperationRequest.json | 11 + .../src/test/resources/Submodel-List.json | 2 + .../test/resources/SubmodelDescriptor.json | 55 ++++ .../src/main/resources/AAS_ABAC.xsd | 167 ++++++++++ .../src/main/resources/IEC61360.xsd | 145 +++++++++ .../aas4j/v3/model/AbstractLangString.java | 6 +- .../v3/model/AssetAdministrationShell.java | 2 +- .../AssetAdministrationShellDescriptor.java | 199 ++++++++++++ .../aas4j/v3/model/BaseOperationResult.java | 65 ++++ .../aas4j/v3/model/ConceptDescription.java | 2 +- .../aas4j/v3/model/DataElement.java | 2 + .../aas4j/v3/model/Descriptor.java | 85 +++++ .../digitaltwin/aas4j/v3/model/Endpoint.java | 65 ++++ .../aas4j/v3/model/ExecutionState.java | 57 ++++ .../aas4j/v3/model/HasSemantics.java | 2 +- .../digitaltwin/aas4j/v3/model/Message.java | 116 +++++++ .../aas4j/v3/model/MessageTypeEnum.java | 47 +++ .../aas4j/v3/model/OperationHandle.java | 48 +++ .../aas4j/v3/model/OperationRequest.java | 84 +++++ .../aas4j/v3/model/OperationResult.java | 66 ++++ .../aas4j/v3/model/PackageDescription.java | 66 ++++ .../aas4j/v3/model/ProtocolInformation.java | 151 +++++++++ .../digitaltwin/aas4j/v3/model/Referable.java | 4 +- .../digitaltwin/aas4j/v3/model/Result.java | 50 +++ .../v3/model/SecurityAttributeObject.java | 82 +++++ .../aas4j/v3/model/SecurityTypeEnum.java | 42 +++ .../digitaltwin/aas4j/v3/model/Submodel.java | 2 +- .../aas4j/v3/model/SubmodelDescriptor.java | 134 ++++++++ .../aas4j/v3/model/SubmodelElement.java | 2 +- .../AnnotatedRelationshipElementBuilder.java | 110 +++---- .../AssetAdministrationShellBuilder.java | 44 +-- ...tAdministrationShellDescriptorBuilder.java | 231 +++++++++++++ .../builder/BaseOperationResultBuilder.java | 71 ++++ .../builder/BasicEventElementBuilder.java | 110 +++---- .../aas4j/v3/model/builder/BlobBuilder.java | 110 +++---- .../v3/model/builder/CapabilityBuilder.java | 110 +++---- .../builder/ConceptDescriptionBuilder.java | 44 +-- .../v3/model/builder/DescriptorBuilder.java | 93 ++++++ .../v3/model/builder/EndpointBuilder.java | 46 +++ .../aas4j/v3/model/builder/EntityBuilder.java | 110 +++---- .../aas4j/v3/model/builder/FileBuilder.java | 110 +++---- .../v3/model/builder/MessageBuilder.java | 79 +++++ .../builder/MultiLanguagePropertyBuilder.java | 110 +++---- .../v3/model/builder/OperationBuilder.java | 150 ++++----- .../model/builder/OperationHandleBuilder.java | 35 ++ .../builder/OperationRequestBuilder.java | 82 +++++ .../model/builder/OperationResultBuilder.java | 70 ++++ .../builder/PackageDescriptionBuilder.java | 58 ++++ .../v3/model/builder/PropertyBuilder.java | 110 +++---- .../builder/ProtocolInformationBuilder.java | 125 +++++++ .../aas4j/v3/model/builder/RangeBuilder.java | 110 +++---- .../builder/ReferenceElementBuilder.java | 110 +++---- .../builder/RelationshipElementBuilder.java | 110 +++---- .../aas4j/v3/model/builder/ResultBuilder.java | 47 +++ .../SecurityAttributeObjectBuilder.java | 58 ++++ .../v3/model/builder/SubmodelBuilder.java | 132 ++++---- .../builder/SubmodelDescriptorBuilder.java | 185 +++++++++++ .../SubmodelElementCollectionBuilder.java | 110 +++---- .../builder/SubmodelElementListBuilder.java | 110 +++---- .../DefaultAnnotatedRelationshipElement.java | 76 ++--- .../impl/DefaultAssetAdministrationShell.java | 28 +- ...ultAssetAdministrationShellDescriptor.java | 274 ++++++++++++++++ .../impl/DefaultBaseOperationResult.java | 124 +++++++ .../model/impl/DefaultBasicEventElement.java | 76 ++--- .../aas4j/v3/model/impl/DefaultBlob.java | 78 ++--- .../v3/model/impl/DefaultCapability.java | 76 ++--- .../model/impl/DefaultConceptDescription.java | 28 +- .../v3/model/impl/DefaultDescriptor.java | 126 ++++++++ .../aas4j/v3/model/impl/DefaultEndpoint.java | 106 ++++++ .../aas4j/v3/model/impl/DefaultEntity.java | 76 ++--- .../v3/model/impl/DefaultEventPayload.java | 2 +- .../aas4j/v3/model/impl/DefaultExtension.java | 4 +- .../aas4j/v3/model/impl/DefaultFile.java | 76 ++--- .../aas4j/v3/model/impl/DefaultMessage.java | 154 +++++++++ .../impl/DefaultMultiLanguageProperty.java | 76 ++--- .../aas4j/v3/model/impl/DefaultOperation.java | 76 ++--- .../v3/model/impl/DefaultOperationHandle.java | 89 +++++ .../model/impl/DefaultOperationRequest.java | 125 +++++++ .../v3/model/impl/DefaultOperationResult.java | 108 +++++++ .../model/impl/DefaultPackageDescription.java | 107 ++++++ .../aas4j/v3/model/impl/DefaultProperty.java | 76 ++--- .../impl/DefaultProtocolInformation.java | 189 +++++++++++ .../aas4j/v3/model/impl/DefaultRange.java | 76 ++--- .../model/impl/DefaultReferenceElement.java | 76 ++--- .../impl/DefaultRelationshipElement.java | 76 ++--- .../aas4j/v3/model/impl/DefaultResult.java | 92 ++++++ .../impl/DefaultSecurityAttributeObject.java | 122 +++++++ .../model/impl/DefaultSubmodelDescriptor.java | 222 +++++++++++++ .../DefaultSubmodelElementCollection.java | 76 ++--- 130 files changed, 7162 insertions(+), 2735 deletions(-) delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/{PropertyMixin.java => EndpointMixin.java} (68%) delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java delete mode 100644 dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java delete mode 100644 dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java create mode 100644 dataformat-json/src/test/resources/AssetAdministrationShellDescriptor.json create mode 100644 dataformat-json/src/test/resources/Environment-CustomDataSpec.json create mode 100644 dataformat-json/src/test/resources/OperationRequest.json create mode 100644 dataformat-json/src/test/resources/SubmodelDescriptor.json create mode 100644 dataformat-xml/src/main/resources/AAS_ABAC.xsd create mode 100644 dataformat-xml/src/main/resources/IEC61360.xsd create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BaseOperationResult.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ExecutionState.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageTypeEnum.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PackageDescription.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityAttributeObject.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityTypeEnum.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BaseOperationResultBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PackageDescriptionBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SecurityAttributeObjectBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBaseOperationResult.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSecurityAttributeObject.java create mode 100644 model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java index 425e9cfdc..56b88f1af 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java @@ -1,6 +1,6 @@ /* * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (c) 2023 SAP SE + * Copyright (C) 2023 SAP SE or an SAP affiliate company. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; import java.io.IOException; @@ -52,6 +53,8 @@ public void serialize(Enum value, JsonGenerator gen, SerializerProvider provider } } else if (value instanceof DataTypeIec61360) { gen.writeString(value.name().toUpperCase()); + } else if (value instanceof SecurityTypeEnum) { + gen.writeString(value.name().toUpperCase()); } else if (value instanceof Direction || value instanceof StateOfEvent) { gen.writeString(value.name().toLowerCase()); } else if (ReflectionHelper.ENUMS.contains(value.getClass())) { diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java index 941d292d6..437fa5065 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/Examples.java @@ -42,6 +42,7 @@ public class Examples { .id("something_142922d6") .extensions(new DefaultExtension.Builder() .name("something_aae6caf4") + .valueType(DataTypeDefXsd.STRING) .build()) .assetInformation(new DefaultAssetInformation.Builder() .assetKind(AssetKind.NOT_APPLICABLE) @@ -86,7 +87,6 @@ public class Examples { .build()) .build(); - public static final Environment ENVIRONMENT_WITH_DUMMYDATASPEC = new DefaultEnvironment.Builder() .submodels( new DefaultSubmodel.Builder() diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index ab6275d9e..785769cd9 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -16,128 +16,34 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; +import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.List; -import java.util.stream.Collectors; import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; - /** * Class for deserializing/parsing AAS JSON documents. */ public class JsonDeserializer { - protected JsonMapper mapper; protected SimpleAbstractTypeResolver typeResolver; private JsonMapperFactory jsonMapperFactory; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public JsonDeserializer() { typeResolver = new SimpleAbstractTypeResolverFactory().create(); jsonMapperFactory = new JsonMapperFactory(); mapper = jsonMapperFactory.create(typeResolver); } - /** - * Deserializes a given string into an instance of AssetAdministrationShellEnvironment - * - * @param value a string representation of the AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(String value) throws DeserializationException { - try { - return mapper.readValue(value, Environment.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); - } - } - - /** - * Deserializes a given JSON node into an instance of AssetAdministrationShellEnvironment - * - * @param root root node of the document to parse - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(JsonNode root) throws DeserializationException { - try { - return mapper.treeToValue(root, Environment.class); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex); - } - } - - /** - * Deserializes a given InputStream into an instance of AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param src an InputStream containing the string representation of the AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src) throws DeserializationException { - return read(src, DEFAULT_CHARSET); - } - - /** - * Deserializes a given InputStream into an instance of AssetAdministrationShellEnvironment using a given charset - * - * @param src An InputStream containing the string representation of the AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws DeserializationException if deserialization fails - */ - public Environment read(InputStream src, Charset charset) throws DeserializationException { - return read(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator()))); - } - - /** - * Deserializes a given File into an instance of AssetAdministrationShellEnvironment using DEFAULT_CHARSET - * - * @param file A java.io.File containing the string representation of the AssetAdministrationShellEnvironment - * @param charset the charset to use for deserialization - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file, Charset charset) - throws FileNotFoundException, DeserializationException { - return read(new FileInputStream(file), charset); - } - - /** - * Deserializes a given File into an instance of AssetAdministrationShellEnvironment using a given charset - * - * @param file a java.io.File containing the string representation of the AssetAdministrationShellEnvironment - * @return an instance of AssetAdministrationShellEnvironment - * @throws FileNotFoundException if the file is not present - * @throws DeserializationException if deserialization fails - */ - public Environment read(java.io.File file) throws FileNotFoundException, DeserializationException { - return read(file, DEFAULT_CHARSET); - } - - /** * Enables usage of custom implementation to be used for deserialization instead of default implementation, e.g. * defining a custom implementation of the Submodel interface {@code class @@ -156,192 +62,134 @@ public void useImplementation(Class aasInterface, Class impl } /** - * Deserializes a given string into an instance of the given Referable + * Generic method to deserialize a given string into instance of an AAS type * - * @param src a string representation of the Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable + * @param value a string representation of the AAS instance + * @param valueType the class type of the AAS instance. Not null. + * @param the AAS type + * @return the instance * @throws DeserializationException if deserialization fails */ - public T readReferable(String src, Class outputClass) throws DeserializationException { + public T read(String value, Class valueType) throws DeserializationException { try { - return mapper.readValue(src, outputClass); + return mapper.readValue(value, valueType); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing Referable", ex); + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); } } /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET + * Generic method to deserialize a given string into a list of AAS instances * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable + * @param value a string representation of the AAS instances list + * @param valueType the class type of the instance. Not null. + * @param the AAS type + * @return a list of AAS instances * @throws DeserializationException if deserialization fails */ - public T readReferable(InputStream src, Class outputClass) throws DeserializationException { - return readReferable(src, DEFAULT_CHARSET, outputClass); - } - - /** - * Deserializes a given input stream into an instance of the given Referable using DEFAULT_CHARSET - * - * @param root JSON node representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public T readReferable(JsonNode root, Class outputClass) throws DeserializationException { + public List readList(String value, Class valueType) throws DeserializationException { try { - return mapper.treeToValue(root, outputClass); + return mapper.readValue(value, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing Referable", ex); + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); } } /** - * Deserializes a given input stream into an instance of the given Referable + * Generic method to deserialize a given InputStream into instance of an AAS type, using the default UTF-8 charset * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable + * @param stream An InputStream containing the string representation of the AAS instance + * @param valueType the class type of the AAS instance. Not null. + * @param the AAS type + * @return an AAS instance * @throws DeserializationException if deserialization fails */ - public T readReferable(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferable(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); + public T read(InputStream stream, Class valueType) throws DeserializationException { + return read(stream, StandardCharsets.UTF_8, valueType); } /** - * Deserializes a given file into an instance of the given Referable using DEFAULT_CHARSET + * Generic method to deserialize a given InputStream into instance of an AAS type, using a given charset * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable + * @param stream An InputStream containing the string representation of the AAS instance + * @param charset the charset to use for deserialization + * @param valueType the class type of the AAS instance. Not null. + * @param the AAS type + * @return an AAS instance * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found */ - public T readReferable(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(src, DEFAULT_CHARSET, outputClass); + public T read(InputStream stream, Charset charset, Class valueType) throws DeserializationException { + try { + return mapper.readValue(new InputStreamReader(stream, charset), valueType); + } catch (IOException ex) { + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); + } } /** - * Deserializes a given file into an instance of the given Referable + * Deserializes a given input stream into a list of AAS instances using the default UTF-8 charset * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable + * @param stream An InputStream containing the string representation of the AAS instances list + * @param valueType the class type of the AAS instance. Not null. + * @param the AAS type + * @return a list of AAS instances * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found */ - public T readReferable(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferable(new FileInputStream(src), charset, outputClass); + public List readList(InputStream stream, Class valueType) throws DeserializationException { + return readList(stream, StandardCharsets.UTF_8, valueType); } /** - * Deserializes a given string into an instance of a list of the given Referables + * Deserializes a given input stream into a list of AAS instances * - * @param referables a string representation of an array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException if deserialization of referable fails + * @param stream An InputStream containing the string representation of the AAS instances list + * @param charset the charset to use for deserialization + * @param valueType the class type of the AAS instance. Not null. + * @param the AAS type + * @return a list of AAS instances + * @throws DeserializationException if deserialization fails */ - public List readReferables(String referables, Class outputClass) throws DeserializationException { + public List readList(InputStream stream, Charset charset, Class valueType) throws DeserializationException { try { - return mapper.readValue(referables, new TypeReference>() { - }); - } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referable", ex); + return mapper.readValue(new InputStreamReader(stream, charset), + mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (Exception ex) { + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); } } /** - * Deserializes a given string into an instance of a list of the given Referables + * Generic method to deserialize a given JSON node into instance of an AAS type + * + * @param node the node to parse + * @param valueType the class type of the AAS instance. Not null. + * @param the AAS type + * @return an AAS instance * - * @param root JSON node representation of an array of Referables - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of a list of the referables - * @throws DeserializationException if deserialization of referable fails + * @throws DeserializationException if deserialization fails */ - public List readReferables(JsonNode root, Class outputClass) throws DeserializationException { + public T read(JsonNode node, Class valueType) throws DeserializationException { try { - return mapper.treeToValue(root, mapper.getTypeFactory().constructCollectionLikeType(List.class, outputClass)); + return mapper.treeToValue(node, valueType); } catch (JsonProcessingException ex) { - throw new DeserializationException("error deserializing list of Referable", ex); + throw new DeserializationException("error deserializing " + valueType.getSimpleName(), ex); } } /** - * Deserializes a given input stream into an instance of a list of the given Referable using DEFAULT_CHARSET - * - * @param src a input stream representing a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Class outputClass) throws DeserializationException { - return readReferables(src, DEFAULT_CHARSET, outputClass); - } - - /** - * Deserializes a given input stream into an instance of a list of the given Referable - * - * @param src a input stream representing a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - */ - public List readReferables(InputStream src, Charset charset, Class outputClass) throws DeserializationException { - return readReferables(new BufferedReader( - new InputStreamReader(src, charset)) - .lines() - .collect(Collectors.joining(System.lineSeparator())), - outputClass); - } - - /** - * Deserializes a given file into an instance of a list of the given Referable using DEFAULT_CHARSET + * Deserializes a given JsonArray into a list of AAS instances * - * @param src a file containing string representation of a Referable - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable + * @param node a JsonArray representing the AAS instances list + * @param valueType the class type of the instance. Not null. + * @param the AAS type + * @return a list of AAS instances * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found */ - public List readReferables(File src, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(src, DEFAULT_CHARSET, outputClass); - } - - /** - * Deserializes a given file into an instance of a list of the given Referable - * - * @param src a file containing string representation of a Referable - * @param charset the charset to use - * @param outputClass most specific class of the given Referable - * @param type of the returned element - * @return an instance of the referable - * @throws DeserializationException if deserialization fails - * @throws java.io.FileNotFoundException if file is not found - */ - public List readReferables(File src, Charset charset, Class outputClass) throws DeserializationException, FileNotFoundException { - return readReferables(new FileInputStream(src), charset, outputClass); + public List readList(JsonNode node, Class valueType) throws DeserializationException { + try { + return mapper.treeToValue(node, mapper.getTypeFactory().constructCollectionLikeType(List.class, valueType)); + } catch (JsonProcessingException ex) { + throw new DeserializationException("error deserializing list of " + valueType.getSimpleName(), ex); + } } - } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 993ee925d..527468176 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -16,8 +16,6 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import java.io.OutputStreamWriter; @@ -27,194 +25,145 @@ import java.util.List; import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectWriter; import com.fasterxml.jackson.databind.json.JsonMapper; +import com.fasterxml.jackson.databind.node.ArrayNode; +import com.fasterxml.jackson.databind.node.JsonNodeFactory; /** - * Class for serializing an instance of AssetAdministrationShellEnvironment or Referables to - * JSON. + * Class for serializing of AAS instances. */ public class JsonSerializer { - protected JsonMapper mapper; - private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - public JsonSerializer() { mapper = new JsonMapperFactory().create(new SimpleAbstractTypeResolverFactory().create()); } /** - * Serializes a given instance of AssetAdministrationShellEnvironment to string + * Generic method to serialize a given AAS instance to a string * - * @param aasEnvironment the AssetAdministrationShellEnvironment to serialize - * @return the string representation of the environment + * @param aasInstance the AAS instance to serialize + * @return the string representation * @throws SerializationException if serialization fails */ - public String write(Environment aasEnvironment) throws SerializationException { + public String write(Object aasInstance) throws SerializationException { try { - return mapper.writeValueAsString(aasEnvironment); + return mapper.writeValueAsString(aasInstance); } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing AssetAdministrationShellEnvironment", ex); + throw new SerializationException( + String.format("error serializing %s", aasInstance.getClass().getSimpleName()), ex); } } /** - * Converts a given instance of AssetAdministrationShellEnvironment as JSON node. - * - * @param aasEnvironment the AssetAdministrationShellEnvironment to serialize - * @return the JSON node representation of the environment - */ - public JsonNode toNode(Environment aasEnvironment) { - return mapper.valueToTree(aasEnvironment); - } - - /** - * Serializes a given instance of Environment to an OutputStream using DEFAULT_CHARSET - * - * @param out the Outputstream to serialize to - * @param aasEnvironment the Environment to serialize - * @throws IOException if writing to the stream fails + * Generic method to serialize a collection. + * @param collection the collection to serialize. Not null. + * @return the string representation of the collection. * @throws SerializationException if serialization fails */ - void write(OutputStream out, Environment aasEnvironment) throws IOException, SerializationException { - write(out, DEFAULT_CHARSET, aasEnvironment); - } + public String writeList(Collection collection) throws SerializationException { + if (collection == null || collection.isEmpty()) { + return write(collection); + } - /** - * Serializes a given instance of Environment to an OutputStream using given charset - * - * @param out the Outputstream to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to serialize - * @throws IOException if writing to the stream fails - * @throws SerializationException if serialization fails - */ - void write(OutputStream out, Charset charset, Environment aasEnvironment) - throws IOException, SerializationException { - try (OutputStreamWriter writer = new OutputStreamWriter(out, charset)) { - writer.write(write(aasEnvironment)); + Class clazz = collection.iterator().next().getClass(); + try { + return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, clazz)) + .writeValueAsString(collection); + } catch (JsonProcessingException ex) { + throw new SerializationException("error serializing list of " + clazz.getSimpleName(), ex); } } - // Note that the AAS also defines a file class /** - * Serializes a given instance of Environment to a java.io.File using DEFAULT_CHARSET + * Generic method to convert a given AAS instance to a JSON node * - * @param file the java.io.File to serialize to - * @param charset the Charset to use for serialization - * @param aasEnvironment the Environment to serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails + * @param aasInstance the AAS instance to serialize + * @return the JSON node representation + * @throws IllegalArgumentException */ - void write(java.io.File file, Charset charset, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - try (OutputStream out = new FileOutputStream(file)) { - write(out, charset, aasEnvironment); - } + public JsonNode toNode(Object aasInstance) { + return mapper.valueToTree(aasInstance); } /** - * Serializes a given instance of Environment to a java.io.File using given charset + * Generic method to convert a collection of AAS instances to a JSON array * - * @param file the java.io.File to serialize to - * @param aasEnvironment the Environment to serialize - * @throws FileNotFoundException if the fail does not exist - * @throws IOException if writing to the file fails - * @throws SerializationException if serialization fails + * @param aasInstances the list of AAS instances to convert + * @return the JSON array representation + * @throws IllegalArgumentException */ - void write(java.io.File file, Environment aasEnvironment) - throws FileNotFoundException, IOException, SerializationException { - write(file, DEFAULT_CHARSET, aasEnvironment); + public JsonNode toArrayNode(Collection aasInstances) { + if(aasInstances == null) { + return JsonNodeFactory.instance.nullNode(); + } + ArrayNode result = JsonNodeFactory.instance.arrayNode(); + for (Object obj : aasInstances) { + result.add(toNode(obj)); + } + return result; } /** - * Serializes a given instance of a Referable to string + * Generic method to serialize a given AAS instance to an output stream using given charset * - * @param referable the referable to serialize - * @return the string representation of the referable + * @param out the output stream to serialize to + * @param charset the charset to use for serialization + * @param aasInstance the AAS instance to serialize * @throws SerializationException if serialization fails */ - public String write(Referable referable) throws SerializationException { + public void write(OutputStream out, Charset charset, Object aasInstance) throws SerializationException { try { - return mapper.writeValueAsString(referable); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); + mapper.writeValue(new OutputStreamWriter(out, charset), aasInstance); + } catch (IOException ex) { + throw new SerializationException("error serializing " + aasInstance.getClass().getSimpleName() , ex); } } /** - * Converts a given instance of a Referable to a JSON node. + * Generic method to serialize a given AAS instance to an output stream using UTF-8 charset * - * @param referable the referable to serialize - * @return the JSON node representation of the referable + * @param out the output stream to serialize to + * @param aasInstance the AAS instance to serialize + * @throws SerializationException if serialization fails */ - public JsonNode toNode(Referable referable) { - return mapper.valueToTree(referable); + public void write(OutputStream out, Object aasInstance) throws SerializationException { + write(out, StandardCharsets.UTF_8, aasInstance); } /** + * Generic method to serialize a collection of AAS instances to an output stream using given charset * - * @param referables the referables to serialize - * @return the string representation of the list of referables + * @param out the output stream to serialize to + * @param charset the charset to use for serialization + * @param collection the collection of AAS instances to serialize * @throws SerializationException if serialization fails */ - public String write(Collection referables) throws SerializationException { - if (referables == null) { - return null; - } else if (referables.isEmpty()) { - return mapper.createArrayNode().toString(); - } - - try { - return mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.iterator().next().getClass())) - .writeValueAsString(referables); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); + public void writeList(OutputStream out, Charset charset, Collection collection) throws SerializationException { + if (collection == null || collection.isEmpty()) { + write(out, charset, collection); + } else { + Class clazz = collection.iterator().next().getClass(); + try { + mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, clazz)) + .writeValue(new OutputStreamWriter(out, charset), collection); + } catch (IOException ex) { + throw new SerializationException("error serializing list of " + clazz.getSimpleName(), ex); + } } } /** + * Generic method to serialize a collection of AAS instances to an output stream using UTF-8 charset * - * @param referables the referables to serialize - * @return the string representation of the list of referables + * @param out the output stream to serialize to + * @param collection the collection of AAS instances to serialize + * @throws SerializationException if serialization fails */ - public JsonNode toNode(Collection referables) { - if (referables == null) { - return null; - } else if (referables.isEmpty()) { - return mapper.createArrayNode(); - } - return mapper.valueToTree(referables); - } - - public String writeReferable(Referable referable) throws SerializationException { - try { - return mapper.writeValueAsString(mapper.valueToTree(referable)); - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing Referable", ex); - } - } - - public String writeReferables(List referables) throws SerializationException { - if(referables.isEmpty()){ - return "[]"; - } - - try { - ObjectWriter objectWriter = mapper.writerFor(mapper.getTypeFactory().constructCollectionType(List.class, referables.get(0).getClass())); - String json = objectWriter.writeValueAsString(referables); - - return mapper.writeValueAsString(this.mapper.readTree(json)); - - } catch (JsonProcessingException ex) { - throw new SerializationException("error serializing list of Referables", ex); - } + public void writeList(OutputStream out, Collection collection) throws SerializationException { + writeList(out, StandardCharsets.UTF_8, collection); } -} +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java deleted file mode 100644 index 434115819..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AnnotatedRelationshipElementMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; - -import java.util.List; - -public interface AnnotatedRelationshipElementMixin { - - @JsonProperty("annotations") - public List getAnnotations(); - - @JsonProperty("annotations") - public void setAnnotations(List annotations); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java index 01f4f53a1..b71c21b9e 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java @@ -15,11 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; -public interface AssetAdministrationShellMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface AssetAdministrationShellMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetInformation getAssetInformation(); -} + AssetInformation getAssetInformation(); +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java index 810b7232c..d5fc45b33 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java @@ -15,18 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; -public interface AssetInformationMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface AssetInformationMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public AssetKind getAssetKind(); - - @JsonProperty("globalAssetId") - public String getGlobalAssetId(); - - @JsonProperty("globalAssetId") - public void setGlobalAssetId(String globalAssetId); + AssetKind getAssetKind(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java index 7dec06cbe..23ed61c3f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface BlobMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getMimeType(); + String getMimeType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java deleted file mode 100644 index 3b31ea790..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ConceptDescriptionMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -public interface ConceptDescriptionMixin { - - @JsonProperty("isCaseOf") - public List getIsCaseOf(); - - @JsonProperty("isCaseOf") - public void setIsCaseOf(List isCaseOf); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java index 2d3281b2c..9653720d3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java @@ -15,32 +15,13 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; -import org.eclipse.digitaltwin.aas4j.v3.model.LevelType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - import java.util.List; -public interface DataSpecificationIec61360Mixin { - - @JsonProperty("levelType") - public List getLevelTypes(); +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; - @JsonProperty("levelType") - public void setLevelTypes(List levelTypes); +import com.fasterxml.jackson.annotation.JsonInclude; +public interface DataSpecificationIec61360Mixin { @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("preferredName") - public List getPreferredName(); - - @JsonProperty("preferredName") - public void setPreferredName(List preferredName); - - @JsonProperty("unitId") - public Reference getUnitId(); - - @JsonProperty("unitId") - public void setUnitId(Reference unitId); + List getPreferredName(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java similarity index 68% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java index 328276991..da1f46232 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/PropertyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java @@ -1,5 +1,6 @@ /* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * + * Copyright (C) 2023 SAP SE or an SAP affiliate company. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -16,13 +17,11 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface PropertyMixin { - @JsonProperty("valueId") - public Reference getValueId(); +public interface EndpointMixin { + @JsonProperty("interface") + String get_interface(); - @JsonProperty("valueId") - public void setValueId(Reference valueId); + @JsonProperty("interface") + void set_interface(String _interface); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java index edc862bf9..189a273ce 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java @@ -15,18 +15,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; +import com.fasterxml.jackson.annotation.JsonInclude; + public interface EntityMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public EntityType getEntityType(); - - @JsonProperty("globalAssetId") - public String getGlobalAssetId(); - - @JsonProperty("globalAssetId") - public void setGlobalAssetId(String globalAssetId); + EntityType getEntityType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java index c4aacb2c8..11261f1b3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java @@ -15,22 +15,22 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; +import java.util.List; +import java.util.Set; + import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import java.util.List; -import java.util.Set; +import com.fasterxml.jackson.annotation.JsonInclude; public interface EnvironmentMixin { - @JsonInclude(JsonInclude.Include.NON_EMPTY) - public Set getAssetAdministrationShells(); + Set getAssetAdministrationShells(); @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getSubmodels(); + List getSubmodels(); @JsonInclude(JsonInclude.Include.NON_EMPTY) - public List getConceptDescriptions(); + List getConceptDescriptions(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java index f169a29ed..06240b00a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface ExtensionMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getName(); + String getName(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java index 91b903b08..e32942542 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface FileMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getContentType(); + String getContentType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java deleted file mode 100644 index ddf50345a..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasDataSpecificationMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -public interface HasDataSpecificationMixin { - - @JsonProperty("embeddedDataSpecifications") - public List getEmbeddedDataSpecifications(); - - @JsonProperty("embeddedDataSpecifications") - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications); - - @JsonProperty("dataSpecifications") - public List getDataSpecifications(); - - @JsonProperty("dataSpecifications") - public void setDataSpecifications(List dataSpecifications); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java deleted file mode 100644 index 574e3e035..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/HasSemanticsMixin.java +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2023 jab. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface HasSemanticsMixin { - @JsonProperty("semanticId") - public Reference getSemanticId(); - - @JsonProperty("semanticId") - public void setSemanticId(Reference semanticId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java index 301a31bc6..96d0dfd8d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface IdentifiableMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getId(); + String getId(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java index fbbe1f0e2..26de3024d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java @@ -15,14 +15,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; -public interface KeyMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface KeyMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public KeyTypes getType(); + KeyTypes getType(); @JsonInclude(JsonInclude.Include.ALWAYS) - public String getValue(); + String getValue(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java deleted file mode 100644 index 50f7c3383..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/MultiLanguagePropertyMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.util.List; - -public interface MultiLanguagePropertyMixin { - - @JsonProperty("value") - public List getValue(); - - @JsonProperty("value") - public void setValue(LangStringTextType value); - - @JsonProperty("valueId") - public Reference getValueId(); - - @JsonProperty("valueId") - public void setValueId(Reference valueId); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java deleted file mode 100644 index ffb0316f7..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationMixin.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - -import java.util.List; - -public interface OperationMixin { - - @JsonProperty("inputVariables") - public List getInputVariables(); - - @JsonProperty("inputVariables") - public void setInputVariables(List inputVariables); - - @JsonProperty("inoutputVariables") - public List getInoutputVariables(); - - @JsonProperty("inoutputVariables") - public void setInoutputVariables(List inoutputVariables); - - @JsonProperty("outputVariables") - public List getOutputVariables(); - - @JsonProperty("outputVariables") - public void setOutputVariables(List outputVariables); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java index 33ca567e1..aec20388d 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java @@ -15,11 +15,11 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -public interface OperationVariableMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface OperationVariableMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public SubmodelElement getValue(); + SubmodelElement getValue(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java index 3e1efbdef..53f937f59 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java @@ -16,17 +16,8 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; public interface QualifierMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getType(); - - @JsonProperty("valueId") - public Reference getValueId(); - - @JsonProperty("valueId") - public void setValueId(Reference valueId); + String getType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java index 49fdef609..d7b609ac4 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java @@ -18,7 +18,6 @@ import com.fasterxml.jackson.annotation.JsonInclude; public interface RangeMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - public String getValueType(); + String getValueType(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java deleted file mode 100644 index d93eb2c17..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferableMixin.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; - -import java.util.List; - -public interface ReferableMixin { - - @JsonProperty("description") - public List getDescription(); - - @JsonProperty("description") - public void setDescription(List description); - - @JsonProperty("displayName") - public List getDisplayName(); - - @JsonProperty("displayName") - public void setDisplayName(List displayNames); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java index 9105bc8bf..222de6026 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java @@ -15,23 +15,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; +import java.util.List; + import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; -import java.util.List; +import com.fasterxml.jackson.annotation.JsonInclude; public interface ReferenceMixin { - @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("keys") - public List getKeys(); + List getKeys(); @JsonInclude(JsonInclude.Include.ALWAYS) - @JsonProperty("type") - public ReferenceTypes getType(); - - @JsonProperty("type") - public void setType(ReferenceTypes type); -} + ReferenceTypes getType(); +} \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java index 04abbe3a3..cc3adb685 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java @@ -15,14 +15,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; -import com.fasterxml.jackson.annotation.JsonInclude; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -public interface RelationshipElementMixin { +import com.fasterxml.jackson.annotation.JsonInclude; +public interface RelationshipElementMixin { @JsonInclude(JsonInclude.Include.ALWAYS) - public Reference getFirst(); + Reference getFirst(); @JsonInclude(JsonInclude.Include.ALWAYS) - public Reference getSecond(); + Reference getSecond(); } diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java deleted file mode 100644 index ae379d373..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SpecificAssetIdMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 jab. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface SpecificAssetIdMixin { - - @JsonProperty("externalSubjectId") - public Reference getExternalSubjectId(); - - @JsonProperty("externalSubjectId") - public void setExternalSubjectId(Reference reference); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java deleted file mode 100644 index f56304f81..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementCollectionMixin.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.Collection; - -public interface SubmodelElementCollectionMixin { - - @JsonProperty("value") - public Collection getValue(); - - @JsonProperty("value") - public void setValue(Collection values); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java index 7f3492674..3ea2fa1b1 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java @@ -17,45 +17,8 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; - -import java.util.Collection; public interface SubmodelElementListMixin { - - @JsonInclude(JsonInclude.Include.NON_DEFAULT) - @JsonProperty("orderRelevant") - public boolean getOrdered(); - - @JsonInclude(JsonInclude.Include.NON_DEFAULT) - @JsonProperty("orderRelevant") - public void setOrdered(boolean orderRelevant); - - @JsonProperty("semanticIdListElement") - public Reference getSemanticIdListElement(); - - @JsonProperty("semanticIdListElement") - public void setSemanticIdListElement(Reference semanticIdListElement); - - @JsonProperty("typeValueListElement") - public AasSubmodelElements getTypeValueListElement(); - - @JsonProperty("typeValueListElement") - public void setTypeValueListElement(AasSubmodelElements typeValueListElement); - - @JsonProperty("valueTypeListElement") - public DataTypeDefXsd getValueTypeListElement(); - - @JsonProperty("valueTypeListElement") - public void setValueTypeListElement(DataTypeDefXsd valueTypeListElement); - - @JsonProperty("value") - public Collection getValue(); - - @JsonProperty("value") - public void setValue(Collection value); + @JsonInclude(JsonInclude.Include.ALWAYS) + boolean getOrderRelevant(); } \ No newline at end of file diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java deleted file mode 100644 index 1d8f7a03c..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelMixin.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; -import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; - -import java.util.List; - -public interface SubmodelMixin { - @JsonProperty("idShort") - public String getIdShort(); - - @JsonProperty("idShort") - public void setIdShort(String idShort); - - @JsonProperty("description") - public List getDescription(); - - @JsonProperty("description") - public void setDescription(List description); - - @JsonProperty("displayName") - public List getDisplayName(); - - @JsonProperty("displayName") - public void setDisplayName(List displayName); -} diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java deleted file mode 100644 index 8a8b08338..000000000 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ValueReferencePairMixin.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright 2023 jab. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; - -import com.fasterxml.jackson.annotation.JsonProperty; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -public interface ValueReferencePairMixin { - - @JsonProperty("valueId") - public Reference getValueId(); - - @JsonProperty("valueId") - public void setValueId(Reference valueId); -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index b4f819499..45761420b 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -15,67 +15,242 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import com.fasterxml.jackson.databind.node.JsonNodeFactory; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Property; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; -import org.junit.Assert; + +import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Test; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNull; public class JsonDeserializerTest { + private static JsonDeserializer deserializerToTest; - @Test - public void testReadFromFile() throws Exception { - new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); - } - - @Test - public void testSimpleExample() throws Exception { - Environment expected = Examples.EXAMPLE_SIMPLE.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_SIMPLE.fileContentStream()); - Assert.assertEquals(expected, actual); + @BeforeClass + public static void initialize() { + deserializerToTest = new JsonDeserializer(); } @Test - public void testFullExample() throws Exception { - Environment expected = Examples.EXAMPLE_FULL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXAMPLE_FULL.fileContentStream()); - Assert.assertEquals(expected, actual); - } - - @Test - public void testFullExampleFromNode() throws Exception { - Environment expected = Examples.EXAMPLE_FULL.getModel(); - JsonNode node = new ObjectMapper().readTree(Examples.EXAMPLE_FULL.fileContentStream()); - Environment actual = new JsonDeserializer().read(node); - Assert.assertEquals(expected, actual); + public void testReadCustomDataSpecification() throws DeserializationException { + JsonDeserializer deserializer = new JsonDeserializer(); + deserializer.useImplementation(DataSpecificationContent.class, DefaultDummyDataSpecification.class); + Environment env = deserializer.read(Examples.ENVIRONMENT_CUSTOM_DATA.fileContentStream(), Environment.class); + assertEquals(Examples.ENVIRONMENT_CUSTOM_DATA.getModel(), env); } @Test - public void testCustomImplementationClass() throws Exception { - String json = new JsonSerializer().write(AASSimple.createEnvironment()); + public void testReadCustomImplementationClass() throws Exception { + String json = Examples.EXAMPLE_SIMPLE.fileContent(); + // As we test useImplementation(), we need to create a new deserializer here. JsonDeserializer deserializer = new JsonDeserializer(); - Environment environment = deserializer.read(json); + Environment environment = deserializer.read(json, Environment.class); checkImplementationClasses(environment, DefaultSubmodel.class, DefaultProperty.class); deserializer.useImplementation(Submodel.class, CustomSubmodel.class); deserializer.useImplementation(Property.class, CustomProperty.class); - environment = deserializer.read(json); + environment = deserializer.read(json, Environment.class); checkImplementationClasses(environment, CustomSubmodel.class, CustomProperty.class); deserializer.useImplementation(Submodel.class, CustomSubmodel2.class); - environment = deserializer.read(json); + environment = deserializer.read(json, Environment.class); checkImplementationClasses(environment, CustomSubmodel2.class, CustomProperty.class); } + @Test + @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") + public void testReadConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { + ConceptDescription expected = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.getModel(); + ConceptDescription actual = deserializerToTest.read( + Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT.fileContentStream(), + ConceptDescription.class); + assertEquals(expected, actual); + } + + @Test + public void testReadNull() throws DeserializationException { + assertNull(deserializerToTest.read("null", Submodel.class)); + assertNull(deserializerToTest.readList("null", Submodel.class)); + + + assertNull(deserializerToTest.read(JsonNodeFactory.instance.nullNode(), Submodel.class)); + assertNull(deserializerToTest.readList(JsonNodeFactory.instance.nullNode(), Submodel.class)); + + ByteArrayInputStream bais = new ByteArrayInputStream("null".getBytes()); + assertNull(deserializerToTest.read(bais, Submodel.class)); + + bais = new ByteArrayInputStream("null".getBytes()); + assertNull(deserializerToTest.readList(bais, Submodel.class)); + } + + @Test + public void testReadEmptyReferableList() throws DeserializationException { + List emptyList = Collections.emptyList(); + + List deserialized = deserializerToTest.readList("[]", Referable.class); + assertEquals(emptyList, deserialized); + + deserialized = deserializerToTest.readList(JsonNodeFactory.instance.arrayNode(), Referable.class); + assertEquals(emptyList, deserialized); + + ByteArrayInputStream bais = new ByteArrayInputStream("[]".getBytes()); + assertEquals(emptyList, deserializerToTest.readList(bais, Submodel.class)); + } + + @Test + public void testReadFullExampleEnv() { + readAndCompare(Examples.EXAMPLE_FULL); + } + + @Test + public void testReadSimpleExampleEnv() { + readAndCompare(Examples.EXAMPLE_SIMPLE); + } + + @Test + public void testReadShell() { + readAndCompare(Examples.ASSET_ADMINISTRATION_SHELL); + } + + @Test + public void testReadShells() { + readAndCompare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); + } + + @Test + public void testReadSubmodel() { + readAndCompare(Examples.SUBMODEL); + } + + @Test + public void testReadSubmodels() { + readAndCompare(Examples.SUBMODEL_LIST_OF); + } + + @Test + public void testReadSubmodelElement() { + readAndCompare(Examples.SUBMODEL_ELEMENT); + } + + @Test + public void testReadSubmodelElements() { + readAndCompare(Examples.SUBMODEL_ELEMENT_LIST_OF); + } + + @Test + public void testReadSubmodelElementList() { + readAndCompare(Examples.SUBMODEL_ELEMENT_LIST); + } + + @Test + public void testReadSubmodelElementCollection() { + readAndCompare(Examples.SUBMODEL_ELEMENT_COLLECTION); + } + + @Test + public void testReadExtensionMinimalEnv() { + readAndCompare(Examples.EXTENSION_MINIMAL); + } + + @Test + public void testReadExtensionMaximalEnv() { + readAndCompare(Examples.EXTENSION_MAXIMAL); + } + + @Test + public void testReadShellDescriptor() { + readAndCompare(Examples.SHELL_DESCRIPTOR); + } + + @Test + public void testReadOperationRequest() { + readAndCompare(Examples.OPERATION_REQUEST); + } + + @Test + public void testReadShellDescriptors() throws IOException, DeserializationException { + String jsonString = "[" + Examples.SHELL_DESCRIPTOR.fileContent() + "]"; + List shellDescriptors = + deserializerToTest.readList(jsonString, AssetAdministrationShellDescriptor.class); + assertEquals(Examples.SHELL_DESCRIPTOR.getModel(), shellDescriptors.get(0)); + } + + @Test + public void testReadSubmodelDescriptor() { + readAndCompare(Examples.SUBMODEL_DESCRIPTOR); + } + + @Test + public void testReadSubmodelDescriptors() throws IOException, DeserializationException { + String jsonString = "[" + Examples.SUBMODEL_DESCRIPTOR.fileContent() + "]"; + List submodelDescriptors = + deserializerToTest.readList(jsonString, SubmodelDescriptor.class); + assertEquals(Examples.SUBMODEL_DESCRIPTOR.getModel(), submodelDescriptors.get(0)); + } + + private void readAndCompare(ExampleData exampleData) { + try { + Object expected = exampleData.getModel(); + assertEquals(expected, readFromString(exampleData)); + assertEquals(expected, readFromNode(exampleData)); + assertEquals(expected, readFromStream(exampleData)); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + private Object readFromString(ExampleData exampleData) throws IOException, DeserializationException { + Object model = exampleData.getModel(); + if(model instanceof Collection) { + Collection coll = (Collection) model; + return deserializerToTest.readList(exampleData.fileContent(), coll.iterator().next().getClass()); + } + return deserializerToTest.read(exampleData.fileContent(), model.getClass()); + } + + private Object readFromStream(ExampleData exampleData) throws DeserializationException { + Object model = exampleData.getModel(); + if(model instanceof Collection) { + Collection coll = (Collection) model; + return deserializerToTest.readList(exampleData.fileContentStream(), coll.iterator().next().getClass()); + } + return deserializerToTest.read(exampleData.fileContentStream(), model.getClass()); + } + + private Object readFromNode(ExampleData exampleData) throws IOException, DeserializationException { + Object model = exampleData.getModel(); + if(model instanceof Collection) { + Collection coll = (Collection) model; + return deserializerToTest.readList(exampleData.getJsonNode(), coll.iterator().next().getClass()); + } + return deserializerToTest.read(exampleData.getJsonNode(), model.getClass()); + } + private void checkImplementationClasses(Environment environment, Class submodelImpl, Class propertyImpl) { environment.getSubmodels().forEach(submodel -> { @@ -85,4 +260,4 @@ private void checkImplementationClasses(Environment environment, .forEach(element -> assertEquals(element.getClass(), propertyImpl)); }); } -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java deleted file mode 100644 index bb21cfec8..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java +++ /dev/null @@ -1,149 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; -import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; -import java.util.List; - -import static org.junit.Assert.assertEquals; - - -public class JsonReferableDeserializerTest { - - @Test - public void testReadAAS() throws IOException, DeserializationException { - AssetAdministrationShell expected = Examples.ASSET_ADMINISTRATION_SHELL.getModel(); - AssetAdministrationShell actual = new JsonDeserializer().readReferable(Examples.ASSET_ADMINISTRATION_SHELL.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); - } - - @Test - public void testReadAASs() throws IOException, DeserializationException { - List expected = Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF.fileContentStream(), AssetAdministrationShell.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodel() throws IOException, DeserializationException { - Submodel expected = Examples.SUBMODEL.getModel(); - Submodel actual = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodels() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables(Examples.SUBMODEL_LIST_OF.fileContentStream(), Submodel.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelElement() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT.getModel(); - SubmodelElement actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelElements() throws IOException, DeserializationException { - List expected = Examples.SUBMODEL_ELEMENT_LIST_OF.getModel(); - List actual = new JsonDeserializer().readReferables( - Examples.SUBMODEL_ELEMENT_LIST_OF.fileContentStream(), SubmodelElement.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelElementList() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_LIST.getModel(); - SubmodelElementList actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_LIST.fileContentStream(), SubmodelElementList.class); - assertEquals(expected, actual); - } - - @Test - public void testReadSubmodelElementCollection() throws IOException, DeserializationException { - SubmodelElement expected = Examples.SUBMODEL_ELEMENT_COLLECTION.getModel(); - SubmodelElementCollection actual = new JsonDeserializer().readReferable(Examples.SUBMODEL_ELEMENT_COLLECTION.fileContentStream(), SubmodelElementCollection.class); - assertEquals(expected, actual); - } - - @Test - public void testReadEmptyReferableList() throws DeserializationException { - List emptyList = Collections.emptyList(); - List deserialized = new JsonDeserializer().readReferables("[]", Referable.class); - assertEquals(emptyList, deserialized); - } - - @Test - @Ignore("Physical Unit has been removed from the V3.0 metamodel. Might be added later again.") - public void testDeserializeConceptDescriptionWithPhysicalUnit() throws IOException, DeserializationException { - ExampleData exampleData = Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT; - Object expected = exampleData.getModel(); - try (InputStream fileContent = exampleData.fileContentStream()) { - Object actual = new JsonDeserializer().readReferable(fileContent, (Class) exampleData.getModel().getClass()); - Assert.assertEquals(expected, actual); - } - } - - - @Test - public void testPropertyFromNode() throws Exception { - Property expected = new DefaultProperty.Builder() - .idShort("exampleId") - .build(); - ObjectNode input = JsonNodeFactory.instance.objectNode(); - input.put("idShort", "exampleId"); - input.put("modelType", "Property"); - Property actual = new JsonDeserializer().readReferable(input, Property.class); - assertEquals(expected, actual); - } - - @Test - public void testExtensionMinimal() throws Exception { - Environment expected = Examples.EXTENSION_MINIMAL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXTENSION_MINIMAL.fileContentStream()); - assertEquals(expected, actual); - } - - @Test - public void testExtensionMaximal() throws Exception { - Environment expected = Examples.EXTENSION_MAXIMAL.getModel(); - Environment actual = new JsonDeserializer().read(Examples.EXTENSION_MAXIMAL.fileContentStream()); - assertEquals(expected, actual); - } -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java deleted file mode 100644 index 1ff5d1114..000000000 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. - * Copyright (C) 2023 SAP SE or an SAP affiliate company. - * - * 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.eclipse.digitaltwin.aas4j.v3.dataformat.json; - -import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; -import org.eclipse.digitaltwin.aas4j.v3.model.Environment; -import org.eclipse.digitaltwin.aas4j.v3.model.Property; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultExtension; -import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; -import org.json.JSONException; -import org.junit.Assert; -import org.junit.Ignore; -import org.junit.Test; -import org.skyscreamer.jsonassert.JSONAssert; -import org.skyscreamer.jsonassert.JSONCompareMode; - -import java.io.IOException; -import java.util.Collection; - -public class JsonReferableSerializerTest { - - @Test - public void testSerializeAAS() throws IOException, SerializationException, JSONException { - compare(Examples.ASSET_ADMINISTRATION_SHELL); - } - - @Test - public void testSerializeAASWithAssetInformation() throws SerializationException, JSONException, IOException { - compare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); - } - - @Test - public void testSerializeAASs() throws IOException, SerializationException, JSONException { - compare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); - } - - @Test - @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") - public void testSerializeConceptDescriptionWithPhysicalUnit() throws IOException, SerializationException, JSONException { - compare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); - } - - @Test - public void testSerializeSubmodel() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL); - } - - @Test - public void testSerializeSubmodelWithExtensions() throws DeserializationException, SerializationException, JsonProcessingException { - Submodel submodel = new JsonDeserializer().readReferable(Examples.SUBMODEL.fileContentStream(), Submodel.class); - submodel.getExtensions().add(new DefaultExtension.Builder() - .name("myExtension").value("my extension value").valueType(DataTypeDefXsd.STRING) - .build()); - JsonNode jsonNode = new ObjectMapper().readTree(new JsonSerializer().writeReferable(submodel)); - Assert.assertTrue(jsonNode.has("extensions")); - } - - - @Test - public void testSerializeSubmodelList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); - } - - @Test - public void testSerializeSubmodelElement() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT); - } - - @Test - public void testSerializeSubmodelElements() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST_OF); - } - - @Test - public void testSerializeSubmodelElementCollection() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_COLLECTION); - } - - @Test - public void testSerializeSubmodelElementList() throws IOException, SerializationException, JSONException { - compare(Examples.SUBMODEL_ELEMENT_LIST); - } - - @Test - public void testSerializeSubmodelElementListEmpty() throws SerializationException, JSONException, IOException { - compare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); - } - - @Test - public void testSerializePropertyToNode() throws IOException, SerializationException, JSONException { - Property property = new DefaultProperty.Builder() - .idShort("exampleId") - .build(); - ObjectNode expected = JsonNodeFactory.instance.objectNode(); - expected.put("idShort", "exampleId"); - expected.put("modelType", "Property"); - JsonNode actual = new JsonSerializer().toNode(property); - Assert.assertEquals(expected, actual); - } - - @Test - public void testSerializeExtensionMinimal() throws SerializationException, JSONException, IOException { - compare(Examples.EXTENSION_MINIMAL); - } - - @Test - public void testSerializeExtensionMaximal() throws SerializationException, JSONException, IOException { - compare(Examples.EXTENSION_MAXIMAL); - } - - @SuppressWarnings("unchecked") - private void compare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual = null; - if (Environment.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Environment) exampleData.getModel()); - } else if (Referable.class.isAssignableFrom(exampleData.getModel().getClass())) { - actual = new JsonSerializer().write((Referable) exampleData.getModel()); - } else if (Collection.class.isAssignableFrom(exampleData.getModel().getClass()) - && ((Collection) exampleData.getModel()).stream().allMatch(x -> x != null && Referable.class.isAssignableFrom(x.getClass()))) { - actual = new JsonSerializer().write((Collection) exampleData.getModel()); - } - JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); - JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); - } - -} diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index dfd22388a..43ed8361b 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -16,126 +16,263 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import com.fasterxml.jackson.core.JsonProcessingException; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.JsonNode; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.DefaultDummyDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Referable; + import org.json.JSONException; +import org.junit.BeforeClass; +import org.junit.Ignore; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; + import org.skyscreamer.jsonassert.JSONAssert; import org.skyscreamer.jsonassert.JSONCompareMode; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.List; -import java.util.Set; - -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertEquals;; import static org.junit.Assert.assertTrue; public class JsonSerializerTest { - private static final Logger logger = LoggerFactory.getLogger(JsonSerializerTest.class); + private static JsonSerializer serializerToTest; + + @BeforeClass + public static void initialize() { + serializerToTest = new JsonSerializer(); + } @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); @Test - public void testSerializeNull() throws JsonProcessingException, IOException, SerializationException { - assertEquals("null", new JsonSerializer().write((Environment) null)); + public void testWriteNull() throws SerializationException { + assertEquals("null", serializerToTest.write(null)); + assertEquals("null", serializerToTest.writeList(null)); + + assertEquals(JsonNodeFactory.instance.nullNode(), serializerToTest.toNode(null)); + assertEquals(JsonNodeFactory.instance.nullNode(), serializerToTest.toArrayNode(null)); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + serializerToTest.write(baos, StandardCharsets.UTF_8, null); + assertEquals("null", baos.toString()); + + baos = new ByteArrayOutputStream(); + serializerToTest.writeList(baos,null); + assertEquals("null", baos.toString()); + } + + @Test + public void testWriteEmptyReferableList() throws SerializationException, JSONException { + List emptyList = Collections.emptyList(); + String actual = serializerToTest.writeList(emptyList); + JSONAssert.assertEquals("[]", actual, JSONCompareMode.NON_EXTENSIBLE); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + serializerToTest.writeList(baos, emptyList); + JSONAssert.assertEquals("[]", baos.toString(), JSONCompareMode.NON_EXTENSIBLE); + + JSONAssert.assertEquals("[]", serializerToTest.toArrayNode(emptyList).toString(), JSONCompareMode.NON_EXTENSIBLE); } @Test - public void testWriteToFile() throws JsonProcessingException, IOException, SerializationException { + public void testWriteToFile() throws IOException, SerializationException { File file = tempFolder.newFile("output.json"); - new JsonSerializer().write(file, AASSimple.createEnvironment()); + serializerToTest.write(new FileOutputStream(file), Examples.EXAMPLE_SIMPLE.getModel()); assertTrue(file.exists()); } @Test - public void testSerializeEmpty() throws JsonProcessingException, IOException, SerializationException, JSONException { - validateAndCompare(Examples.ENVIRONMENT_EMPTY); + public void testWriteEmptyEnv() { + writeValidateAndCompare(Examples.ENVIRONMENT_EMPTY); } @Test - public void testSerializeSimpleExample() throws SerializationException, JSONException, IOException { - validateAndCompare(Examples.EXAMPLE_SIMPLE); + public void testWriteSimpleExampleEnv() { + writeValidateAndCompare(Examples.EXAMPLE_SIMPLE); } @Test - public void testSerializeFullExample() throws SerializationException, JSONException, IOException { - validateAndCompare(Examples.EXAMPLE_FULL); + public void testWriteFullExampleEnv() { + writeValidateAndCompare(Examples.EXAMPLE_FULL); } @Test - public void testSerializeFullExampleToNode() throws SerializationException, JSONException, IOException { + public void testFullExampleEnvToNode() throws IOException { String expected = Examples.EXAMPLE_FULL.fileContent(); - JsonNode node = new JsonSerializer().toNode(Examples.EXAMPLE_FULL.getModel()); - String actual = new ObjectMapper().writeValueAsString(node); - validateAndCompare(expected, actual); + JsonNode node = serializerToTest.toNode(Examples.EXAMPLE_FULL.getModel()); + validateAndCompare(expected, node.toPrettyString()); } @Test - public void testSerializeEmptyReferableList() throws SerializationException { - List emptyList = Collections.emptyList(); - String serialized = new JsonSerializer().write(emptyList); - assertEquals("[]", serialized); + public void testWriteCustomDataSpecification() { + writeAndCompare(Examples.ENVIRONMENT_CUSTOM_DATA); } - /** - * This test ensures that future DataSpecificationContents can be added without adjustments in the code. - * - * @throws SerializationException - * @throws DeserializationException - */ @Test - public void testSerializeCustomDataSpecification() throws SerializationException, DeserializationException { - JsonSerializer serializer = new JsonSerializer(); - JsonDeserializer deserializer = new JsonDeserializer(); + public void testWriteShellDescriptor() { + writeAndCompare(Examples.SHELL_DESCRIPTOR); + } - // This is the only way to make the serialization to work. - Set> subtypes = ReflectionHelper.SUBTYPES.get(DataSpecificationContent.class); - subtypes.add(DefaultDummyDataSpecification.class); + @Test + public void testWriteShell() { + writeAndCompare(Examples.ASSET_ADMINISTRATION_SHELL); + } - Environment origin = org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.ENVIRONMENT_WITH_DUMMYDATASPEC ; + @Test + public void testWriteShellWithAssetInformation() { + writeAndCompare(Examples.ASSET_ADMINISTRATION_SHELL_WITH_ASSET_INFORMATION); + } - String jsonString = serializer.write(origin); - assertNotNull(jsonString); + @Test + public void testWriteShells() { + writeAndCompare(Examples.ASSET_ADMINISTRATION_SHELL_LIST_OF); + } - Environment copy = deserializer.read(jsonString); - assertNotNull(copy); + @Test + @Ignore("Add test after DataSpecficationPhysicalUnit is supported again") + public void testWriteConceptDescriptionWithPhysicalUnit() { + writeAndCompare(Examples.CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT); + } - assertTrue(origin.equals(copy)); + @Test + public void testWriteSubmodel() { + writeAndCompare(Examples.SUBMODEL); } + @Test + public void testWriteSubmodels() { + writeAndCompare(Examples.SUBMODEL_LIST_OF); + } - private void validateAndCompare(ExampleData exampleData) throws IOException, SerializationException, JSONException { - String expected = exampleData.fileContent(); - String actual = new JsonSerializer().write(exampleData.getModel()); - validateAndCompare(expected, actual); + @Test + public void testWriteSubmodelElement() { + writeAndCompare(Examples.SUBMODEL_ELEMENT); } - private void validateAndCompare(String expected, String actual) throws IOException, SerializationException, JSONException { - logger.info(actual); - Set errors = new JsonSchemaValidator().validateSchema(actual); - assertTrue(errors.isEmpty()); + @Test + public void testWriteSubmodelElements() { + writeAndCompare(Examples.SUBMODEL_ELEMENT_LIST_OF); + } + + @Test + public void testWriteSubmodelElementCollection() { + writeAndCompare(Examples.SUBMODEL_ELEMENT_COLLECTION); + } + + @Test + public void testWriteSubmodelElementList() { + writeAndCompare(Examples.SUBMODEL_ELEMENT_LIST); + } + + @Test + public void testWriteSubmodelElementListEmpty() { + writeAndCompare(Examples.SUBMODEL_ELEMENT_LIST_EMPTY); + } + + @Test + public void testWriteExtensionMinimal() { + writeAndCompare(Examples.EXTENSION_MINIMAL); + } + + @Test + public void testWriteExtensionMaximal() { + writeAndCompare(Examples.EXTENSION_MAXIMAL); + } + + @Test + public void testWriteSubmodelDescriptor() { + writeAndCompare(Examples.SUBMODEL_DESCRIPTOR); + } + + @Test + public void testWriteOperationRequest() { + writeAndCompare(Examples.OPERATION_REQUEST); + } + + private String writeToString(ExampleData exampleData) throws SerializationException { + String actual; + if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = serializerToTest.writeList((Collection) exampleData.getModel()); + } else { + actual = serializerToTest.write(exampleData.getModel()); + } + return actual; + } + + private String writeToStream(ExampleData exampleData) throws SerializationException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { + serializerToTest.writeList(baos, (Collection) exampleData.getModel()); + } else { + serializerToTest.write(baos, exampleData.getModel()); + } + return baos.toString(StandardCharsets.UTF_8); + } + + private JsonNode writeToNode(ExampleData exampleData) { + JsonNode actual; + if (Collection.class.isAssignableFrom(exampleData.getModel().getClass())) { + actual = serializerToTest.toArrayNode((Collection) exampleData.getModel()); + } else { + actual = serializerToTest.toNode(exampleData.getModel()); + } + return actual; + } + + private void compare(String expected, String actual) throws JSONException { JSONAssert.assertEquals(expected, actual, JSONCompareMode.NON_EXTENSIBLE); JSONAssert.assertEquals(actual, expected, JSONCompareMode.NON_EXTENSIBLE); } + @SuppressWarnings("unchecked") + private void writeAndCompare(ExampleData exampleData) { + try { + String expected = exampleData.fileContent(); + compare(expected, writeToString(exampleData)); + assertEquals(exampleData.getJsonNode(), writeToNode(exampleData)); + compare(expected, writeToStream(exampleData)); + } catch(Exception ex) { + throw new RuntimeException(ex); + } + } + + private void writeValidateAndCompare(ExampleData exampleData) { + try { + String actual = writeToString(exampleData); + String expected = exampleData.fileContent(); + validateAndCompare(expected, actual); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + + private void validateAndCompare(String expected, String actual) { + Set errors = new JsonSchemaValidator().validateSchema(actual); + if(errors.size() > 0) { + logger.error(String.join("\n", errors)); + } + assertTrue(errors.isEmpty()); + try { + compare(expected, actual); + } catch(JSONException ex) { + throw new RuntimeException(ex); + } + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java index 7b659c9f8..e632dd607 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/ReflectionAnnotationIntrospectorTest.java @@ -28,7 +28,6 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins.ReferenceMixin; import org.eclipse.digitaltwin.aas4j.v3.model.ClassA; import org.eclipse.digitaltwin.aas4j.v3.model.ClassB; import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; @@ -59,7 +58,7 @@ public class ReflectionAnnotationIntrospectorTest { private static ObjectMapper mapper; @Before - public void setUp() throws Exception { + public void setUp() { introspector = new ReflectionAnnotationIntrospector(); mapper = new ObjectMapper(); } @@ -79,18 +78,17 @@ private TypeResolverBuilder getTypeResolver(Class clazz) { } @Test - public void testFindTypeNameForClassesWithoutTypeInfo() throws Exception { + public void testFindTypeNameForClassesWithoutTypeInfo() { List.of(String.class, Object.class, Integer.class, ReflectionAnnotationIntrospectorTest.class, - ReferenceMixin.class, DummyInterface.class) .forEach(x -> assertNull(introspector.findTypeName(getAnnotatedClass(x)))); } @Test - public void testFindTypeNameForClassesWithTypeInfo() throws Exception { + public void testFindTypeNameForClassesWithTypeInfo() { Map.of(CustomProperty.class, Property.class, CustomSubProperty.class, Property.class, TypedProperty.class, TypedProperty.class, @@ -104,12 +102,11 @@ public void testFindTypeNameForClassesWithTypeInfo() throws Exception { } @Test - public void testFindTypeResolverForClassesWithoutTypeInfo() throws Exception { + public void testFindTypeResolverForClassesWithoutTypeInfo() { List.of(String.class, Object.class, Integer.class, ReflectionAnnotationIntrospectorTest.class, - ReferenceMixin.class, DummyInterface.class) .forEach(x -> { TypeResolverBuilder typeResolver = getTypeResolver(x); @@ -118,7 +115,7 @@ public void testFindTypeResolverForClassesWithoutTypeInfo() throws Exception { } @Test - public void testFindTypeResolverForClassesWithTypeInfo() throws Exception { + public void testFindTypeResolverForClassesWithTypeInfo() { List.of(CustomProperty.class, CustomSubProperty.class, TypedProperty.class, @@ -141,7 +138,6 @@ public void testFindSubtypesForExternalClasses() throws Exception { Object.class, Integer.class, ReflectionAnnotationIntrospectorTest.class, - ReferenceMixin.class, DummyInterface.class) .forEach(x -> { List subtypes = introspector.findSubtypes(getAnnotatedClass(x)); @@ -181,5 +177,4 @@ public void testFindSubtypesForInterfacesWithSubtypes() throws Exception { assertTrue(!subtypes.isEmpty()); }); } - -} +} \ No newline at end of file diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/ExampleData.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/ExampleData.java index 82cd21dc5..3acd6508b 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/ExampleData.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/ExampleData.java @@ -15,12 +15,17 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.ObjectMapper; + import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; public class ExampleData { + private static final ObjectMapper mapper = new ObjectMapper(); + private final T model; private final String file; @@ -49,4 +54,11 @@ public InputStream fileContentStream() { return getClass().getClassLoader().getResourceAsStream(file); } + public JsonNode getJsonNode() { + try { + return mapper.readTree(fileContent()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } } diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java index 0f6a667c0..1462331a9 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java @@ -18,38 +18,199 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; +import org.eclipse.digitaltwin.aas4j.v3.model.EmbeddedDataSpecification; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; +import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAdministrativeInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShell; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultConceptDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDataSpecificationIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEmbeddedDataSpecification; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultKey; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequest; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProperty; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultReference; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResource; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSecurityAttributeObject; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; +import javax.xml.datatype.DatatypeConfigurationException; +import javax.xml.datatype.DatatypeFactory; import java.util.List; - public class Examples { + private static final String DEFAULT_IDENTIFICATION = "identification"; + + private static final Reference DEFAULT_SEMANTIC_ID = + new DefaultReference.Builder().type(ReferenceTypes.EXTERNAL_REFERENCE) + .keys(new DefaultKey.Builder().type(KeyTypes.GLOBAL_REFERENCE).value("eClassDefaultSemanticId").build()) + .build(); + + private static final EmbeddedDataSpecification DEFAULT_EMBEDDED_DATA_SPECIFICATION = new DefaultEmbeddedDataSpecification.Builder() + .dataSpecificationContent(new DefaultDataSpecificationIec61360.Builder() + .preferredName( + new DefaultLangStringPreferredNameTypeIec61360.Builder().language("en").text("defaultPreferredName").build()) + .build()) + .dataSpecification(createGlobalReference("defaultEmbeddedDataSpecificationDataSpecificationValue")).build(); + + private static final AdministrativeInformation DEFAULT_ADMINISTRATIVE_INFORMATION = + new DefaultAdministrativeInformation.Builder() + .embeddedDataSpecifications(DEFAULT_EMBEDDED_DATA_SPECIFICATION) + .revision("1") + .version("1").build(); + + private static final List DEFAULT_DESCRIPTION = List.of(createLangStringTextType("en", "defaultDescription")); + + private static final List DEFAULT_DISPLAY_NAME = List.of(createLangStringNameType("en", "defaultDisplayName")); + + private static final String DEFAULT_ID_SHORT = "defaultIdShort"; + + private static LangStringTextType createLangStringTextType(String langCode, String text) { + return new DefaultLangStringTextType.Builder().language(langCode).text(text).build(); + } + + private static LangStringNameType createLangStringNameType(String langCode, String text) { + return new DefaultLangStringNameType.Builder().language(langCode).text(text).build(); + } + + private static Reference createReference(ReferenceTypes type, KeyTypes keyType, String value) { + return new DefaultReference.Builder().type(type).keys(createKey(keyType, value)).build(); + } + + private static Reference createGlobalReference(String value) { + return createReference(ReferenceTypes.EXTERNAL_REFERENCE, KeyTypes.GLOBAL_REFERENCE, value); + } + + private static DefaultEndpoint.Builder createEndpointBuilder() { + + String DEFAULT_INTERFACE_VALUE = "defaultInterface"; + + return new DefaultEndpoint.Builder() + .protocolInformation(createProtocolInformationBuilder().build()) + ._interface(DEFAULT_INTERFACE_VALUE); + } + + private static Key createKey(KeyTypes type, String value) { + return new DefaultKey.Builder().type(type).value(value).build(); + } + + private static DefaultProtocolInformation.Builder createProtocolInformationBuilder() { + return new DefaultProtocolInformation.Builder() + .href("defaultEndpointAddress") + .endpointProtocol("defaultEndpointProtocol") + .endpointProtocolVersion(List.of("defaultEndpointProtocolVersion")) + .subprotocol("defaultSubprotocol") + .subprotocolBody("defaultSubprotocolBody") + .subprotocolBodyEncoding("defaultSubprotocolBodyEncoding") + .securityAttributes(new DefaultSecurityAttributeObject.Builder() + .key("NONE") + .type(SecurityTypeEnum.NONE) + .value("NONE") + .build()); + } + + private static SpecificAssetId createSpecificAssetId() { + return new DefaultSpecificAssetId.Builder() + .name("testSpecificAssetId") + .value("testValue") + .build(); + } + + private static AssetAdministrationShellDescriptor createAasDescriptor() { + + SpecificAssetId specificAssetId = new DefaultSpecificAssetId.Builder() + .semanticId(DEFAULT_SEMANTIC_ID) + .externalSubjectId(createReference( + ReferenceTypes.MODEL_REFERENCE, KeyTypes.ASSET_ADMINISTRATION_SHELL, "defaultSpecificAssetId")) + .name("defaultSpecificAssetIdName") + .value("http://example.company/myAsset").build(); + + return new DefaultAssetAdministrationShellDescriptor.Builder() + .administration(DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(DEFAULT_DESCRIPTION) + .displayName(DEFAULT_DISPLAY_NAME) + .id(DEFAULT_IDENTIFICATION) + .idShort(DEFAULT_ID_SHORT) + .specificAssetIds(List.of(specificAssetId)) + .endpoints(List.of(createEndpointBuilder().build())) + .globalAssetId("defaultGlobalAssetId") + .submodelDescriptors(List.of(createDefaultSubmodelDescriptor())).build(); + } + + private static SubmodelDescriptor createDefaultSubmodelDescriptor () { + return new DefaultSubmodelDescriptor.Builder() + .administration(DEFAULT_ADMINISTRATIVE_INFORMATION) + .description(DEFAULT_DESCRIPTION) + .displayName(DEFAULT_DISPLAY_NAME) + .id(DEFAULT_IDENTIFICATION) + .idShort(DEFAULT_ID_SHORT) + .endpoints(List.of(createEndpointBuilder().build())) + .semanticId(DEFAULT_SEMANTIC_ID) + .build(); + } + + private static OperationRequest createOperationRequest() { + try { + return new DefaultOperationRequest.Builder() + .inoutputArguments(new DefaultOperationVariable.Builder() + .value(new DefaultProperty.Builder() + .valueType(DataTypeDefXsd.INT).value("42") + .idShort("TheAnswerOfAllQuestions") + .build()) + .build()) + .clientTimeoutDuration(DatatypeFactory.newInstance().newDurationDayTime("PT3M")) // three minutes + .build(); + } catch (DatatypeConfigurationException e) { + throw new RuntimeException(e); + } + } public static final ExampleData EXAMPLE_FULL = ExampleData.of(AASFull.createEnvironment(), "Example-Full.json"); public static final ExampleData EXAMPLE_SIMPLE = ExampleData.of(AASSimple.createEnvironment(), "Example-Simple.json"); public static final ExampleData ENVIRONMENT_EMPTY = ExampleData.of(new DefaultEnvironment.Builder().build(), "Environment-Empty.json"); + public static final ExampleData ENVIRONMENT_CUSTOM_DATA = ExampleData.of( + org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.ENVIRONMENT_WITH_DUMMYDATASPEC, + "Environment-CustomDataSpec.json"); + + public static final ExampleData SHELL_DESCRIPTOR = ExampleData.of( + createAasDescriptor(), "AssetAdministrationShellDescriptor.json"); + + public static final ExampleData SUBMODEL_DESCRIPTOR = ExampleData.of( + createDefaultSubmodelDescriptor(), "SubmodelDescriptor.json"); + public static final ExampleData> ASSET_ADMINISTRATION_SHELL_LIST_OF = ExampleData.of( List.of(AASFull.createEnvironment().getAssetAdministrationShells().get(0), AASFull.createEnvironment().getAssetAdministrationShells().get(1)), @@ -82,6 +243,7 @@ public class Examples { public static final ExampleData ASSET_ADMINISTRATION_SHELL = ExampleData.of(AASFull.createEnvironment().getAssetAdministrationShells().get(0), "AssetAdministrationShell.json"); + public static final ExampleData CONCEPT_DESCRIPTION_DATA_SPECIFICATION_PHYSICAL_UNIT = ExampleData.of( new DefaultConceptDescription.Builder() .id("https://example.org/ConceptDescription") @@ -94,28 +256,6 @@ public class Examples { .value("https://admin-shell.io/DataSpecificationTemplates/DataSpecificationPhysicalUnit/3/0/RC02") .build()) .build()) - // .dataSpecificationContent(new DefaultDataSpecificationPhysicalUnit.Builder() - // .conversionFactor("1.0") - // .eceCode("ece-code") - // .eceName("ece-name") - // .definition(new DefaultLangString.Builder() - // .language("en") - // .text("definition-en") - // .build()) - // .definition(new DefaultLangString.Builder() - // .language("de") - // .text("definition-de") - // .build()) - // .nistName("nist-name") - // .dinNotation("din-notation") - // .siName("si-name") - // .registrationAuthorityId("registration-authority-id") - // .siNotation("si-notation") - // .sourceOfDefinition("source-of-definition") - // .supplier("supplier") - // .unitName("unit-name") - // .unitSymbol("unit-symbol") - // .build()) .build()) .build(), "ConceptDescription-DataSpecificationPhysicalUnit.json"); @@ -148,4 +288,7 @@ public class Examples { public static final ExampleData EXTENSION_MINIMAL = ExampleData.of(org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.EXTENSION_MINIMAL, "admin-shell-io/Extension/Minimal.json"); public static final ExampleData EXTENSION_MAXIMAL = ExampleData.of(org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples.EXTENSION_MAXIMAL, "admin-shell-io/Extension/Maximal.json"); + + public static final ExampleData OPERATION_REQUEST = ExampleData.of( + createOperationRequest(), "OperationRequest.json"); } diff --git a/dataformat-json/src/test/resources/AssetAdministrationShellDescriptor.json b/dataformat-json/src/test/resources/AssetAdministrationShellDescriptor.json new file mode 100644 index 000000000..ab5c8fed5 --- /dev/null +++ b/dataformat-json/src/test/resources/AssetAdministrationShellDescriptor.json @@ -0,0 +1,122 @@ +{ + "endpoints" : [ { + "protocolInformation" : { + "href" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding", + "securityAttributes": [ { + "type": "NONE", + "key": "NONE", + "value": "NONE" + } ] + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "1", + "version" : "1", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "ExternalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIec61360", + "preferredName" : [ { + "language": "en", + "text": "defaultPreferredName" + } ] + } + } ] + }, + "description" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayName" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "id" : "identification", + "globalAssetId" : "defaultGlobalAssetId", + "specificAssetIds" : [{ + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "ExternalReference" + }, + "externalSubjectId" : { + "keys" : [ { + "type" : "AssetAdministrationShell", + "value" : "defaultSpecificAssetId" + } ], + "type" : "ModelReference" + }, + "name" : "defaultSpecificAssetIdName", + "value" : "http://example.company/myAsset" + }], + "submodelDescriptors" : [ { + "endpoints" : [ { + "protocolInformation" : { + "href" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding", + "securityAttributes": [ { + "type": "NONE", + "key": "NONE", + "value": "NONE" + } ] + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "1", + "version" : "1", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "ExternalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIec61360", + "preferredName" : [ { + "language": "en", + "text": "defaultPreferredName" + } ] + } + } ] + }, + "description" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayName" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "id" : "identification", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "ExternalReference" + } + } ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/Environment-CustomDataSpec.json b/dataformat-json/src/test/resources/Environment-CustomDataSpec.json new file mode 100644 index 000000000..976b90bcf --- /dev/null +++ b/dataformat-json/src/test/resources/Environment-CustomDataSpec.json @@ -0,0 +1,48 @@ +{ + "submodels" : [ { + "modelType" : "Submodel", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "https://admin-shell.io/aas/3/0/CustomDataSpecification" + } ], + "type" : "ExternalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DefaultDummyDataSpecification", + "name" : { + "language" : "en", + "text" : "myName" + }, + "text" : "myText", + "pages" : 42 + } + }, { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "https://admin-shell.io/aas/3/0/RC02/DataSpecificationIec61360" + } ], + "type" : "ExternalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIec61360", + "dataType" : "BLOB", + "definition" : [ { + "language" : "en", + "text" : "myDefinition" + } ], + "preferredName" : [ ] + } + } ], + "kind" : "Instance", + "id" : "urn:test", + "submodelElements" : [ { + "modelType" : "File", + "contentType" : null, + "value" : "FileValue", + "idShort" : "myIdShort" + } ] + } ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/OperationRequest.json b/dataformat-json/src/test/resources/OperationRequest.json new file mode 100644 index 000000000..9313e08ae --- /dev/null +++ b/dataformat-json/src/test/resources/OperationRequest.json @@ -0,0 +1,11 @@ +{ + "clientTimeoutDuration" : "PT3M", + "inoutputArguments" : [ { + "value" : { + "modelType" : "Property", + "value" : "42", + "valueType" : "xs:int", + "idShort" : "TheAnswerOfAllQuestions" + } + } ] +} \ No newline at end of file diff --git a/dataformat-json/src/test/resources/Submodel-List.json b/dataformat-json/src/test/resources/Submodel-List.json index a1708a819..1d9ea5cc6 100644 --- a/dataformat-json/src/test/resources/Submodel-List.json +++ b/dataformat-json/src/test/resources/Submodel-List.json @@ -46,11 +46,13 @@ "valueType": "xs:string", "qualifiers": [ { + "kind" : "ConceptQualifier", "type": "http://acplt.org/Qualifier/ExampleQualifier", "value": "100", "valueType": "xs:int" }, { + "kind" : "ConceptQualifier", "type": "http://acplt.org/Qualifier/ExampleQualifier2", "value": "50", "valueType": "xs:int" diff --git a/dataformat-json/src/test/resources/SubmodelDescriptor.json b/dataformat-json/src/test/resources/SubmodelDescriptor.json new file mode 100644 index 000000000..3e7c79652 --- /dev/null +++ b/dataformat-json/src/test/resources/SubmodelDescriptor.json @@ -0,0 +1,55 @@ +{ + "endpoints" : [ { + "protocolInformation" : { + "href" : "defaultEndpointAddress", + "endpointProtocol" : "defaultEndpointProtocol", + "endpointProtocolVersion" : ["defaultEndpointProtocolVersion"], + "subprotocol" : "defaultSubprotocol", + "subprotocolBody" : "defaultSubprotocolBody", + "subprotocolBodyEncoding" : "defaultSubprotocolBodyEncoding", + "securityAttributes": [ { + "type": "NONE", + "key": "NONE", + "value": "NONE" + } ] + }, + "interface" : "defaultInterface" + } ], + "administration" : { + "revision" : "1", + "version" : "1", + "embeddedDataSpecifications" : [ { + "dataSpecification" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "defaultEmbeddedDataSpecificationDataSpecificationValue" + } ], + "type" : "ExternalReference" + }, + "dataSpecificationContent" : { + "modelType" : "DataSpecificationIec61360", + "preferredName" : [ { + "language": "en", + "text": "defaultPreferredName" + } ] + } + } ] + }, + "description" : [ { + "language" : "en", + "text" : "defaultDescription" + } ], + "displayName" : [ { + "language" : "en", + "text" : "defaultDisplayName" + } ], + "idShort" : "defaultIdShort", + "id" : "identification", + "semanticId" : { + "keys" : [ { + "type" : "GlobalReference", + "value" : "eClassDefaultSemanticId" + } ], + "type" : "ExternalReference" + } +} \ No newline at end of file diff --git a/dataformat-xml/src/main/resources/AAS_ABAC.xsd b/dataformat-xml/src/main/resources/AAS_ABAC.xsd new file mode 100644 index 000000000..472c60d37 --- /dev/null +++ b/dataformat-xml/src/main/resources/AAS_ABAC.xsd @@ -0,0 +1,167 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/dataformat-xml/src/main/resources/IEC61360.xsd b/dataformat-xml/src/main/resources/IEC61360.xsd new file mode 100644 index 000000000..b929a4304 --- /dev/null +++ b/dataformat-xml/src/main/resources/IEC61360.xsd @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java index 80d41621f..52fd7fd57 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AbstractLangString.java @@ -24,11 +24,11 @@ * Strings with language tags */ @KnownSubtypes({ + @KnownSubtypes.Type(value = LangStringTextType.class), + @KnownSubtypes.Type(value = LangStringNameType.class), @KnownSubtypes.Type(value = LangStringPreferredNameTypeIec61360.class), @KnownSubtypes.Type(value = LangStringShortNameTypeIec61360.class), - @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class), - @KnownSubtypes.Type(value = LangStringNameType.class), - @KnownSubtypes.Type(value = LangStringTextType.class) + @KnownSubtypes.Type(value = LangStringDefinitionTypeIec61360.class) }) public interface AbstractLangString { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java index 2b51a7a67..f284b05e7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShell.java @@ -28,7 +28,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultAssetAdministrationShell.class) }) -public interface AssetAdministrationShell extends HasDataSpecification, Identifiable { +public interface AssetAdministrationShell extends Identifiable, HasDataSpecification { /** * The reference to the AAS the AAS was derived from. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java new file mode 100644 index 000000000..67aedfbf9 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/AssetAdministrationShellDescriptor.java @@ -0,0 +1,199 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultAssetAdministrationShellDescriptor; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultAssetAdministrationShellDescriptor.class) +}) +public interface AssetAdministrationShellDescriptor extends Descriptor { + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/administration + * + * @return Returns the AdministrativeInformation for the property administration. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/administration") + AdministrativeInformation getAdministration(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/administration + * + * @param administration desired value for the property administration. + */ + void setAdministration(AdministrativeInformation administration); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetKind + * + * @return Returns the AssetKind for the property assetKind. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetKind") + AssetKind getAssetKind(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetKind + * + * @param assetKind desired value for the property assetKind. + */ + void setAssetKind(AssetKind assetKind); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetType + * + * @return Returns the String for the property assetType. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetType") + String getAssetType(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetType + * + * @param assetType desired value for the property assetType. + */ + void setAssetType(String assetType); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/endpoints + * + * @return Returns the List of Endpoints for the property endpoints. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/endpoints") + List getEndpoints(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/endpoints + * + * @param endpoints desired value for the property endpoints. + */ + void setEndpoints(List endpoints); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/globalAssetId + * + * @return Returns the String for the property globalAssetId. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/globalAssetId") + String getGlobalAssetId(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/globalAssetId + * + * @param globalAssetId desired value for the property globalAssetId. + */ + void setGlobalAssetId(String globalAssetId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/idShort + * + * @return Returns the String for the property idShort. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/idShort") + String getIdShort(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/idShort + * + * @param idShort desired value for the property idShort. + */ + void setIdShort(String idShort); + + /** + * + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/id + * + * @return Returns the String for the property id. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/id") + String getId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/id + * + * @param id desired value for the property id. + */ + void setId(String id); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/specificAssetIds + * + * @return Returns the List of SpecificAssetIds for the property specificAssetIds. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/specificAssetIds") + List getSpecificAssetIds(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/specificAssetIds + * + * @param specificAssetIds desired value for the property specificAssetIds. + */ + void setSpecificAssetIds(List specificAssetIds); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/submodelDescriptors + * + * @return Returns the List of SubmodelDescriptors for the property submodelDescriptors. + */ + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/submodelDescriptors") + List getSubmodelDescriptors(); + + /** + * + * More information under + * https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/submodelDescriptors + * + * @param submodelDescriptors desired value for the property submodelDescriptors. + */ + void setSubmodelDescriptors(List submodelDescriptors); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BaseOperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BaseOperationResult.java new file mode 100644 index 000000000..0da07e1a0 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/BaseOperationResult.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultBaseOperationResult; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultBaseOperationResult.class) +}) +public interface BaseOperationResult extends Result { + + /** + * + * More information under https://admin-shell.io/aas/3/0/BaseOperationResult/executionState + * + * @return Returns the ExecutionState for the property executionState. + */ + @IRI("https://admin-shell.io/aas/3/0/BaseOperationResult/executionState") + ExecutionState getExecutionState(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BaseOperationResult/executionState + * + * @param executionState desired value for the property executionState. + */ + void setExecutionState(ExecutionState executionState); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BaseOperationResult/success + * + * @return Returns the boolean for the property success. + */ + @IRI("https://admin-shell.io/aas/3/0/BaseOperationResult/success") + boolean getSuccess(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/BaseOperationResult/success + * + * @param success desired value for the property success. + */ + void setSuccess(boolean success); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java index 724d31fed..942452b8c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ConceptDescription.java @@ -29,7 +29,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultConceptDescription.class) }) -public interface ConceptDescription extends HasDataSpecification, Identifiable { +public interface ConceptDescription extends Identifiable, HasDataSpecification { /** * Reference to an external definition the concept is compatible to or was derived from. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java index d2cfd8bf7..fe56cb02e 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/DataElement.java @@ -15,8 +15,10 @@ package org.eclipse.digitaltwin.aas4j.v3.model; + import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; + /** * A data element is a submodel element that is not further composed out of other submodel elements. */ diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java new file mode 100644 index 000000000..5611270ec --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Descriptor.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultDescriptor; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultDescriptor.class), + @KnownSubtypes.Type(value = AssetAdministrationShellDescriptor.class), + @KnownSubtypes.Type(value = SubmodelDescriptor.class) +}) +public interface Descriptor { + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/description + * + * @return Returns the List of LangStringTextTypes for the property description. + */ + @IRI("https://admin-shell.io/aas/3/0/Descriptor/description") + List getDescription(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/description + * + * @param descriptions desired value for the property description. + */ + void setDescription(List descriptions); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/displayName + * + * @return Returns the List of LangStringNameTypes for the property displayName. + */ + @IRI("https://admin-shell.io/aas/3/0/Descriptor/displayName") + List getDisplayName(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/displayName + * + * @param displayNames desired value for the property displayName. + */ + void setDisplayName(List displayNames); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/extensions + * + * @return Returns the List of Extensions for the property extensions. + */ + @IRI("https://admin-shell.io/aas/3/0/Descriptor/extensions") + List getExtensions(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Descriptor/extensions + * + * @param extensions desired value for the property extensions. + */ + void setExtensions(List extensions); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java new file mode 100644 index 000000000..8d5db6a4f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Endpoint.java @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEndpoint; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultEndpoint.class) +}) +public interface Endpoint { + + /** + * + * More information under https://admin-shell.io/aas/3/0/Endpoint/_interface + * + * @return Returns the String for the property _interface. + */ + @IRI("https://admin-shell.io/aas/3/0/Endpoint/_interface") + String get_interface(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Endpoint/_interface + * + * @param _interface desired value for the property _interface. + */ + void set_interface(String _interface); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Endpoint/protocolInformation + * + * @return Returns the ProtocolInformation for the property protocolInformation. + */ + @IRI("https://admin-shell.io/aas/3/0/Endpoint/protocolInformation") + ProtocolInformation getProtocolInformation(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Endpoint/protocolInformation + * + * @param protocolInformation desired value for the property protocolInformation. + */ + void setProtocolInformation(ProtocolInformation protocolInformation); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ExecutionState.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ExecutionState.java new file mode 100644 index 000000000..d184636fc --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ExecutionState.java @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + + +/** +*/ +@IRI("aas:ExecutionState") +public enum ExecutionState { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Canceled") + CANCELED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Completed") + COMPLETED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Failed") + FAILED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Initiated") + INITIATED, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Running") + RUNNING, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/ExecutionState/Timeout") + TIMEOUT; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java index 41f9b9978..a7f73523c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/HasSemantics.java @@ -26,9 +26,9 @@ */ @KnownSubtypes({ @KnownSubtypes.Type(value = SpecificAssetId.class), + @KnownSubtypes.Type(value = Extension.class), @KnownSubtypes.Type(value = SubmodelElement.class), @KnownSubtypes.Type(value = Submodel.class), - @KnownSubtypes.Type(value = Extension.class), @KnownSubtypes.Type(value = Qualifier.class) }) public interface HasSemantics { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java new file mode 100644 index 000000000..6d0a29988 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Message.java @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultMessage; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultMessage.class) +}) +public interface Message { + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/code + * + * @return Returns the String for the property code. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/code") + String getCode(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/code + * + * @param code desired value for the property code. + */ + void setCode(String code); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/correlationId + * + * @return Returns the String for the property correlationId. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/correlationId") + String getCorrelationId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/correlationId + * + * @param correlationId desired value for the property correlationId. + */ + void setCorrelationId(String correlationId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/messageType + * + * @return Returns the MessageTypeEnum for the property messageType. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/messageType") + MessageTypeEnum getMessageType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/messageType + * + * @param messageType desired value for the property messageType. + */ + void setMessageType(MessageTypeEnum messageType); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/text + * + * @return Returns the String for the property text. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/text") + String getText(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/text + * + * @param text desired value for the property text. + */ + void setText(String text); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/timestamp + * + * @return Returns the String for the property timestamp. + */ + @IRI("https://admin-shell.io/aas/3/0/Message/timestamp") + String getTimestamp(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Message/timestamp + * + * @param timestamp desired value for the property timestamp. + */ + void setTimestamp(String timestamp); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageTypeEnum.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageTypeEnum.java new file mode 100644 index 000000000..6542c8111 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/MessageTypeEnum.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + + +/** +*/ +@IRI("aas:MessageTypeEnum") +public enum MessageTypeEnum { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Error") + ERROR, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Exception") + EXCEPTION, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Info") + INFO, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/MessageType/Warning") + WARNING; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java new file mode 100644 index 000000000..60987eed4 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationHandle.java @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationHandle; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationHandle.class) +}) +public interface OperationHandle { + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationHandle/handleId + * + * @return Returns the String for the property handleId. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationHandle/handleId") + String getHandleId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationHandle/handleId + * + * @param handleId desired value for the property handleId. + */ + void setHandleId(String handleId); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java new file mode 100644 index 000000000..c9a1e6404 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationRequest.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationRequest; + +import javax.xml.datatype.Duration; +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationRequest.class) +}) +public interface OperationRequest { + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments + * + * @return Returns the List of OperationVariables for the property inoutputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments") + List getInoutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments + * + * @param inoutputArguments desired value for the property inoutputArguments. + */ + void setInoutputArguments(List inoutputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/inputArguments + * + * @return Returns the List of OperationVariables for the property inputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inputArguments") + List getInputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/inputArguments + * + * @param inputArguments desired value for the property inputArguments. + */ + void setInputArguments(List inputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/clientTimeoutDuration + * + * @return Returns the String for the property clientTimeoutDuration. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/clientTimeoutDuration") + Duration getClientTimeoutDuration(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationRequest/clientTimeoutDuration + * + * @param clientTimeoutDuration desired value for the property clientTimeoutDuration. + */ + void setClientTimeoutDuration(Duration clientTimeoutDuration); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java new file mode 100644 index 000000000..7ba79ee45 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/OperationResult.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultOperationResult; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultOperationResult.class) +}) +public interface OperationResult { + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments + * + * @return Returns the List of OperationVariables for the property inoutputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments") + List getInoutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments + * + * @param inoutputArguments desired value for the property inoutputArguments. + */ + void setInoutputArguments(List inoutputArguments); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/outputArguments + * + * @return Returns the List of OperationVariables for the property outputArguments. + */ + @IRI("https://admin-shell.io/aas/3/0/OperationResult/outputArguments") + List getOutputArguments(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/OperationResult/outputArguments + * + * @param outputArguments desired value for the property outputArguments. + */ + void setOutputArguments(List outputArguments); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PackageDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PackageDescription.java new file mode 100644 index 000000000..8360f4e62 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/PackageDescription.java @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultPackageDescription; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultPackageDescription.class) +}) +public interface PackageDescription { + + /** + * + * More information under https://admin-shell.io/aas/3/0/PackageDescription/items + * + * @return Returns the List of Strings for the property items. + */ + @IRI("https://admin-shell.io/aas/3/0/PackageDescription/items") + List getItems(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/PackageDescription/items + * + * @param items desired value for the property items. + */ + void setItems(List items); + + /** + * + * More information under https://admin-shell.io/aas/3/0/PackageDescription/packageId + * + * @return Returns the String for the property packageId. + */ + @IRI("https://admin-shell.io/aas/3/0/PackageDescription/packageId") + String getPackageId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/PackageDescription/packageId + * + * @param packageId desired value for the property packageId. + */ + void setPackageId(String packageId); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java new file mode 100644 index 000000000..172ed35aa --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/ProtocolInformation.java @@ -0,0 +1,151 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultProtocolInformation; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultProtocolInformation.class) +}) +public interface ProtocolInformation { + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/href + * + * @return Returns the String for the property href. + */ + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/href") + String getHref(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/href + * + * @param href desired value for the property href. + */ + void setHref(String href); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol + * + * @return Returns the String for the property endpointProtocol. + */ + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol") + String getEndpointProtocol(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol + * + * @param endpointProtocol desired value for the property endpointProtocol. + */ + void setEndpointProtocol(String endpointProtocol); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion + * + * @return Returns the List of Strings for the property endpointProtocolVersion. + */ + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion") + List getEndpointProtocolVersion(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion + * + * @param endpointProtocolVersions desired value for the property endpointProtocolVersion. + */ + void setEndpointProtocolVersion(List endpointProtocolVersions); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol + * + * @return Returns the String for the property subprotocol. + */ + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol") + String getSubprotocol(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol + * + * @param subprotocol desired value for the property subprotocol. + */ + void setSubprotocol(String subprotocol); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody + * + * @return Returns the String for the property subprotocolBody. + */ + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody") + String getSubprotocolBody(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody + * + * @param subprotocolBody desired value for the property subprotocolBody. + */ + void setSubprotocolBody(String subprotocolBody); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding + * + * @return Returns the String for the property subprotocolBodyEncoding. + */ + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding") + String getSubprotocolBodyEncoding(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding + * + * @param subprotocolBodyEncoding desired value for the property subprotocolBodyEncoding. + */ + void setSubprotocolBodyEncoding(String subprotocolBodyEncoding); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/securityAttributes + * + * @return Returns the List of SecurityAttributeObjects for the property securityAttributes. + */ + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/securityAttributes") + List getSecurityAttributes(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/ProtocolInformation/securityAttributes + * + * @param securityAttributes desired value for the property securityAttributes. + */ + void setSecurityAttributes(List securityAttributes); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java index 71c5e6ad8..e899e7a0b 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Referable.java @@ -25,8 +25,8 @@ * An element that is referable by its 'idShort'. */ @KnownSubtypes({ - @KnownSubtypes.Type(value = SubmodelElement.class), - @KnownSubtypes.Type(value = Identifiable.class) + @KnownSubtypes.Type(value = Identifiable.class), + @KnownSubtypes.Type(value = SubmodelElement.class) }) public interface Referable extends HasExtensions { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java new file mode 100644 index 000000000..ff1f97932 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Result.java @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultResult; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultResult.class), + @KnownSubtypes.Type(value = BaseOperationResult.class) +}) +public interface Result { + + /** + * + * More information under https://admin-shell.io/aas/3/0/Result/messages + * + * @return Returns the List of Messages for the property messages. + */ + @IRI("https://admin-shell.io/aas/3/0/Result/messages") + List getMessages(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/Result/messages + * + * @param messages desired value for the property messages. + */ + void setMessages(List messages); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityAttributeObject.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityAttributeObject.java new file mode 100644 index 000000000..eada6211a --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityAttributeObject.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSecurityAttributeObject; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSecurityAttributeObject.class) +}) +public interface SecurityAttributeObject { + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/type + * + * @return Returns the SecurityTypeEnum for the property type. + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/type") + SecurityTypeEnum getType(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/type + * + * @param type desired value for the property type. + */ + void setType(SecurityTypeEnum type); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/key + * + * @return Returns the String for the property key. + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/key") + String getKey(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/key + * + * @param key desired value for the property key. + */ + void setKey(String key); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/value + * + * @return Returns the String for the property value. + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/value") + String getValue(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SecurityAttributeObject/value + * + * @param value desired value for the property value. + */ + void setValue(String value); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityTypeEnum.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityTypeEnum.java new file mode 100644 index 000000000..81dc1f0fd --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SecurityTypeEnum.java @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; + + +/** +*/ +@IRI("aas:SecurityTypeEnum") +public enum SecurityTypeEnum { + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityTypeEnum/None") + NONE, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityTypeEnum/Rfc_Tlsa") + RFC_TLSA, + + /** + */ + @IRI("https://admin-shell.io/aas/3/0/SecurityTypeEnum/W3c_Did") + W3C_DID; + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java index 4e8fd3266..1c5e731a5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/Submodel.java @@ -28,7 +28,7 @@ @KnownSubtypes({ @KnownSubtypes.Type(value = DefaultSubmodel.class) }) -public interface Submodel extends HasDataSpecification, HasKind, HasSemantics, Identifiable, Qualifiable { +public interface Submodel extends Identifiable, HasDataSpecification, HasSemantics, Qualifiable, HasKind { /** * A submodel consists of zero or more submodel elements. diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java new file mode 100644 index 000000000..703609a1b --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelDescriptor.java @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model; + +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.KnownSubtypes; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelDescriptor; + +import java.util.List; + + +/** +*/ +@KnownSubtypes({ + @KnownSubtypes.Type(value = DefaultSubmodelDescriptor.class) +}) +public interface SubmodelDescriptor extends Descriptor { + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/administration + * + * @return Returns the AdministrativeInformation for the property administration. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/administration") + AdministrativeInformation getAdministration(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/administration + * + * @param administration desired value for the property administration. + */ + void setAdministration(AdministrativeInformation administration); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/endpoints + * + * @return Returns the List of Endpoints for the property endpoints. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/endpoints") + List getEndpoints(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/endpoints + * + * @param endpoints desired value for the property endpoints. + */ + void setEndpoints(List endpoints); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/idShort + * + * @return Returns the String for the property idShort. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/idShort") + String getIdShort(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/idShort + * + * @param idShort desired value for the property idShort. + */ + void setIdShort(String idShort); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/id + * + * @return Returns the String for the property id. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/id") + String getId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/id + * + * @param id desired value for the property id. + */ + void setId(String id); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/semanticId + * + * @return Returns the Reference for the property semanticId. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/semanticId") + Reference getSemanticId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/semanticId + * + * @param semanticId desired value for the property semanticId. + */ + void setSemanticId(Reference semanticId); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/supplementalSemanticId + * + * @return Returns the List of References for the property supplementalSemanticId. + */ + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/supplementalSemanticId") + List getSupplementalSemanticId(); + + /** + * + * More information under https://admin-shell.io/aas/3/0/SubmodelDescriptor/supplementalSemanticId + * + * @param supplementalSemanticIds desired value for the property supplementalSemanticId. + */ + void setSupplementalSemanticId(List supplementalSemanticIds); + +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java index afb2299d6..a10fffd2c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/SubmodelElement.java @@ -32,6 +32,6 @@ @KnownSubtypes.Type(value = SubmodelElementCollection.class), @KnownSubtypes.Type(value = SubmodelElementList.class) }) -public interface SubmodelElement extends HasDataSpecification, HasSemantics, Qualifiable, Referable { +public interface SubmodelElement extends HasDataSpecification, Referable, HasSemantics, Qualifiable { } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java index 0a3067f18..053a5469d 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AnnotatedRelationshipElementBuilder.java @@ -96,61 +96,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -238,4 +183,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java index e2820dc4c..846e59c61 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellBuilder.java @@ -74,28 +74,6 @@ public B submodels(Reference submodels) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - /** * This function allows setting a value for administration * @@ -205,4 +183,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java new file mode 100644 index 000000000..10faa0151 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/AssetAdministrationShellDescriptorBuilder.java @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + + +public abstract class AssetAdministrationShellDescriptorBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for administration + * + * @param administration desired value to be set + * @return Builder object with new value for administration + */ + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); + return getSelf(); + } + + /** + * This function allows setting a value for assetKind + * + * @param assetKind desired value to be set + * @return Builder object with new value for assetKind + */ + public B assetKind(AssetKind assetKind) { + getBuildingInstance().setAssetKind(assetKind); + return getSelf(); + } + + /** + * This function allows setting a value for assetType + * + * @param assetType desired value to be set + * @return Builder object with new value for assetType + */ + public B assetType(String assetType) { + getBuildingInstance().setAssetType(assetType); + return getSelf(); + } + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } + + /** + * This function allows setting a value for globalAssetId + * + * @param globalAssetId desired value to be set + * @return Builder object with new value for globalAssetId + */ + public B globalAssetId(String globalAssetId) { + getBuildingInstance().setGlobalAssetId(globalAssetId); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for id + * + * @param id desired value to be set + * @return Builder object with new value for id + */ + public B id(String id) { + getBuildingInstance().setId(id); + return getSelf(); + } + + /** + * This function allows setting a value for specificAssetIds + * + * @param specificAssetIds desired value to be set + * @return Builder object with new value for specificAssetIds + */ + public B specificAssetIds(List specificAssetIds) { + getBuildingInstance().setSpecificAssetIds(specificAssetIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List specificAssetIds + * + * @param specificAssetIds desired value to be added + * @return Builder object with new value for specificAssetIds + */ + public B specificAssetIds(SpecificAssetId specificAssetIds) { + getBuildingInstance().getSpecificAssetIds().add(specificAssetIds); + return getSelf(); + } + + /** + * This function allows setting a value for submodelDescriptors + * + * @param submodelDescriptors desired value to be set + * @return Builder object with new value for submodelDescriptors + */ + public B submodelDescriptors(List submodelDescriptors) { + getBuildingInstance().setSubmodelDescriptors(submodelDescriptors); + return getSelf(); + } + + /** + * This function allows adding a value to the List submodelDescriptors + * + * @param submodelDescriptors desired value to be added + * @return Builder object with new value for submodelDescriptors + */ + public B submodelDescriptors(SubmodelDescriptor submodelDescriptors) { + getBuildingInstance().getSubmodelDescriptors().add(submodelDescriptors); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BaseOperationResultBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BaseOperationResultBuilder.java new file mode 100644 index 000000000..eea07026f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BaseOperationResultBuilder.java @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.BaseOperationResult; +import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; +import org.eclipse.digitaltwin.aas4j.v3.model.Message; + +import java.util.List; + + +public abstract class BaseOperationResultBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for executionState + * + * @param executionState desired value to be set + * @return Builder object with new value for executionState + */ + public B executionState(ExecutionState executionState) { + getBuildingInstance().setExecutionState(executionState); + return getSelf(); + } + + /** + * This function allows setting a value for success + * + * @param success desired value to be set + * @return Builder object with new value for success + */ + public B success(boolean success) { + getBuildingInstance().setSuccess(success); + return getSelf(); + } + + /** + * This function allows setting a value for messages + * + * @param messages desired value to be set + * @return Builder object with new value for messages + */ + public B messages(List messages) { + getBuildingInstance().setMessages(messages); + return getSelf(); + } + + /** + * This function allows adding a value to the List messages + * + * @param messages desired value to be added + * @return Builder object with new value for messages + */ + public B messages(Message messages) { + getBuildingInstance().getMessages().add(messages); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java index 181f1199a..23d2f52c3 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BasicEventElementBuilder.java @@ -141,61 +141,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -283,4 +228,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java index 7859c310e..aaf6f193a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/BlobBuilder.java @@ -72,61 +72,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -214,4 +159,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java index 548d57037..2cea916a0 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/CapabilityBuilder.java @@ -50,61 +50,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -192,4 +137,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java index 57919df59..68793dda9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ConceptDescriptionBuilder.java @@ -51,28 +51,6 @@ public B isCaseOf(Reference isCaseOf) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - /** * This function allows setting a value for administration * @@ -182,4 +160,26 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java new file mode 100644 index 000000000..1e7b4c9c0 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/DescriptorBuilder.java @@ -0,0 +1,93 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; + +import java.util.List; + + +public abstract class DescriptorBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java new file mode 100644 index 000000000..a1040c6b4 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EndpointBuilder.java @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + + +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; + + +public abstract class EndpointBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for _interface + * + * @param _interface desired value to be set + * @return Builder object with new value for _interface + */ + public B _interface(String _interface) { + getBuildingInstance().set_interface(_interface); + return getSelf(); + } + + /** + * This function allows setting a value for protocolInformation + * + * @param protocolInformation desired value to be set + * @return Builder object with new value for protocolInformation + */ + public B protocolInformation(ProtocolInformation protocolInformation) { + getBuildingInstance().setProtocolInformation(protocolInformation); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java index 98511ba99..0571300fa 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/EntityBuilder.java @@ -119,61 +119,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -261,4 +206,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java index ff1eacc8b..675181358 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/FileBuilder.java @@ -72,61 +72,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -214,4 +159,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java new file mode 100644 index 000000000..2450de674 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MessageBuilder.java @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + + +import org.eclipse.digitaltwin.aas4j.v3.model.Message; +import org.eclipse.digitaltwin.aas4j.v3.model.MessageTypeEnum; + + +public abstract class MessageBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for code + * + * @param code desired value to be set + * @return Builder object with new value for code + */ + public B code(String code) { + getBuildingInstance().setCode(code); + return getSelf(); + } + + /** + * This function allows setting a value for correlationId + * + * @param correlationId desired value to be set + * @return Builder object with new value for correlationId + */ + public B correlationId(String correlationId) { + getBuildingInstance().setCorrelationId(correlationId); + return getSelf(); + } + + /** + * This function allows setting a value for messageType + * + * @param messageType desired value to be set + * @return Builder object with new value for messageType + */ + public B messageType(MessageTypeEnum messageType) { + getBuildingInstance().setMessageType(messageType); + return getSelf(); + } + + /** + * This function allows setting a value for text + * + * @param text desired value to be set + * @return Builder object with new value for text + */ + public B text(String text) { + getBuildingInstance().setText(text); + return getSelf(); + } + + /** + * This function allows setting a value for timestamp + * + * @param timestamp desired value to be set + * @return Builder object with new value for timestamp + */ + public B timestamp(String timestamp) { + getBuildingInstance().setTimestamp(timestamp); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java index 85f30d76a..88263ea0f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/MultiLanguagePropertyBuilder.java @@ -84,61 +84,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -226,4 +171,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java index f7d0a63a9..c8270827f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationBuilder.java @@ -96,167 +96,167 @@ public B inoutputVariables(OperationVariable inoutputVariables) { } /** - * This function allows setting a value for embeddedDataSpecifications + * This function allows setting a value for category * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications + * @param category desired value to be set + * @return Builder object with new value for category */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + public B category(String category) { + getBuildingInstance().setCategory(category); return getSelf(); } /** - * This function allows adding a value to the List embeddedDataSpecifications + * This function allows setting a value for idShort * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications + * @param idShort desired value to be set + * @return Builder object with new value for idShort */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); return getSelf(); } /** - * This function allows setting a value for semanticId + * This function allows setting a value for displayName * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId + * @param displayNames desired value to be set + * @return Builder object with new value for displayName */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); return getSelf(); } /** - * This function allows setting a value for supplementalSemanticIds + * This function allows adding a value to the List displayName * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds + * @param displayName desired value to be added + * @return Builder object with new value for displayName */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); return getSelf(); } /** - * This function allows adding a value to the List supplementalSemanticIds + * This function allows setting a value for description * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds + * @param descriptions desired value to be set + * @return Builder object with new value for description */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); return getSelf(); } /** - * This function allows setting a value for qualifiers + * This function allows adding a value to the List description * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers + * @param description desired value to be added + * @return Builder object with new value for description */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); return getSelf(); } /** - * This function allows adding a value to the List qualifiers + * This function allows setting a value for extensions * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers + * @param extensions desired value to be set + * @return Builder object with new value for extensions */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); return getSelf(); } /** - * This function allows setting a value for category + * This function allows adding a value to the List extensions * - * @param category desired value to be set - * @return Builder object with new value for category + * @param extensions desired value to be added + * @return Builder object with new value for extensions */ - public B category(String category) { - getBuildingInstance().setCategory(category); + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); return getSelf(); } /** - * This function allows setting a value for idShort + * This function allows setting a value for embeddedDataSpecifications * - * @param idShort desired value to be set - * @return Builder object with new value for idShort + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications */ - public B idShort(String idShort) { - getBuildingInstance().setIdShort(idShort); + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); return getSelf(); } /** - * This function allows setting a value for displayName + * This function allows adding a value to the List embeddedDataSpecifications * - * @param displayNames desired value to be set - * @return Builder object with new value for displayName + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications */ - public B displayName(List displayNames) { - getBuildingInstance().setDisplayName(displayNames); + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); return getSelf(); } /** - * This function allows adding a value to the List displayName + * This function allows setting a value for semanticId * - * @param displayName desired value to be added - * @return Builder object with new value for displayName + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId */ - public B displayName(LangStringNameType displayName) { - getBuildingInstance().getDisplayName().add(displayName); + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); return getSelf(); } /** - * This function allows setting a value for description + * This function allows setting a value for supplementalSemanticIds * - * @param descriptions desired value to be set - * @return Builder object with new value for description + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds */ - public B description(List descriptions) { - getBuildingInstance().setDescription(descriptions); + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); return getSelf(); } /** - * This function allows adding a value to the List description + * This function allows adding a value to the List supplementalSemanticIds * - * @param description desired value to be added - * @return Builder object with new value for description + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds */ - public B description(LangStringTextType description) { - getBuildingInstance().getDescription().add(description); + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); return getSelf(); } /** - * This function allows setting a value for extensions + * This function allows setting a value for qualifiers * - * @param extensions desired value to be set - * @return Builder object with new value for extensions + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers */ - public B extensions(List extensions) { - getBuildingInstance().setExtensions(extensions); + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); return getSelf(); } /** - * This function allows adding a value to the List extensions + * This function allows adding a value to the List qualifiers * - * @param extensions desired value to be added - * @return Builder object with new value for extensions + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers */ - public B extensions(Extension extensions) { - getBuildingInstance().getExtensions().add(extensions); + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java new file mode 100644 index 000000000..1307ed2b5 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationHandleBuilder.java @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationHandle; + + +public abstract class OperationHandleBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for handleId + * + * @param handleId desired value to be set + * @return Builder object with new value for handleId + */ + public B handleId(String handleId) { + getBuildingInstance().setHandleId(handleId); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java new file mode 100644 index 000000000..fe598803f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationRequestBuilder.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + +import javax.xml.datatype.Duration; +import java.util.List; + + +public abstract class OperationRequestBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for inoutputArguments + * + * @param inoutputArguments desired value to be set + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(List inoutputArguments) { + getBuildingInstance().setInoutputArguments(inoutputArguments); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputArguments + * + * @param inoutputArguments desired value to be added + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(OperationVariable inoutputArguments) { + getBuildingInstance().getInoutputArguments().add(inoutputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for inputArguments + * + * @param inputArguments desired value to be set + * @return Builder object with new value for inputArguments + */ + public B inputArguments(List inputArguments) { + getBuildingInstance().setInputArguments(inputArguments); + return getSelf(); + } + + /** + * This function allows adding a value to the List inputArguments + * + * @param inputArguments desired value to be added + * @return Builder object with new value for inputArguments + */ + public B inputArguments(OperationVariable inputArguments) { + getBuildingInstance().getInputArguments().add(inputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for clientTimeoutDuration + * + * @param clientTimeoutDuration desired value to be set + * @return Builder object with new value for clientTimeoutDuration + */ + public B clientTimeoutDuration(Duration clientTimeoutDuration) { + getBuildingInstance().setClientTimeoutDuration(clientTimeoutDuration); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java new file mode 100644 index 000000000..edf5b944f --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/OperationResultBuilder.java @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationResult; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; + +import java.util.List; + + +public abstract class OperationResultBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for inoutputArguments + * + * @param inoutputArguments desired value to be set + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(List inoutputArguments) { + getBuildingInstance().setInoutputArguments(inoutputArguments); + return getSelf(); + } + + /** + * This function allows adding a value to the List inoutputArguments + * + * @param inoutputArguments desired value to be added + * @return Builder object with new value for inoutputArguments + */ + public B inoutputArguments(OperationVariable inoutputArguments) { + getBuildingInstance().getInoutputArguments().add(inoutputArguments); + return getSelf(); + } + + /** + * This function allows setting a value for outputArguments + * + * @param outputArguments desired value to be set + * @return Builder object with new value for outputArguments + */ + public B outputArguments(List outputArguments) { + getBuildingInstance().setOutputArguments(outputArguments); + return getSelf(); + } + + /** + * This function allows adding a value to the List outputArguments + * + * @param outputArguments desired value to be added + * @return Builder object with new value for outputArguments + */ + public B outputArguments(OperationVariable outputArguments) { + getBuildingInstance().getOutputArguments().add(outputArguments); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PackageDescriptionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PackageDescriptionBuilder.java new file mode 100644 index 000000000..6fd672705 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PackageDescriptionBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.PackageDescription; + +import java.util.List; + + +public abstract class PackageDescriptionBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for items + * + * @param items desired value to be set + * @return Builder object with new value for items + */ + public B items(List items) { + getBuildingInstance().setItems(items); + return getSelf(); + } + + /** + * This function allows adding a value to the List items + * + * @param items desired value to be added + * @return Builder object with new value for items + */ + public B items(String items) { + getBuildingInstance().getItems().add(items); + return getSelf(); + } + + /** + * This function allows setting a value for packageId + * + * @param packageId desired value to be set + * @return Builder object with new value for packageId + */ + public B packageId(String packageId) { + getBuildingInstance().setPackageId(packageId); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java index dc6fd05b1..341655cd5 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/PropertyBuilder.java @@ -84,61 +84,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -226,4 +171,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java new file mode 100644 index 000000000..c94565ef6 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ProtocolInformationBuilder.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityAttributeObject; + +import java.util.List; + + +public abstract class ProtocolInformationBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for href + * + * @param href desired value to be set + * @return Builder object with new value for href + */ + public B href(String href) { + getBuildingInstance().setHref(href); + return getSelf(); + } + + /** + * This function allows setting a value for endpointProtocol + * + * @param endpointProtocol desired value to be set + * @return Builder object with new value for endpointProtocol + */ + public B endpointProtocol(String endpointProtocol) { + getBuildingInstance().setEndpointProtocol(endpointProtocol); + return getSelf(); + } + + /** + * This function allows setting a value for endpointProtocolVersion + * + * @param endpointProtocolVersions desired value to be set + * @return Builder object with new value for endpointProtocolVersion + */ + public B endpointProtocolVersion(List endpointProtocolVersions) { + getBuildingInstance().setEndpointProtocolVersion(endpointProtocolVersions); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpointProtocolVersion + * + * @param endpointProtocolVersion desired value to be added + * @return Builder object with new value for endpointProtocolVersion + */ + public B endpointProtocolVersion(String endpointProtocolVersion) { + getBuildingInstance().getEndpointProtocolVersion().add(endpointProtocolVersion); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocol + * + * @param subprotocol desired value to be set + * @return Builder object with new value for subprotocol + */ + public B subprotocol(String subprotocol) { + getBuildingInstance().setSubprotocol(subprotocol); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocolBody + * + * @param subprotocolBody desired value to be set + * @return Builder object with new value for subprotocolBody + */ + public B subprotocolBody(String subprotocolBody) { + getBuildingInstance().setSubprotocolBody(subprotocolBody); + return getSelf(); + } + + /** + * This function allows setting a value for subprotocolBodyEncoding + * + * @param subprotocolBodyEncoding desired value to be set + * @return Builder object with new value for subprotocolBodyEncoding + */ + public B subprotocolBodyEncoding(String subprotocolBodyEncoding) { + getBuildingInstance().setSubprotocolBodyEncoding(subprotocolBodyEncoding); + return getSelf(); + } + + /** + * This function allows setting a value for securityAttributes + * + * @param securityAttributes desired value to be set + * @return Builder object with new value for securityAttributes + */ + public B securityAttributes(List securityAttributes) { + getBuildingInstance().setSecurityAttributes(securityAttributes); + return getSelf(); + } + + /** + * This function allows adding a value to the List securityAttributes + * + * @param securityAttributes desired value to be added + * @return Builder object with new value for securityAttributes + */ + public B securityAttributes(SecurityAttributeObject securityAttributes) { + getBuildingInstance().getSecurityAttributes().add(securityAttributes); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java index e6bf48fc8..154ab006a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RangeBuilder.java @@ -84,61 +84,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -226,4 +171,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java index 6aa98e110..6cdf40435 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ReferenceElementBuilder.java @@ -62,61 +62,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -204,4 +149,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java index 081547980..01c1d2815 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/RelationshipElementBuilder.java @@ -73,61 +73,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -215,4 +160,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java new file mode 100644 index 000000000..db842fc77 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/ResultBuilder.java @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.Message; +import org.eclipse.digitaltwin.aas4j.v3.model.Result; + +import java.util.List; + + +public abstract class ResultBuilder> extends ExtendableBuilder { + + /** + * This function allows setting a value for messages + * + * @param messages desired value to be set + * @return Builder object with new value for messages + */ + public B messages(List messages) { + getBuildingInstance().setMessages(messages); + return getSelf(); + } + + /** + * This function allows adding a value to the List messages + * + * @param messages desired value to be added + * @return Builder object with new value for messages + */ + public B messages(Message messages) { + getBuildingInstance().getMessages().add(messages); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SecurityAttributeObjectBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SecurityAttributeObjectBuilder.java new file mode 100644 index 000000000..5277d7b60 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SecurityAttributeObjectBuilder.java @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + + +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityAttributeObject; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; + + +public abstract class SecurityAttributeObjectBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for type + * + * @param type desired value to be set + * @return Builder object with new value for type + */ + public B type(SecurityTypeEnum type) { + getBuildingInstance().setType(type); + return getSelf(); + } + + /** + * This function allows setting a value for key + * + * @param key desired value to be set + * @return Builder object with new value for key + */ + public B key(String key) { + getBuildingInstance().setKey(key); + return getSelf(); + } + + /** + * This function allows setting a value for value + * + * @param value desired value to be set + * @return Builder object with new value for value + */ + public B value(String value) { + getBuildingInstance().setValue(value); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java index c3c970250..0546305c9 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelBuilder.java @@ -53,72 +53,6 @@ public B submodelElements(SubmodelElement submodelElements) { return getSelf(); } - /** - * This function allows setting a value for embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be set - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(List embeddedDataSpecifications) { - getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows adding a value to the List embeddedDataSpecifications - * - * @param embeddedDataSpecifications desired value to be added - * @return Builder object with new value for embeddedDataSpecifications - */ - public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { - getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); - return getSelf(); - } - - /** - * This function allows setting a value for kind - * - * @param kind desired value to be set - * @return Builder object with new value for kind - */ - public B kind(ModellingKind kind) { - getBuildingInstance().setKind(kind); - return getSelf(); - } - - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - /** * This function allows setting a value for administration * @@ -229,6 +163,61 @@ public B extensions(Extension extensions) { return getSelf(); } + /** + * This function allows setting a value for embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be set + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(List embeddedDataSpecifications) { + getBuildingInstance().setEmbeddedDataSpecifications(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows adding a value to the List embeddedDataSpecifications + * + * @param embeddedDataSpecifications desired value to be added + * @return Builder object with new value for embeddedDataSpecifications + */ + public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecifications) { + getBuildingInstance().getEmbeddedDataSpecifications().add(embeddedDataSpecifications); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + /** * This function allows setting a value for qualifiers * @@ -250,4 +239,15 @@ public B qualifiers(Qualifier qualifiers) { getBuildingInstance().getQualifiers().add(qualifiers); return getSelf(); } + + /** + * This function allows setting a value for kind + * + * @param kind desired value to be set + * @return Builder object with new value for kind + */ + public B kind(ModellingKind kind) { + getBuildingInstance().setKind(kind); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java new file mode 100644 index 000000000..0897fbd3e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelDescriptorBuilder.java @@ -0,0 +1,185 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.builder; + +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; + +import java.util.List; + + +public abstract class SubmodelDescriptorBuilder> + extends ExtendableBuilder { + + /** + * This function allows setting a value for administration + * + * @param administration desired value to be set + * @return Builder object with new value for administration + */ + public B administration(AdministrativeInformation administration) { + getBuildingInstance().setAdministration(administration); + return getSelf(); + } + + /** + * This function allows setting a value for endpoints + * + * @param endpoints desired value to be set + * @return Builder object with new value for endpoints + */ + public B endpoints(List endpoints) { + getBuildingInstance().setEndpoints(endpoints); + return getSelf(); + } + + /** + * This function allows adding a value to the List endpoints + * + * @param endpoints desired value to be added + * @return Builder object with new value for endpoints + */ + public B endpoints(Endpoint endpoints) { + getBuildingInstance().getEndpoints().add(endpoints); + return getSelf(); + } + + /** + * This function allows setting a value for idShort + * + * @param idShort desired value to be set + * @return Builder object with new value for idShort + */ + public B idShort(String idShort) { + getBuildingInstance().setIdShort(idShort); + return getSelf(); + } + + /** + * This function allows setting a value for id + * + * @param id desired value to be set + * @return Builder object with new value for id + */ + public B id(String id) { + getBuildingInstance().setId(id); + return getSelf(); + } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticId + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticId + */ + public B supplementalSemanticId(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticId(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticId + * + * @param supplementalSemanticId desired value to be added + * @return Builder object with new value for supplementalSemanticId + */ + public B supplementalSemanticId(Reference supplementalSemanticId) { + getBuildingInstance().getSupplementalSemanticId().add(supplementalSemanticId); + return getSelf(); + } + + /** + * This function allows setting a value for description + * + * @param descriptions desired value to be set + * @return Builder object with new value for description + */ + public B description(List descriptions) { + getBuildingInstance().setDescription(descriptions); + return getSelf(); + } + + /** + * This function allows adding a value to the List description + * + * @param description desired value to be added + * @return Builder object with new value for description + */ + public B description(LangStringTextType description) { + getBuildingInstance().getDescription().add(description); + return getSelf(); + } + + /** + * This function allows setting a value for displayName + * + * @param displayNames desired value to be set + * @return Builder object with new value for displayName + */ + public B displayName(List displayNames) { + getBuildingInstance().setDisplayName(displayNames); + return getSelf(); + } + + /** + * This function allows adding a value to the List displayName + * + * @param displayName desired value to be added + * @return Builder object with new value for displayName + */ + public B displayName(LangStringNameType displayName) { + getBuildingInstance().getDisplayName().add(displayName); + return getSelf(); + } + + /** + * This function allows setting a value for extensions + * + * @param extensions desired value to be set + * @return Builder object with new value for extensions + */ + public B extensions(List extensions) { + getBuildingInstance().setExtensions(extensions); + return getSelf(); + } + + /** + * This function allows adding a value to the List extensions + * + * @param extensions desired value to be added + * @return Builder object with new value for extensions + */ + public B extensions(Extension extensions) { + getBuildingInstance().getExtensions().add(extensions); + return getSelf(); + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java index e1c8e980c..afa1350bd 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementCollectionBuilder.java @@ -74,61 +74,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -216,4 +161,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java index f50442fee..734351772 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/builder/SubmodelElementListBuilder.java @@ -120,61 +120,6 @@ public B embeddedDataSpecifications(EmbeddedDataSpecification embeddedDataSpecif return getSelf(); } - /** - * This function allows setting a value for semanticId - * - * @param semanticId desired value to be set - * @return Builder object with new value for semanticId - */ - public B semanticId(Reference semanticId) { - getBuildingInstance().setSemanticId(semanticId); - return getSelf(); - } - - /** - * This function allows setting a value for supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be set - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(List supplementalSemanticIds) { - getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows adding a value to the List supplementalSemanticIds - * - * @param supplementalSemanticIds desired value to be added - * @return Builder object with new value for supplementalSemanticIds - */ - public B supplementalSemanticIds(Reference supplementalSemanticIds) { - getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); - return getSelf(); - } - - /** - * This function allows setting a value for qualifiers - * - * @param qualifiers desired value to be set - * @return Builder object with new value for qualifiers - */ - public B qualifiers(List qualifiers) { - getBuildingInstance().setQualifiers(qualifiers); - return getSelf(); - } - - /** - * This function allows adding a value to the List qualifiers - * - * @param qualifiers desired value to be added - * @return Builder object with new value for qualifiers - */ - public B qualifiers(Qualifier qualifiers) { - getBuildingInstance().getQualifiers().add(qualifiers); - return getSelf(); - } - /** * This function allows setting a value for category * @@ -262,4 +207,59 @@ public B extensions(Extension extensions) { getBuildingInstance().getExtensions().add(extensions); return getSelf(); } + + /** + * This function allows setting a value for semanticId + * + * @param semanticId desired value to be set + * @return Builder object with new value for semanticId + */ + public B semanticId(Reference semanticId) { + getBuildingInstance().setSemanticId(semanticId); + return getSelf(); + } + + /** + * This function allows setting a value for supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be set + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(List supplementalSemanticIds) { + getBuildingInstance().setSupplementalSemanticIds(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows adding a value to the List supplementalSemanticIds + * + * @param supplementalSemanticIds desired value to be added + * @return Builder object with new value for supplementalSemanticIds + */ + public B supplementalSemanticIds(Reference supplementalSemanticIds) { + getBuildingInstance().getSupplementalSemanticIds().add(supplementalSemanticIds); + return getSelf(); + } + + /** + * This function allows setting a value for qualifiers + * + * @param qualifiers desired value to be set + * @return Builder object with new value for qualifiers + */ + public B qualifiers(List qualifiers) { + getBuildingInstance().setQualifiers(qualifiers); + return getSelf(); + } + + /** + * This function allows adding a value to the List qualifiers + * + * @param qualifiers desired value to be added + * @return Builder object with new value for qualifiers + */ + public B qualifiers(Qualifier qualifiers) { + getBuildingInstance().getQualifiers().add(qualifiers); + return getSelf(); + } } diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java index 6ae2c1d6a..1f771a2d1 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAnnotatedRelationshipElement.java @@ -86,14 +86,14 @@ public int hashCode() { this.first, this.second, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -110,14 +110,14 @@ public boolean equals(Object obj) { Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -161,36 +161,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -241,6 +211,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultAnnotatedRelationshipElement (" + "annotations=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java index 7fc97b452..755ef9896 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShell.java @@ -80,14 +80,14 @@ public int hashCode() { return Objects.hash(this.derivedFrom, this.assetInformation, this.submodels, - this.embeddedDataSpecifications, this.administration, this.id, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.embeddedDataSpecifications); } @Override @@ -103,14 +103,14 @@ public boolean equals(Object obj) { return Objects.equals(this.derivedFrom, other.derivedFrom) && Objects.equals(this.assetInformation, other.assetInformation) && Objects.equals(this.submodels, other.submodels) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } @@ -144,16 +144,6 @@ public void setSubmodels(List submodels) { this.submodels = submodels; } - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - @Override public AdministrativeInformation getAdministration() { return administration; @@ -224,6 +214,16 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + public String toString() { return String.format( "DefaultAssetAdministrationShell (" + "derivedFrom=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java new file mode 100644 index 000000000..3d483e26a --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultAssetAdministrationShellDescriptor.java @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.SpecificAssetId; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.AssetAdministrationShellDescriptorBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package + * org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor + * + */ + +@IRI("aas:AssetAdministrationShellDescriptor") +public class DefaultAssetAdministrationShellDescriptor implements AssetAdministrationShellDescriptor { + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/administration") + protected AdministrativeInformation administration; + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetKind") + protected AssetKind assetKind; + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/assetType") + protected String assetType; + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/globalAssetId") + protected String globalAssetId; + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/id") + protected String id; + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/specificAssetIds") + protected List specificAssetIds = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/AssetAdministrationShellDescriptor/submodelDescriptors") + protected List submodelDescriptors = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/extensions") + protected List extensions = new ArrayList<>(); + + public DefaultAssetAdministrationShellDescriptor() {} + + @Override + public int hashCode() { + return Objects.hash(this.administration, + this.assetKind, + this.assetType, + this.endpoints, + this.globalAssetId, + this.idShort, + this.id, + this.specificAssetIds, + this.submodelDescriptors, + this.description, + this.displayName, + this.extensions); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultAssetAdministrationShellDescriptor other = (DefaultAssetAdministrationShellDescriptor) obj; + return Objects.equals(this.administration, other.administration) && + Objects.equals(this.assetKind, other.assetKind) && + Objects.equals(this.assetType, other.assetType) && + Objects.equals(this.endpoints, other.endpoints) && + Objects.equals(this.globalAssetId, other.globalAssetId) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.id, other.id) && + Objects.equals(this.specificAssetIds, other.specificAssetIds) && + Objects.equals(this.submodelDescriptors, other.submodelDescriptors) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.extensions, other.extensions); + } + } + + @Override + public AdministrativeInformation getAdministration() { + return administration; + } + + @Override + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; + } + + @Override + public AssetKind getAssetKind() { + return assetKind; + } + + @Override + public void setAssetKind(AssetKind assetKind) { + this.assetKind = assetKind; + } + + @Override + public String getAssetType() { + return assetType; + } + + @Override + public void setAssetType(String assetType) { + this.assetType = assetType; + } + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + @Override + public String getGlobalAssetId() { + return globalAssetId; + } + + @Override + public void setGlobalAssetId(String globalAssetId) { + this.globalAssetId = globalAssetId; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public List getSpecificAssetIds() { + return specificAssetIds; + } + + @Override + public void setSpecificAssetIds(List specificAssetIds) { + this.specificAssetIds = specificAssetIds; + } + + @Override + public List getSubmodelDescriptors() { + return submodelDescriptors; + } + + @Override + public void setSubmodelDescriptors(List submodelDescriptors) { + this.submodelDescriptors = submodelDescriptors; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + public String toString() { + return String.format( + "DefaultAssetAdministrationShellDescriptor (" + "administration=%s," + + "assetKind=%s," + + "assetType=%s," + + "endpoints=%s," + + "globalAssetId=%s," + + "idShort=%s," + + "id=%s," + + "specificAssetIds=%s," + + "submodelDescriptors=%s," + + ")", + this.administration, this.assetKind, this.assetType, this.endpoints, this.globalAssetId, this.idShort, this.id, + this.specificAssetIds, this.submodelDescriptors); + } + + /** + * This builder class can be used to construct a DefaultAssetAdministrationShellDescriptor bean. + */ + public static class Builder extends AssetAdministrationShellDescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultAssetAdministrationShellDescriptor newBuildingInstance() { + return new DefaultAssetAdministrationShellDescriptor(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBaseOperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBaseOperationResult.java new file mode 100644 index 000000000..e9507263c --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBaseOperationResult.java @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.BaseOperationResult; +import org.eclipse.digitaltwin.aas4j.v3.model.ExecutionState; +import org.eclipse.digitaltwin.aas4j.v3.model.Message; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.BaseOperationResultBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.BaseOperationResult + * + */ + +@IRI("aas:BaseOperationResult") +public class DefaultBaseOperationResult implements BaseOperationResult { + + @IRI("https://admin-shell.io/aas/3/0/BaseOperationResult/executionState") + protected ExecutionState executionState; + + @IRI("https://admin-shell.io/aas/3/0/BaseOperationResult/success") + protected boolean success; + + @IRI("https://admin-shell.io/aas/3/0/Result/messages") + protected List messages = new ArrayList<>(); + + public DefaultBaseOperationResult() {} + + @Override + public int hashCode() { + return Objects.hash(this.executionState, + this.success, + this.messages); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultBaseOperationResult other = (DefaultBaseOperationResult) obj; + return Objects.equals(this.executionState, other.executionState) && + Objects.equals(this.success, other.success) && + Objects.equals(this.messages, other.messages); + } + } + + @Override + public ExecutionState getExecutionState() { + return executionState; + } + + @Override + public void setExecutionState(ExecutionState executionState) { + this.executionState = executionState; + } + + @Override + public boolean getSuccess() { + return success; + } + + @Override + public void setSuccess(boolean success) { + this.success = success; + } + + @Override + public List getMessages() { + return messages; + } + + @Override + public void setMessages(List messages) { + this.messages = messages; + } + + public String toString() { + return String.format( + "DefaultBaseOperationResult (" + "executionState=%s," + + "success=%s," + + ")", + this.executionState, this.success); + } + + /** + * This builder class can be used to construct a DefaultBaseOperationResult bean. + */ + public static class Builder extends BaseOperationResultBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultBaseOperationResult newBuildingInstance() { + return new DefaultBaseOperationResult(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java index 0763b8ba6..c7fbf209c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBasicEventElement.java @@ -105,14 +105,14 @@ public int hashCode() { this.minInterval, this.maxInterval, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -134,14 +134,14 @@ public boolean equals(Object obj) { Objects.equals(this.minInterval, other.minInterval) && Objects.equals(this.maxInterval, other.maxInterval) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -235,36 +235,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -315,6 +285,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultBasicEventElement (" + "observed=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java index ebf7e4ca4..c0208e296 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultBlob.java @@ -81,14 +81,14 @@ public int hashCode() { return Objects.hash(Arrays.hashCode(this.value), this.contentType, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -104,14 +104,14 @@ public boolean equals(Object obj) { return Arrays.equals(this.value, other.value) && Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -145,36 +145,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -225,12 +195,42 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultBlob (" + "value=%s," + "contentType=%s," + ")", - Arrays.toString(this.value), this.contentType); + Arrays.toString(this.value), this.contentType); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java index d4167b66a..4f249157c 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultCapability.java @@ -72,14 +72,14 @@ public DefaultCapability() {} @Override public int hashCode() { return Objects.hash(this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -93,14 +93,14 @@ public boolean equals(Object obj) { } else { DefaultCapability other = (DefaultCapability) obj; return Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -114,36 +114,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -194,6 +164,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultCapability (" diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java index 51ad68c22..0e7d03eb7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultConceptDescription.java @@ -72,14 +72,14 @@ public DefaultConceptDescription() {} @Override public int hashCode() { return Objects.hash(this.isCaseOf, - this.embeddedDataSpecifications, this.administration, this.id, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.embeddedDataSpecifications); } @Override @@ -93,14 +93,14 @@ public boolean equals(Object obj) { } else { DefaultConceptDescription other = (DefaultConceptDescription) obj; return Objects.equals(this.isCaseOf, other.isCaseOf) && - Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && Objects.equals(this.administration, other.administration) && Objects.equals(this.id, other.id) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications); } } @@ -114,16 +114,6 @@ public void setIsCaseOf(List isCaseOfs) { this.isCaseOf = isCaseOfs; } - @Override - public List getEmbeddedDataSpecifications() { - return embeddedDataSpecifications; - } - - @Override - public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { - this.embeddedDataSpecifications = embeddedDataSpecifications; - } - @Override public AdministrativeInformation getAdministration() { return administration; @@ -194,6 +184,16 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public List getEmbeddedDataSpecifications() { + return embeddedDataSpecifications; + } + + @Override + public void setEmbeddedDataSpecifications(List embeddedDataSpecifications) { + this.embeddedDataSpecifications = embeddedDataSpecifications; + } + public String toString() { return String.format( "DefaultConceptDescription (" + "isCaseOf=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java new file mode 100644 index 000000000..f3496933a --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultDescriptor.java @@ -0,0 +1,126 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Descriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.DescriptorBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Descriptor + * + */ + +@IRI("aas:Descriptor") +public class DefaultDescriptor implements Descriptor { + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/extensions") + protected List extensions = new ArrayList<>(); + + public DefaultDescriptor() {} + + @Override + public int hashCode() { + return Objects.hash(this.description, + this.displayName, + this.extensions); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultDescriptor other = (DefaultDescriptor) obj; + return Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.extensions, other.extensions); + } + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + public String toString() { + return String.format( + "DefaultDescriptor (" + "description=%s," + + "displayName=%s," + + "extensions=%s," + + ")", + this.description, this.displayName, this.extensions); + } + + /** + * This builder class can be used to construct a DefaultDescriptor bean. + */ + public static class Builder extends DescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultDescriptor newBuildingInstance() { + return new DefaultDescriptor(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java new file mode 100644 index 000000000..91167f351 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEndpoint.java @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.EndpointBuilder; + +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Endpoint + * + */ + +@IRI("aas:Endpoint") +public class DefaultEndpoint implements Endpoint { + + @IRI("https://admin-shell.io/aas/3/0/Endpoint/_interface") + protected String _interface; + + @IRI("https://admin-shell.io/aas/3/0/Endpoint/protocolInformation") + protected ProtocolInformation protocolInformation; + + public DefaultEndpoint() {} + + @Override + public int hashCode() { + return Objects.hash(this._interface, + this.protocolInformation); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultEndpoint other = (DefaultEndpoint) obj; + return Objects.equals(this._interface, other._interface) && + Objects.equals(this.protocolInformation, other.protocolInformation); + } + } + + @Override + public String get_interface() { + return _interface; + } + + @Override + public void set_interface(String _interface) { + this._interface = _interface; + } + + @Override + public ProtocolInformation getProtocolInformation() { + return protocolInformation; + } + + @Override + public void setProtocolInformation(ProtocolInformation protocolInformation) { + this.protocolInformation = protocolInformation; + } + + public String toString() { + return String.format( + "DefaultEndpoint (" + "_interface=%s," + + "protocolInformation=%s," + + ")", + this._interface, this.protocolInformation); + } + + /** + * This builder class can be used to construct a DefaultEndpoint bean. + */ + public static class Builder extends EndpointBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultEndpoint newBuildingInstance() { + return new DefaultEndpoint(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java index e39c60717..9df1c5a11 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEntity.java @@ -90,14 +90,14 @@ public int hashCode() { this.globalAssetId, this.specificAssetIds, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -115,14 +115,14 @@ public boolean equals(Object obj) { Objects.equals(this.globalAssetId, other.globalAssetId) && Objects.equals(this.specificAssetIds, other.specificAssetIds) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -176,36 +176,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -256,6 +226,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultEntity (" + "statements=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java index 750f1c5ff..5e9a29003 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultEventPayload.java @@ -184,7 +184,7 @@ public String toString() { + "payload=%s," + ")", this.source, this.sourceSemanticId, this.observableReference, this.observableSemanticId, this.topic, this.subjectId, - this.timeStamp, this.payload); + this.timeStamp, Arrays.toString(this.payload)); } /** diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java index cc7957958..eb013ed1f 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultExtension.java @@ -53,9 +53,7 @@ public class DefaultExtension implements Extension { @IRI("https://admin-shell.io/aas/3/0/HasSemantics/supplementalSemanticIds") protected List supplementalSemanticIds = new ArrayList<>(); - public DefaultExtension() { - this.valueType = DataTypeDefXsd.STRING; - } + public DefaultExtension() {} @Override public int hashCode() { diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java index 5540d1eb0..0b0251441 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultFile.java @@ -79,14 +79,14 @@ public int hashCode() { return Objects.hash(this.value, this.contentType, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -102,14 +102,14 @@ public boolean equals(Object obj) { return Objects.equals(this.value, other.value) && Objects.equals(this.contentType, other.contentType) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -143,36 +143,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -223,6 +193,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultFile (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java new file mode 100644 index 000000000..89b06f102 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMessage.java @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Message; +import org.eclipse.digitaltwin.aas4j.v3.model.MessageTypeEnum; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.MessageBuilder; + +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Message + * + */ + +@IRI("aas:Message") +public class DefaultMessage implements Message { + + @IRI("https://admin-shell.io/aas/3/0/Message/code") + protected String code; + + @IRI("https://admin-shell.io/aas/3/0/Message/correlationId") + protected String correlationId; + + @IRI("https://admin-shell.io/aas/3/0/Message/messageType") + protected MessageTypeEnum messageType; + + @IRI("https://admin-shell.io/aas/3/0/Message/text") + protected String text; + + @IRI("https://admin-shell.io/aas/3/0/Message/timestamp") + protected String timestamp; + + public DefaultMessage() {} + + @Override + public int hashCode() { + return Objects.hash(this.code, + this.correlationId, + this.messageType, + this.text, + this.timestamp); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultMessage other = (DefaultMessage) obj; + return Objects.equals(this.code, other.code) && + Objects.equals(this.correlationId, other.correlationId) && + Objects.equals(this.messageType, other.messageType) && + Objects.equals(this.text, other.text) && + Objects.equals(this.timestamp, other.timestamp); + } + } + + @Override + public String getCode() { + return code; + } + + @Override + public void setCode(String code) { + this.code = code; + } + + @Override + public String getCorrelationId() { + return correlationId; + } + + @Override + public void setCorrelationId(String correlationId) { + this.correlationId = correlationId; + } + + @Override + public MessageTypeEnum getMessageType() { + return messageType; + } + + @Override + public void setMessageType(MessageTypeEnum messageType) { + this.messageType = messageType; + } + + @Override + public String getText() { + return text; + } + + @Override + public void setText(String text) { + this.text = text; + } + + @Override + public String getTimestamp() { + return timestamp; + } + + @Override + public void setTimestamp(String timestamp) { + this.timestamp = timestamp; + } + + public String toString() { + return String.format( + "DefaultMessage (" + "code=%s," + + "correlationId=%s," + + "messageType=%s," + + "text=%s," + + "timestamp=%s," + + ")", + this.code, this.correlationId, this.messageType, this.text, this.timestamp); + } + + /** + * This builder class can be used to construct a DefaultMessage bean. + */ + public static class Builder extends MessageBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultMessage newBuildingInstance() { + return new DefaultMessage(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java index 2c0de4f5f..651b3beb7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultMultiLanguageProperty.java @@ -79,14 +79,14 @@ public int hashCode() { return Objects.hash(this.value, this.valueId, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -102,14 +102,14 @@ public boolean equals(Object obj) { return Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -143,36 +143,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -223,6 +193,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultMultiLanguageProperty (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java index ff6d65c2e..5615c9158 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperation.java @@ -84,14 +84,14 @@ public int hashCode() { this.outputVariables, this.inoutputVariables, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -108,14 +108,14 @@ public boolean equals(Object obj) { Objects.equals(this.outputVariables, other.outputVariables) && Objects.equals(this.inoutputVariables, other.inoutputVariables) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -159,36 +159,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -239,6 +209,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultOperation (" + "inputVariables=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java new file mode 100644 index 000000000..7a1160c44 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationHandle.java @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationHandle; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationHandleBuilder; + +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationHandle + * + */ + +@IRI("aas:OperationHandle") +public class DefaultOperationHandle implements OperationHandle { + + @IRI("https://admin-shell.io/aas/3/0/OperationHandle/handleId") + protected String handleId; + + public DefaultOperationHandle() {} + + @Override + public int hashCode() { + return Objects.hash(this.handleId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationHandle other = (DefaultOperationHandle) obj; + return Objects.equals(this.handleId, other.handleId); + } + } + + @Override + public String getHandleId() { + return handleId; + } + + @Override + public void setHandleId(String handleId) { + this.handleId = handleId; + } + + public String toString() { + return String.format( + "DefaultOperationHandle (" + "handleId=%s," + + ")", + this.handleId); + } + + /** + * This builder class can be used to construct a DefaultOperationHandle bean. + */ + public static class Builder extends OperationHandleBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationHandle newBuildingInstance() { + return new DefaultOperationHandle(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java new file mode 100644 index 000000000..71bda258e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationRequest.java @@ -0,0 +1,125 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationRequestBuilder; + +import javax.xml.datatype.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationRequest + * + */ + +@IRI("aas:OperationRequest") +public class DefaultOperationRequest implements OperationRequest { + + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/clientTimeoutDuration") + protected Duration clientTimeoutDuration; + + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inoutputArguments") + protected List inoutputArguments = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/OperationRequest/inputArguments") + protected List inputArguments = new ArrayList<>(); + + public DefaultOperationRequest() {} + + @Override + public int hashCode() { + return Objects.hash(this.inoutputArguments, + this.inputArguments, + this.clientTimeoutDuration); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationRequest other = (DefaultOperationRequest) obj; + return Objects.equals(this.inoutputArguments, other.inoutputArguments) && + Objects.equals(this.inputArguments, other.inputArguments) && + Objects.equals(this.clientTimeoutDuration, other.clientTimeoutDuration); + } + } + + @Override + public List getInoutputArguments() { + return inoutputArguments; + } + + @Override + public void setInoutputArguments(List inoutputArguments) { + this.inoutputArguments = inoutputArguments; + } + + @Override + public List getInputArguments() { + return inputArguments; + } + + @Override + public void setInputArguments(List inputArguments) { + this.inputArguments = inputArguments; + } + + @Override + public Duration getClientTimeoutDuration() { + return clientTimeoutDuration; + } + + @Override + public void setClientTimeoutDuration(Duration clientTimeoutDuration) { + this.clientTimeoutDuration = clientTimeoutDuration; + } + + public String toString() { + return String.format( + "DefaultOperationRequest (" + "inoutputArguments=%s," + + "inputArguments=%s," + + "clientTimeoutDuration=%s," + + ")", + this.inoutputArguments, this.inputArguments, this.clientTimeoutDuration); + } + + /** + * This builder class can be used to construct a DefaultOperationRequest bean. + */ + public static class Builder extends OperationRequestBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationRequest newBuildingInstance() { + return new DefaultOperationRequest(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java new file mode 100644 index 000000000..763676200 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultOperationResult.java @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationResult; +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.OperationResultBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.OperationResult + * + */ + +@IRI("aas:OperationResult") +public class DefaultOperationResult implements OperationResult { + + @IRI("https://admin-shell.io/aas/3/0/OperationResult/inoutputArguments") + protected List inoutputArguments = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/OperationResult/outputArguments") + protected List outputArguments = new ArrayList<>(); + + public DefaultOperationResult() {} + + @Override + public int hashCode() { + return Objects.hash(this.inoutputArguments, + this.outputArguments); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultOperationResult other = (DefaultOperationResult) obj; + return Objects.equals(this.inoutputArguments, other.inoutputArguments) && + Objects.equals(this.outputArguments, other.outputArguments); + } + } + + @Override + public List getInoutputArguments() { + return inoutputArguments; + } + + @Override + public void setInoutputArguments(List inoutputArguments) { + this.inoutputArguments = inoutputArguments; + } + + @Override + public List getOutputArguments() { + return outputArguments; + } + + @Override + public void setOutputArguments(List outputArguments) { + this.outputArguments = outputArguments; + } + + public String toString() { + return String.format( + "DefaultOperationResult (" + "inoutputArguments=%s," + + "outputArguments=%s," + + ")", + this.inoutputArguments, this.outputArguments); + } + + /** + * This builder class can be used to construct a DefaultOperationResult bean. + */ + public static class Builder extends OperationResultBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultOperationResult newBuildingInstance() { + return new DefaultOperationResult(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java new file mode 100644 index 000000000..43612361c --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultPackageDescription.java @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.PackageDescription; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.PackageDescriptionBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.PackageDescription + * + */ + +@IRI("aas:PackageDescription") +public class DefaultPackageDescription implements PackageDescription { + + @IRI("https://admin-shell.io/aas/3/0/PackageDescription/items") + protected List items = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/PackageDescription/packageId") + protected String packageId; + + public DefaultPackageDescription() {} + + @Override + public int hashCode() { + return Objects.hash(this.items, + this.packageId); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultPackageDescription other = (DefaultPackageDescription) obj; + return Objects.equals(this.items, other.items) && + Objects.equals(this.packageId, other.packageId); + } + } + + @Override + public List getItems() { + return items; + } + + @Override + public void setItems(List items) { + this.items = items; + } + + @Override + public String getPackageId() { + return packageId; + } + + @Override + public void setPackageId(String packageId) { + this.packageId = packageId; + } + + public String toString() { + return String.format( + "DefaultPackageDescription (" + "items=%s," + + "packageId=%s," + + ")", + this.items, this.packageId); + } + + /** + * This builder class can be used to construct a DefaultPackageDescription bean. + */ + public static class Builder extends PackageDescriptionBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultPackageDescription newBuildingInstance() { + return new DefaultPackageDescription(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java index a53eaba9a..73bce3b3a 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProperty.java @@ -84,14 +84,14 @@ public int hashCode() { this.value, this.valueId, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -108,14 +108,14 @@ public boolean equals(Object obj) { Objects.equals(this.value, other.value) && Objects.equals(this.valueId, other.valueId) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -159,36 +159,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -239,6 +209,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultProperty (" + "valueType=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java new file mode 100644 index 000000000..6b2639f9e --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultProtocolInformation.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityAttributeObject; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.ProtocolInformationBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.ProtocolInformation + * + */ + +@IRI("aas:ProtocolInformation") +public class DefaultProtocolInformation implements ProtocolInformation { + + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocol") + protected String endpointProtocol; + + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/endpointProtocolVersion") + protected List endpointProtocolVersion = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/href") + protected String href; + + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/securityAttributes") + protected List securityAttributes = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocol") + protected String subprotocol; + + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBody") + protected String subprotocolBody; + + @IRI("https://admin-shell.io/aas/3/0/ProtocolInformation/subprotocolBodyEncoding") + protected String subprotocolBodyEncoding; + + public DefaultProtocolInformation() {} + + @Override + public int hashCode() { + return Objects.hash(this.href, + this.endpointProtocol, + this.endpointProtocolVersion, + this.subprotocol, + this.subprotocolBody, + this.subprotocolBodyEncoding, + this.securityAttributes); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultProtocolInformation other = (DefaultProtocolInformation) obj; + return Objects.equals(this.href, other.href) && + Objects.equals(this.endpointProtocol, other.endpointProtocol) && + Objects.equals(this.endpointProtocolVersion, other.endpointProtocolVersion) && + Objects.equals(this.subprotocol, other.subprotocol) && + Objects.equals(this.subprotocolBody, other.subprotocolBody) && + Objects.equals(this.subprotocolBodyEncoding, other.subprotocolBodyEncoding) && + Objects.equals(this.securityAttributes, other.securityAttributes); + } + } + + @Override + public String getHref() { + return href; + } + + @Override + public void setHref(String href) { + this.href = href; + } + + @Override + public String getEndpointProtocol() { + return endpointProtocol; + } + + @Override + public void setEndpointProtocol(String endpointProtocol) { + this.endpointProtocol = endpointProtocol; + } + + @Override + public List getEndpointProtocolVersion() { + return endpointProtocolVersion; + } + + @Override + public void setEndpointProtocolVersion(List endpointProtocolVersions) { + this.endpointProtocolVersion = endpointProtocolVersions; + } + + @Override + public String getSubprotocol() { + return subprotocol; + } + + @Override + public void setSubprotocol(String subprotocol) { + this.subprotocol = subprotocol; + } + + @Override + public String getSubprotocolBody() { + return subprotocolBody; + } + + @Override + public void setSubprotocolBody(String subprotocolBody) { + this.subprotocolBody = subprotocolBody; + } + + @Override + public String getSubprotocolBodyEncoding() { + return subprotocolBodyEncoding; + } + + @Override + public void setSubprotocolBodyEncoding(String subprotocolBodyEncoding) { + this.subprotocolBodyEncoding = subprotocolBodyEncoding; + } + + @Override + public List getSecurityAttributes() { + return securityAttributes; + } + + @Override + public void setSecurityAttributes(List securityAttributes) { + this.securityAttributes = securityAttributes; + } + + public String toString() { + return String.format( + "DefaultProtocolInformation (" + "href=%s," + + "endpointProtocol=%s," + + "endpointProtocolVersion=%s," + + "subprotocol=%s," + + "subprotocolBody=%s," + + "subprotocolBodyEncoding=%s," + + "securityAttributes=%s," + + ")", + this.href, this.endpointProtocol, this.endpointProtocolVersion, this.subprotocol, this.subprotocolBody, + this.subprotocolBodyEncoding, this.securityAttributes); + } + + /** + * This builder class can be used to construct a DefaultProtocolInformation bean. + */ + public static class Builder extends ProtocolInformationBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultProtocolInformation newBuildingInstance() { + return new DefaultProtocolInformation(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java index 4bcc919a3..546aa64f4 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRange.java @@ -84,14 +84,14 @@ public int hashCode() { this.min, this.max, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -108,14 +108,14 @@ public boolean equals(Object obj) { Objects.equals(this.min, other.min) && Objects.equals(this.max, other.max) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -159,36 +159,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -239,6 +209,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultRange (" + "valueType=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java index 6893d95a5..dfddd18e7 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultReferenceElement.java @@ -76,14 +76,14 @@ public DefaultReferenceElement() {} public int hashCode() { return Objects.hash(this.value, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -98,14 +98,14 @@ public boolean equals(Object obj) { DefaultReferenceElement other = (DefaultReferenceElement) obj; return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -129,36 +129,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -209,6 +179,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultReferenceElement (" + "value=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java index 755f7f359..475518459 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultRelationshipElement.java @@ -80,14 +80,14 @@ public int hashCode() { return Objects.hash(this.first, this.second, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -103,14 +103,14 @@ public boolean equals(Object obj) { return Objects.equals(this.first, other.first) && Objects.equals(this.second, other.second) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -144,36 +144,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -224,6 +194,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultRelationshipElement (" + "first=%s," diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java new file mode 100644 index 000000000..fa5e27a11 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultResult.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.Message; +import org.eclipse.digitaltwin.aas4j.v3.model.Result; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.ResultBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.Result + * + */ + +@IRI("aas:Result") +public class DefaultResult implements Result { + + @IRI("https://admin-shell.io/aas/3/0/Result/messages") + protected List messages = new ArrayList<>(); + + public DefaultResult() {} + + @Override + public int hashCode() { + return Objects.hash(this.messages); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultResult other = (DefaultResult) obj; + return Objects.equals(this.messages, other.messages); + } + } + + @Override + public List getMessages() { + return messages; + } + + @Override + public void setMessages(List messages) { + this.messages = messages; + } + + public String toString() { + return String.format( + "DefaultResult (" + "messages=%s," + + ")", + this.messages); + } + + /** + * This builder class can be used to construct a DefaultResult bean. + */ + public static class Builder extends ResultBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultResult newBuildingInstance() { + return new DefaultResult(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSecurityAttributeObject.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSecurityAttributeObject.java new file mode 100644 index 000000000..e2497b864 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSecurityAttributeObject.java @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityAttributeObject; +import org.eclipse.digitaltwin.aas4j.v3.model.SecurityTypeEnum; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.SecurityAttributeObjectBuilder; + +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SecurityAttributeObject + * + */ + +@IRI("aas:SecurityAttributeObject") +public class DefaultSecurityAttributeObject implements SecurityAttributeObject { + + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/key") + protected String key; + + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/type") + protected SecurityTypeEnum type; + + @IRI("https://admin-shell.io/aas/3/0/SecurityAttributeObject/value") + protected String value; + + public DefaultSecurityAttributeObject() {} + + @Override + public int hashCode() { + return Objects.hash(this.type, + this.key, + this.value); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSecurityAttributeObject other = (DefaultSecurityAttributeObject) obj; + return Objects.equals(this.type, other.type) && + Objects.equals(this.key, other.key) && + Objects.equals(this.value, other.value); + } + } + + @Override + public SecurityTypeEnum getType() { + return type; + } + + @Override + public void setType(SecurityTypeEnum type) { + this.type = type; + } + + @Override + public String getKey() { + return key; + } + + @Override + public void setKey(String key) { + this.key = key; + } + + @Override + public String getValue() { + return value; + } + + @Override + public void setValue(String value) { + this.value = value; + } + + public String toString() { + return String.format( + "DefaultSecurityAttributeObject (" + "type=%s," + + "key=%s," + + "value=%s," + + ")", + this.type, this.key, this.value); + } + + /** + * This builder class can be used to construct a DefaultSecurityAttributeObject bean. + */ + public static class Builder extends SecurityAttributeObjectBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSecurityAttributeObject newBuildingInstance() { + return new DefaultSecurityAttributeObject(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java new file mode 100644 index 000000000..794fdf368 --- /dev/null +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelDescriptor.java @@ -0,0 +1,222 @@ +/* + * Copyright (c) 2021 Fraunhofer-Gesellschaft zur Foerderung der angewandten Forschung e. V. + * Copyright (c) 2023, SAP SE or an SAP affiliate company + * + * 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.eclipse.digitaltwin.aas4j.v3.model.impl; + +import org.eclipse.digitaltwin.aas4j.v3.model.AdministrativeInformation; +import org.eclipse.digitaltwin.aas4j.v3.model.Endpoint; +import org.eclipse.digitaltwin.aas4j.v3.model.Extension; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; +import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor; +import org.eclipse.digitaltwin.aas4j.v3.model.annotations.IRI; +import org.eclipse.digitaltwin.aas4j.v3.model.builder.SubmodelDescriptorBuilder; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + + +/** + * Default implementation of package org.eclipse.digitaltwin.aas4j.v3.model.SubmodelDescriptor + * + */ + +@IRI("aas:SubmodelDescriptor") +public class DefaultSubmodelDescriptor implements SubmodelDescriptor { + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/description") + protected List description = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/displayName") + protected List displayName = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/Descriptor/extensions") + protected List extensions = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/administration") + protected AdministrativeInformation administration; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/endpoints") + protected List endpoints = new ArrayList<>(); + + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/id") + protected String id; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/idShort") + protected String idShort; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/semanticId") + protected Reference semanticId; + + @IRI("https://admin-shell.io/aas/3/0/SubmodelDescriptor/supplementalSemanticId") + protected List supplementalSemanticId = new ArrayList<>(); + + public DefaultSubmodelDescriptor() {} + + @Override + public int hashCode() { + return Objects.hash(this.administration, + this.endpoints, + this.idShort, + this.id, + this.semanticId, + this.supplementalSemanticId, + this.description, + this.displayName, + this.extensions); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } else if (obj == null) { + return false; + } else if (this.getClass() != obj.getClass()) { + return false; + } else { + DefaultSubmodelDescriptor other = (DefaultSubmodelDescriptor) obj; + return Objects.equals(this.administration, other.administration) && + Objects.equals(this.endpoints, other.endpoints) && + Objects.equals(this.idShort, other.idShort) && + Objects.equals(this.id, other.id) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticId, other.supplementalSemanticId) && + Objects.equals(this.description, other.description) && + Objects.equals(this.displayName, other.displayName) && + Objects.equals(this.extensions, other.extensions); + } + } + + @Override + public AdministrativeInformation getAdministration() { + return administration; + } + + @Override + public void setAdministration(AdministrativeInformation administration) { + this.administration = administration; + } + + @Override + public List getEndpoints() { + return endpoints; + } + + @Override + public void setEndpoints(List endpoints) { + this.endpoints = endpoints; + } + + @Override + public String getIdShort() { + return idShort; + } + + @Override + public void setIdShort(String idShort) { + this.idShort = idShort; + } + + @Override + public String getId() { + return id; + } + + @Override + public void setId(String id) { + this.id = id; + } + + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticId() { + return supplementalSemanticId; + } + + @Override + public void setSupplementalSemanticId(List supplementalSemanticIds) { + this.supplementalSemanticId = supplementalSemanticIds; + } + + @Override + public List getDescription() { + return description; + } + + @Override + public void setDescription(List descriptions) { + this.description = descriptions; + } + + @Override + public List getDisplayName() { + return displayName; + } + + @Override + public void setDisplayName(List displayNames) { + this.displayName = displayNames; + } + + @Override + public List getExtensions() { + return extensions; + } + + @Override + public void setExtensions(List extensions) { + this.extensions = extensions; + } + + public String toString() { + return String.format( + "DefaultSubmodelDescriptor (" + "administration=%s," + + "endpoints=%s," + + "idShort=%s," + + "id=%s," + + "semanticId=%s," + + "supplementalSemanticId=%s," + + ")", + this.administration, this.endpoints, this.idShort, this.id, this.semanticId, this.supplementalSemanticId); + } + + /** + * This builder class can be used to construct a DefaultSubmodelDescriptor bean. + */ + public static class Builder extends SubmodelDescriptorBuilder { + + @Override + protected Builder getSelf() { + return this; + } + + @Override + protected DefaultSubmodelDescriptor newBuildingInstance() { + return new DefaultSubmodelDescriptor(); + } + } +} diff --git a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java index 2c6a0c9cd..d12c19192 100644 --- a/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java +++ b/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodelElementCollection.java @@ -78,14 +78,14 @@ public DefaultSubmodelElementCollection() {} public int hashCode() { return Objects.hash(this.value, this.embeddedDataSpecifications, - this.semanticId, - this.supplementalSemanticIds, - this.qualifiers, this.category, this.idShort, this.displayName, this.description, - this.extensions); + this.extensions, + this.semanticId, + this.supplementalSemanticIds, + this.qualifiers); } @Override @@ -100,14 +100,14 @@ public boolean equals(Object obj) { DefaultSubmodelElementCollection other = (DefaultSubmodelElementCollection) obj; return Objects.equals(this.value, other.value) && Objects.equals(this.embeddedDataSpecifications, other.embeddedDataSpecifications) && - Objects.equals(this.semanticId, other.semanticId) && - Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && - Objects.equals(this.qualifiers, other.qualifiers) && Objects.equals(this.category, other.category) && Objects.equals(this.idShort, other.idShort) && Objects.equals(this.displayName, other.displayName) && Objects.equals(this.description, other.description) && - Objects.equals(this.extensions, other.extensions); + Objects.equals(this.extensions, other.extensions) && + Objects.equals(this.semanticId, other.semanticId) && + Objects.equals(this.supplementalSemanticIds, other.supplementalSemanticIds) && + Objects.equals(this.qualifiers, other.qualifiers); } } @@ -131,36 +131,6 @@ public void setEmbeddedDataSpecifications(List embedd this.embeddedDataSpecifications = embeddedDataSpecifications; } - @Override - public Reference getSemanticId() { - return semanticId; - } - - @Override - public void setSemanticId(Reference semanticId) { - this.semanticId = semanticId; - } - - @Override - public List getSupplementalSemanticIds() { - return supplementalSemanticIds; - } - - @Override - public void setSupplementalSemanticIds(List supplementalSemanticIds) { - this.supplementalSemanticIds = supplementalSemanticIds; - } - - @Override - public List getQualifiers() { - return qualifiers; - } - - @Override - public void setQualifiers(List qualifiers) { - this.qualifiers = qualifiers; - } - @Override public String getCategory() { return category; @@ -211,6 +181,36 @@ public void setExtensions(List extensions) { this.extensions = extensions; } + @Override + public Reference getSemanticId() { + return semanticId; + } + + @Override + public void setSemanticId(Reference semanticId) { + this.semanticId = semanticId; + } + + @Override + public List getSupplementalSemanticIds() { + return supplementalSemanticIds; + } + + @Override + public void setSupplementalSemanticIds(List supplementalSemanticIds) { + this.supplementalSemanticIds = supplementalSemanticIds; + } + + @Override + public List getQualifiers() { + return qualifiers; + } + + @Override + public void setQualifiers(List qualifiers) { + this.qualifiers = qualifiers; + } + public String toString() { return String.format( "DefaultSubmodelElementCollection (" + "value=%s," From 414f41658058ff67f211e67eed0ddfc73e532036 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Mon, 5 Feb 2024 15:32:56 +0100 Subject: [PATCH 35/73] Adds aas4j- as prefix to artifacts (#240) * Adds aas4j- as prefix to artifacts * Update README.md --------- Signed-off-by: Frank Schnicke --- README.md | 2 +- dataformat-aasx/pom.xml | 12 ++++++------ dataformat-core/pom.xml | 6 +++--- dataformat-json/pom.xml | 10 +++++----- dataformat-xml/pom.xml | 10 +++++----- model/pom.xml | 9 +++++---- pom.xml | 10 +++++----- 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index bbd2739b3..7f9243a7c 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ or by integrating the respective modules as dependencies from [Maven Central](ht ``` org.eclipse.digitaltwin.aas4j - dataformat-json + aas4j-dataformat-json latest-version ``` diff --git a/dataformat-aasx/pom.xml b/dataformat-aasx/pom.xml index a55af1615..83054e604 100644 --- a/dataformat-aasx/pom.xml +++ b/dataformat-aasx/pom.xml @@ -5,20 +5,20 @@ 4.0.0 org.eclipse.digitaltwin.aas4j - dataformat-parent + aas4j-dataformat-parent ${revision} - dataformat-aasx + aas4j-dataformat-aasx Asset Administration Shell AASX-Serializer ${project.groupId} - dataformat-xml + aas4j-dataformat-xml ${project.groupId} - dataformat-core + aas4j-dataformat-core tests test @@ -36,7 +36,7 @@ ${project.groupId} - model + aas4j-model junit @@ -45,7 +45,7 @@ ${project.groupId} - dataformat-core + aas4j-dataformat-core org.slf4j diff --git a/dataformat-core/pom.xml b/dataformat-core/pom.xml index 6f62bb325..1bf4a2b17 100644 --- a/dataformat-core/pom.xml +++ b/dataformat-core/pom.xml @@ -5,16 +5,16 @@ 4.0.0 org.eclipse.digitaltwin.aas4j - dataformat-parent + aas4j-dataformat-parent ${revision} - dataformat-core + aas4j-dataformat-core Asset Administration Shell Serializer Core ${project.groupId} - model + aas4j-model com.fasterxml.jackson.core diff --git a/dataformat-json/pom.xml b/dataformat-json/pom.xml index 04ab7de87..9e6976ab3 100644 --- a/dataformat-json/pom.xml +++ b/dataformat-json/pom.xml @@ -5,20 +5,20 @@ 4.0.0 org.eclipse.digitaltwin.aas4j - dataformat-parent + aas4j-dataformat-parent ${revision} - dataformat-json + aas4j-dataformat-json Asset Administration Shell JSON-Serializer ${project.groupId} - dataformat-core + aas4j-dataformat-core ${project.groupId} - dataformat-core + aas4j-dataformat-core tests test @@ -46,7 +46,7 @@ ${project.groupId} - model + aas4j-model com.networknt diff --git a/dataformat-xml/pom.xml b/dataformat-xml/pom.xml index 66680ae23..35c5d327e 100644 --- a/dataformat-xml/pom.xml +++ b/dataformat-xml/pom.xml @@ -5,20 +5,20 @@ 4.0.0 org.eclipse.digitaltwin.aas4j - dataformat-parent + aas4j-dataformat-parent ${revision} - dataformat-xml + aas4j-dataformat-xml Asset Administration Shell XML-Serializer ${project.groupId} - dataformat-core + aas4j-dataformat-core ${project.groupId} - dataformat-core + aas4j-dataformat-core tests test @@ -64,7 +64,7 @@ ${project.groupId} - model + aas4j-model com.fasterxml.jackson.core diff --git a/model/pom.xml b/model/pom.xml index 599d40142..33773f8bb 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -2,13 +2,14 @@ - - dataformat-parent + 4.0.0 + org.eclipse.digitaltwin.aas4j + aas4j-dataformat-parent ${revision} - 4.0.0 - model + + aas4j-model ${model.version} diff --git a/pom.xml b/pom.xml index c6c345cac..1b2a21f09 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ 4.0.0 org.eclipse.digitaltwin.aas4j - dataformat-parent + aas4j-dataformat-parent ${revision} pom @@ -290,22 +290,22 @@ ${project.groupId} - dataformat-core + aas4j-dataformat-core ${revision} ${project.groupId} - dataformat-xml + aas4j-dataformat-xml ${revision} ${project.groupId} - model + aas4j-model ${model.version} ${project.groupId} - dataformat-core + aas4j-dataformat-core tests ${revision} From f60d34a884e54f35219fc27803f6e194a3e98296 Mon Sep 17 00:00:00 2001 From: Frank Schnicke Date: Mon, 5 Feb 2024 15:41:49 +0100 Subject: [PATCH 36/73] Updates version to 1.0.0-RC1 --- README.md | 6 +++--- pom.xml | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7f9243a7c..7ff8ea555 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # Eclipse AAS4J -> :newspaper: The _`Eclipse AAS4J 1.0.0-milestone-03`_ release is available on Maven Central Repository and includes the -> following artifacts implementing the _AAS Specs – Part 1 V3.0 (final)_: `dataformat-core`, `dataformat-aasx`, -> `dataformat-xml`, `dataformat-json`, `dataformat-parent`, and `model`. +> :newspaper: The _`Eclipse AAS4J 1.0.0-RC1`_ release is available on Maven Central Repository and includes the +> following artifacts implementing the _AAS Specs – Part 1 V3.0 (final)_: `aas4j-dataformat-core`, `aas4j-dataformat-aasx`, +> `aas4j-dataformat-xml`, `aas4j-dataformat-json`, `aas4j-dataformat-parent`, and `aas4j-model`. [Eclipse AAS4J](https://projects.eclipse.org/projects/dt.aas4j) implements the specification of the Asset Administration Shell (AAS) such as metamodels, submodels, serialization and deserialization modules, validators, and transformation diff --git a/pom.xml b/pom.xml index 1b2a21f09..e2acea841 100644 --- a/pom.xml +++ b/pom.xml @@ -40,9 +40,9 @@ 1 0 0 - -SNAPSHOT + -RC1 ${revision.major}.${revision.minor}.${revision.patch}${revision.suffix} - 1.0.0-SNAPSHOT + 1.0.0-RC1 UTF-8 UTF-8 From b4f554b047bcd18261895ccd3a1590c18a2f291b Mon Sep 17 00:00:00 2001 From: Michael Jacoby Date: Tue, 6 Feb 2024 09:43:16 +0100 Subject: [PATCH 37/73] cleanup logging & adjust log levels --- .../aas4j/v3/dataformat/aasx/AASXDeserializer.java | 4 ++-- .../digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java | 4 ++-- .../aas4j/v3/dataformat/core/util/ReflectionHelper.java | 2 +- .../aas4j/v3/dataformat/xml/XmlSerializerTest.java | 2 +- .../aas4j/v3/dataformat/xml/XmlValidationTest.java | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 069e64cd7..111f140cc 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -130,7 +130,7 @@ public List getRelatedFiles() throws InvalidFormatException, IOExc try { files.add(readFile(aasxRoot, filePath)); } catch (Exception e) { - logger.warn("Loading file " + filePath + " failed and will not be included. Exception: " + e); + logger.warn("Loading file {} failed and will not be included.", filePath, e); } } return files; @@ -168,7 +168,7 @@ private PackageRelationshipCollection getXMLDocumentRelation(PackagePart originP private String getXMLPart(PackagePart originPart) throws InvalidFormatException { if (isCompatibilityModeNeeded(originPart)) { - logger.warn("AASX contains wrong Relationship namespace. This may be related to the AASX being created with an old version of AASX Package Explorer or an old version of AAS4J. Future compatibility with the wrong namespace may not be guaranteed"); + logger.info("AASX contains wrong Relationship namespace. This may be related to the AASX being created with an old version of AASX Package Explorer or an old version of AAS4J. Future compatibility with the wrong namespace may not be guaranteed"); return AASPEC_RELTYPE_BACKWARDSCOMPATIBLE; } else { return AASXSerializer.AASSPEC_RELTYPE; diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index a287b121e..b8d13befd 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -147,11 +147,11 @@ private void createParts(Collection files, String filePath, OPCPac PackagePart xmlPart, String contentType) { try { InMemoryFile content = findFileByPath(files, filePath); - logger.trace("Writing file '" + filePath + "' to .aasx."); + logger.trace("Writing file '{}' to .aasx.", filePath); createAASXPart(rootPackage, xmlPart, filePath, contentType, AASSUPPL_RELTYPE, content.getFileContent()); } catch (RuntimeException e) { // Log that a file is missing and continue building the .aasx - logger.warn("Could not add File '" + filePath + "'. It was not contained in given InMemoryFiles."); + logger.warn("Could not add File '{}'. It was not contained in given InMemoryFiles.", filePath, e); } } diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/ReflectionHelper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/ReflectionHelper.java index b69025640..41b64858a 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/ReflectionHelper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/ReflectionHelper.java @@ -216,7 +216,7 @@ public static Class getAasInterface(Class type) { if (implementedAasInterfaces.size() == 1) { return implementedAasInterfaces.iterator().next(); } - logger.warn("class '{}' implements more than one AAS interface, but only most specific one is returned", type.getName()); + logger.debug("class '{}' implements more than one AAS interface, but only most specific one is returned", type.getName()); return implementedAasInterfaces.stream().map(x -> TypeToken.of(x)) .sorted(new MostSpecificTypeTokenComparator()) .findFirst().get() diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 469a163df..47c409603 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -290,7 +290,7 @@ private boolean ignoreDefaults(Node node) { private void logErrors(String validatedFileName, Set errors) { if (errors.isEmpty()) return; - logger.info("Validate file: " + validatedFileName); + logger.info("Validate file: {}", validatedFileName); for (String error : errors) { logger.info(error); } diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java index 67940aa60..9745b7eb6 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlValidationTest.java @@ -66,7 +66,7 @@ private void logErrors(String validatedFileName, Set errors) { if (errors.isEmpty()) { return; } - logger.info("Validate file: " + validatedFileName); + logger.info("Validate file: {}", validatedFileName); for (String error : errors) { logger.info(error); } From 7d20da9315bf2cc4ba0ffa44a3379d01c4062364 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Feb 2024 10:13:15 +0000 Subject: [PATCH 38/73] Bump slf4j.version from 2.0.11 to 2.0.12 Bumps `slf4j.version` from 2.0.11 to 2.0.12. Updates `org.slf4j:slf4j-api` from 2.0.11 to 2.0.12 Updates `org.slf4j:slf4j-simple` from 2.0.11 to 2.0.12 --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.slf4j:slf4j-simple dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e2acea841..0a3d86ed8 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ 1.1.1 2.7.8 5.2.5 - 2.0.11 + 2.0.12 1.3.2 4.4.1 2.12.1 From 4c56bbe755f19ba9737fa278d0c4e0707bcc5476 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Fri, 9 Feb 2024 07:55:34 +0100 Subject: [PATCH 39/73] Refactors package structure to better reflect public API (#246) * Refactors package structure to better reflect public API * Fixes wrong names in ReflectionHelper --------- Signed-off-by: Frank Schnicke --- .../v3/dataformat/aasx/AASXDeserializer.java | 2 +- .../v3/dataformat/aasx/AASXSerializer.java | 2 +- .../deserialization/AASXDeserializerTest.java | 4 +-- .../aasx/deserialization/ValidationTest.java | 4 +-- .../serialization/AASXSerializerTest.java | 2 +- .../{ => core}/DeserializationException.java | 2 +- .../{ => core}/SchemaValidator.java | 2 +- .../{ => core}/SerializationException.java | 2 +- .../deserialization/EnumDeserializer.java | 2 +- .../serialization/EnumSerializer.java | 5 +-- .../{ => internal}/util/ReflectionHelper.java | 31 ++++++++++--------- .../v3/dataformat/core/util/AasUtils.java | 19 ++++++------ .../dataformat/core/EnumDeserializerTest.java | 3 +- .../dataformat/core/EnumSerializerTest.java | 3 +- .../v3/dataformat/json/JsonDeserializer.java | 2 +- .../v3/dataformat/json/JsonMapperFactory.java | 6 ++-- .../dataformat/json/JsonSchemaValidator.java | 3 +- .../v3/dataformat/json/JsonSerializer.java | 2 +- .../SimpleAbstractTypeResolverFactory.java | 2 +- .../ReflectionAnnotationIntrospector.java | 3 +- .../mixins/AssetAdministrationShellMixin.java | 2 +- .../mixins/AssetInformationMixin.java | 2 +- .../json/{ => internal}/mixins/BlobMixin.java | 2 +- .../DataSpecificationIec61360Mixin.java | 2 +- .../{ => internal}/mixins/EndpointMixin.java | 2 +- .../{ => internal}/mixins/EntityMixin.java | 2 +- .../mixins/EnvironmentMixin.java | 2 +- .../{ => internal}/mixins/ExtensionMixin.java | 2 +- .../json/{ => internal}/mixins/FileMixin.java | 2 +- .../mixins/IdentifiableMixin.java | 2 +- .../json/{ => internal}/mixins/KeyMixin.java | 2 +- .../mixins/OperationVariableMixin.java | 2 +- .../{ => internal}/mixins/QualifierMixin.java | 2 +- .../{ => internal}/mixins/RangeMixin.java | 2 +- .../{ => internal}/mixins/ReferenceMixin.java | 2 +- .../mixins/RelationshipElementMixin.java | 2 +- .../mixins/SubmodelElementListMixin.java | 2 +- .../dataformat/json/JsonDeserializerTest.java | 7 +++-- .../dataformat/json/JsonSerializerTest.java | 2 +- .../v3/dataformat/xml/XmlDeserializer.java | 9 +++--- .../v3/dataformat/xml/XmlSchemaValidator.java | 2 +- .../v3/dataformat/xml/XmlSerializer.java | 11 ++++--- .../XmlDataformatAnnotationIntrospector.java | 3 +- .../AbstractLangStringsDeserializer.java | 5 +-- .../CustomJsonNodeDeserializer.java | 2 +- .../DataElementsDeserializer.java | 2 +- .../DeserializationHelper.java | 2 +- ...mbeddedDataSpecificationsDeserializer.java | 5 +-- .../deserialization/KeyDeserializer.java | 2 +- .../deserialization/KeysDeserializer.java | 2 +- .../LangStringContentDeserializer.java | 5 +-- ...ngsDefinitionTypeIec61360Deserializer.java | 4 +-- .../LangStringsNameTypeDeserializer.java | 4 +-- ...PreferredNameTypeIec61360Deserializer.java | 4 +-- ...ingsShortNameTypeIec61360Deserializer.java | 4 +-- .../LangStringsTextTypeDeserializer.java | 4 +-- .../NoEntryWrapperListDeserializer.java | 2 +- .../OperationVariableDeserializer.java | 2 +- .../QualifierDeserializer.java | 2 +- .../ReferencesDeserializer.java | 2 +- .../SubmodelElementDeserializer.java | 2 +- .../SubmodelElementsDeserializer.java | 2 +- .../ValueReferencePairNodeDeserializer.java | 2 +- .../ValueReferencePairsDeserializer.java | 2 +- .../AdministrativeInformationMixin.java | 2 +- .../AnnotatedRelationshipElementMixin.java | 7 +++-- .../mixins/AssetAdministrationShellMixin.java | 2 +- .../mixins/AssetInformationMixin.java | 2 +- .../mixins/ConceptDescriptionMixin.java | 2 +- .../DataSpecificationIec61360Mixin.java | 17 +++++----- .../EmbeddedDataSpecificationMixin.java | 7 +++-- .../{ => internal}/mixins/EntityMixin.java | 7 +++-- .../mixins/EnvironmentMixin.java | 2 +- .../{ => internal}/mixins/ExtensionMixin.java | 5 +-- .../mixins/HasDataSpecificationMixin.java | 2 +- .../mixins/HasExtensionsMixin.java | 2 +- .../mixins/HasSemanticsMixin.java | 5 +-- .../xml/{ => internal}/mixins/KeyMixin.java | 2 +- .../{ => internal}/mixins/LevelTypeMixin.java | 2 +- .../mixins/MultiLanguagePropertyMixin.java | 5 +-- .../{ => internal}/mixins/OperationMixin.java | 5 +-- .../mixins/OperationVariableMixin.java | 7 +++-- .../{ => internal}/mixins/PropertyMixin.java | 2 +- .../mixins/QualifiableMixin.java | 5 +-- .../{ => internal}/mixins/QualifierMixin.java | 2 +- .../{ => internal}/mixins/ReferableMixin.java | 11 ++++--- .../{ => internal}/mixins/ReferenceMixin.java | 5 +-- .../{ => internal}/mixins/ResourceMixin.java | 2 +- .../mixins/SpecificAssetIdMixin.java | 2 +- .../SubmodelElementCollectionMixin.java | 7 +++-- .../mixins/SubmodelElementListMixin.java | 7 +++-- .../mixins/SubmodelElementMixin.java | 2 +- .../{ => internal}/mixins/SubmodelMixin.java | 7 +++-- .../{ => internal}/mixins/ValueListMixin.java | 5 +-- .../mixins/ValueReferencePairMixin.java | 2 +- .../AbstractLangStringSerializer.java | 2 +- .../AbstractLangStringsSerializer.java | 5 +-- ...inistrationShellEnvironmentSerializer.java | 5 +-- .../serialization/DataElementsSerializer.java | 2 +- .../EmbeddedDataSpecificationSerializer.java | 2 +- ...ringsDefinitionTypeIec61360Serializer.java | 2 +- .../LangStringsNameTypeSerializer.java | 5 +-- ...gsPreferredNameTypeIec61360Serializer.java | 2 +- ...tringsShortNameTypeIec61360Serializer.java | 2 +- .../LangStringsTextTypeSerializer.java | 2 +- .../NoEntryWrapperListSerializer.java | 2 +- .../OperationVariableSerializer.java | 2 +- .../serialization/RefersToSerializer.java | 5 +-- .../SubmodelElementSerializer.java | 2 +- .../SubmodelElementsSerializer.java | 5 +-- .../util}/LangStringContent.java | 2 +- .../dataformat/xml/XMLDeserializerTest.java | 4 +-- .../v3/dataformat/xml/XmlSerializerTest.java | 6 ++-- 113 files changed, 231 insertions(+), 198 deletions(-) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/{ => core}/DeserializationException.java (94%) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/{ => core}/SchemaValidator.java (95%) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/{ => core}/SerializationException.java (94%) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/{ => internal}/deserialization/EnumDeserializer.java (96%) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/{ => internal}/serialization/EnumSerializer.java (95%) rename dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/{ => internal}/util/ReflectionHelper.java (95%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/AssetAdministrationShellMixin.java (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/AssetInformationMixin.java (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/BlobMixin.java (91%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/DataSpecificationIec61360Mixin.java (90%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/EndpointMixin.java (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/EntityMixin.java (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/EnvironmentMixin.java (94%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/ExtensionMixin.java (91%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/FileMixin.java (91%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/IdentifiableMixin.java (89%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/KeyMixin.java (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/OperationVariableMixin.java (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/QualifierMixin.java (91%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/RangeMixin.java (91%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/ReferenceMixin.java (93%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/RelationshipElementMixin.java (92%) rename dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/{ => internal}/mixins/SubmodelElementListMixin.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/AbstractLangStringsDeserializer.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/CustomJsonNodeDeserializer.java (91%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/DataElementsDeserializer.java (97%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/DeserializationHelper.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/EmbeddedDataSpecificationsDeserializer.java (93%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/KeyDeserializer.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/KeysDeserializer.java (91%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/LangStringContentDeserializer.java (86%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/LangStringsDefinitionTypeIec61360Deserializer.java (88%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/LangStringsNameTypeDeserializer.java (87%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/LangStringsPreferredNameTypeIec61360Deserializer.java (89%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/LangStringsShortNameTypeIec61360Deserializer.java (88%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/LangStringsTextTypeDeserializer.java (87%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/NoEntryWrapperListDeserializer.java (97%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/OperationVariableDeserializer.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/QualifierDeserializer.java (97%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/ReferencesDeserializer.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/SubmodelElementDeserializer.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/SubmodelElementsDeserializer.java (98%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/ValueReferencePairNodeDeserializer.java (94%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/deserialization/ValueReferencePairsDeserializer.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/AdministrativeInformationMixin.java (93%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/AnnotatedRelationshipElementMixin.java (79%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/AssetAdministrationShellMixin.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/AssetInformationMixin.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/ConceptDescriptionMixin.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/DataSpecificationIec61360Mixin.java (83%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/EmbeddedDataSpecificationMixin.java (85%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/EntityMixin.java (84%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/EnvironmentMixin.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/ExtensionMixin.java (86%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/HasDataSpecificationMixin.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/HasExtensionsMixin.java (94%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/HasSemanticsMixin.java (90%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/KeyMixin.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/LevelTypeMixin.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/MultiLanguagePropertyMixin.java (89%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/OperationMixin.java (87%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/OperationVariableMixin.java (83%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/PropertyMixin.java (93%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/QualifiableMixin.java (90%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/QualifierMixin.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/ReferableMixin.java (80%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/ReferenceMixin.java (91%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/ResourceMixin.java (94%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/SpecificAssetIdMixin.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/SubmodelElementCollectionMixin.java (82%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/SubmodelElementListMixin.java (90%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/SubmodelElementMixin.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/SubmodelMixin.java (85%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/ValueListMixin.java (90%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/mixins/ValueReferencePairMixin.java (94%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/AbstractLangStringSerializer.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/AbstractLangStringsSerializer.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/AssetAdministrationShellEnvironmentSerializer.java (97%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/DataElementsSerializer.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/EmbeddedDataSpecificationSerializer.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/LangStringsDefinitionTypeIec61360Serializer.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/LangStringsNameTypeSerializer.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/LangStringsPreferredNameTypeIec61360Serializer.java (93%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/LangStringsShortNameTypeIec61360Serializer.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/LangStringsTextTypeSerializer.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/NoEntryWrapperListSerializer.java (97%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/OperationVariableSerializer.java (95%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/RefersToSerializer.java (93%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/SubmodelElementSerializer.java (96%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{ => internal}/serialization/SubmodelElementsSerializer.java (92%) rename dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/{helper => internal/util}/LangStringContent.java (93%) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 111f140cc..f6ab72a13 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -31,8 +31,8 @@ import org.apache.poi.openxml4j.opc.PackagePart; import org.apache.poi.openxml4j.opc.PackageRelationshipCollection; import org.apache.poi.openxml4j.opc.PackagingURIHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index b8d13befd..8eb4a9090 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -31,8 +31,8 @@ import org.apache.poi.openxml4j.opc.RelationshipSource; import org.apache.poi.openxml4j.opc.TargetMode; import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java index c13042781..4cd02eeba 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java @@ -31,12 +31,12 @@ import org.apache.commons.collections4.CollectionUtils; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java index 856ed8916..a62341725 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java @@ -16,12 +16,12 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.deserialization; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXValidator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index aee0d6031..aa23825ed 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -16,10 +16,10 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.serialization; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; import org.junit.Before; import org.junit.Test; diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DeserializationException.java similarity index 94% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DeserializationException.java index 26e0f1868..ac0262486 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/DeserializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/DeserializationException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; @SuppressWarnings("serial") public class DeserializationException extends Exception { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SchemaValidator.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/SchemaValidator.java similarity index 95% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SchemaValidator.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/SchemaValidator.java index 3cff51469..c246a591e 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SchemaValidator.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/SchemaValidator.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; import java.util.Set; diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/SerializationException.java similarity index 94% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/SerializationException.java index 981d657cb..e4da3d766 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/SerializationException.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/SerializationException.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core; @SuppressWarnings("serial") public class SerializationException extends Exception { diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/deserialization/EnumDeserializer.java similarity index 96% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/deserialization/EnumDeserializer.java index ebd49fbff..74b46f252 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/deserialization/EnumDeserializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/deserialization/EnumDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/serialization/EnumSerializer.java similarity index 95% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/serialization/EnumSerializer.java index 56b88f1af..842482d90 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/serialization/EnumSerializer.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/serialization/EnumSerializer.java @@ -14,12 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/ReflectionHelper.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/ReflectionHelper.java similarity index 95% rename from dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/ReflectionHelper.java rename to dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/ReflectionHelper.java index 41b64858a..b571972c7 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/ReflectionHelper.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/internal/util/ReflectionHelper.java @@ -13,19 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util; - -import com.google.common.reflect.TypeToken; -import io.github.classgraph.ClassGraph; -import io.github.classgraph.ClassInfo; -import io.github.classgraph.ClassInfoList; -import io.github.classgraph.ScanResult; -import org.apache.commons.lang3.ClassUtils; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; -import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; -import org.eclipse.digitaltwin.aas4j.v3.model.Referable; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util; import java.lang.reflect.Field; import java.util.ArrayList; @@ -37,6 +25,19 @@ import java.util.Set; import java.util.stream.Collectors; +import org.apache.commons.lang3.ClassUtils; +import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; +import org.eclipse.digitaltwin.aas4j.v3.model.Referable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import com.google.common.reflect.TypeToken; + +import io.github.classgraph.ClassGraph; +import io.github.classgraph.ClassInfo; +import io.github.classgraph.ClassInfoList; +import io.github.classgraph.ScanResult; + /** * Helper class to collect relevant data needed for * ReflectionAnnotationIntrospector via reflection. @@ -58,12 +59,12 @@ public class ReflectionHelper { * Name of package where the json mixins are defined. These mixins are * automatically added to JsonSerializer and JsonDeserializer. */ - public static final String JSON_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.json.mixins"; + public static final String JSON_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.json.internal.mixins"; /** * Name of package where the xml mixins are defined. These mixins are * automatically added to XmlSerializer and XmlDeserializer. */ - public static final String XML_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.xml.mixins"; + public static final String XML_MIXINS_PACKAGE_NAME = ROOT_PACKAGE_NAME + ".dataformat.xml.internal.mixins"; /** * Suffix that identifies a class as a mixin. */ diff --git a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java index fac5cfeb7..b1f210bdd 100644 --- a/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java +++ b/dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/AasUtils.java @@ -23,13 +23,18 @@ import java.util.Comparator; import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.GetChildrenVisitor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.GetIdentifierVisitor; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.MostSpecificTypeTokenComparator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Identifiable; import org.eclipse.digitaltwin.aas4j.v3.model.Key; @@ -37,16 +42,12 @@ import org.eclipse.digitaltwin.aas4j.v3.model.Referable; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; +import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.google.common.reflect.TypeToken; -import java.util.Map; -import java.util.Objects; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.GetChildrenVisitor; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.GetIdentifierVisitor; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementList; /** * Provides utility functions related to AAS @@ -55,8 +56,6 @@ public class AasUtils { private static final Logger log = LoggerFactory.getLogger(AasUtils.class); - private static final String REFERENCE_ELEMENT_DELIMITER = ", "; - private static final Map REFERENCE_TYPE_REPRESENTATION = Map.of( ReferenceTypes.EXTERNAL_REFERENCE, "ExternalRef", ReferenceTypes.MODEL_REFERENCE, "ModelRef"); diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java index 93ddbd6cf..b902d4b26 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumDeserializerTest.java @@ -18,7 +18,8 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.deserialization.EnumDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.StateOfEvent; diff --git a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java index 33cae0017..88971eb85 100644 --- a/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java +++ b/dataformat-core/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/EnumSerializerTest.java @@ -18,7 +18,8 @@ import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.Direction; import org.eclipse.digitaltwin.aas4j.v3.model.ModellingKind; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java index 785769cd9..de24180aa 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java @@ -23,7 +23,7 @@ import java.nio.charset.StandardCharsets; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java index a849c7370..4083f3ac3 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonMapperFactory.java @@ -19,9 +19,9 @@ import java.util.Arrays; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.ReflectionAnnotationIntrospector; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSchemaValidator.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSchemaValidator.java index d873e4407..437a8351a 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSchemaValidator.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSchemaValidator.java @@ -22,7 +22,6 @@ import com.networknt.schema.JsonSchemaFactory; import com.networknt.schema.SpecVersionDetector; import com.networknt.schema.ValidationMessage; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SchemaValidator; import java.io.BufferedReader; import java.io.IOException; @@ -31,6 +30,8 @@ import java.util.Set; import java.util.stream.Collectors; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SchemaValidator; + /** * Class for validating a serialized instance of AssetAdministrationShellEnvironment against a json-schema. */ diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java index 527468176..3ffa080b8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java @@ -24,7 +24,7 @@ import java.util.Collection; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java index 742af85ab..9a39c4d17 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/SimpleAbstractTypeResolverFactory.java @@ -16,7 +16,7 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.json; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import com.fasterxml.jackson.databind.module.SimpleAbstractTypeResolver; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/ReflectionAnnotationIntrospector.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/ReflectionAnnotationIntrospector.java index a461709b8..adbd3ead8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/ReflectionAnnotationIntrospector.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/ReflectionAnnotationIntrospector.java @@ -25,12 +25,13 @@ import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector; import com.fasterxml.jackson.databind.jsontype.NamedType; import com.fasterxml.jackson.databind.jsontype.TypeResolverBuilder; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import java.util.Collection; import java.util.List; import java.util.stream.Collectors; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; + /** * This class helps to dynamically decide how to de-/serialize classes and * properties defined in the AAS model library. diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/AssetAdministrationShellMixin.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/AssetAdministrationShellMixin.java index b71c21b9e..df0a20a04 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/AssetAdministrationShellMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import org.eclipse.digitaltwin.aas4j.v3.model.AssetInformation; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/AssetInformationMixin.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/AssetInformationMixin.java index d5fc45b33..db04219fb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/AssetInformationMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/AssetInformationMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/BlobMixin.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/BlobMixin.java index 23ed61c3f..2eee52732 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/BlobMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/BlobMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/DataSpecificationIec61360Mixin.java similarity index 90% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/DataSpecificationIec61360Mixin.java index 9653720d3..f1766b2a8 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/DataSpecificationIec61360Mixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import java.util.List; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EndpointMixin.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EndpointMixin.java index da1f46232..7a99100f9 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EndpointMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EndpointMixin.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import com.fasterxml.jackson.annotation.JsonProperty; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EntityMixin.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EntityMixin.java index 189a273ce..12752806f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EntityMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EntityMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import org.eclipse.digitaltwin.aas4j.v3.model.EntityType; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EnvironmentMixin.java similarity index 94% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EnvironmentMixin.java index 11261f1b3..f1472970c 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/EnvironmentMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/EnvironmentMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import java.util.List; import java.util.Set; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/ExtensionMixin.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/ExtensionMixin.java index 06240b00a..391591e61 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ExtensionMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/ExtensionMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/FileMixin.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/FileMixin.java index e32942542..2efe8d5bb 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/FileMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/FileMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/IdentifiableMixin.java similarity index 89% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/IdentifiableMixin.java index 96d0dfd8d..dcf651251 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/IdentifiableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/IdentifiableMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/KeyMixin.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/KeyMixin.java index 26de3024d..81195aa82 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/KeyMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/KeyMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import org.eclipse.digitaltwin.aas4j.v3.model.KeyTypes; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/OperationVariableMixin.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/OperationVariableMixin.java index aec20388d..ebefc1a6f 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/OperationVariableMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/OperationVariableMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/QualifierMixin.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/QualifierMixin.java index 53f937f59..1ec9ad926 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/QualifierMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/QualifierMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/RangeMixin.java similarity index 91% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/RangeMixin.java index d7b609ac4..8fdf23376 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RangeMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/RangeMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/ReferenceMixin.java similarity index 93% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/ReferenceMixin.java index 222de6026..b9020a071 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/ReferenceMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/ReferenceMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import java.util.List; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/RelationshipElementMixin.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/RelationshipElementMixin.java index cc3adb685..bba53c0ce 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/RelationshipElementMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/RelationshipElementMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; diff --git a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/SubmodelElementListMixin.java similarity index 92% rename from dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java rename to dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/SubmodelElementListMixin.java index 3ea2fa1b1..d4e9fbff0 100644 --- a/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/mixins/SubmodelElementListMixin.java +++ b/dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/internal/mixins/SubmodelElementListMixin.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.json.internal.mixins; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java index 45761420b..b82589878 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializerTest.java @@ -23,12 +23,13 @@ import java.util.Set; import com.fasterxml.jackson.databind.node.JsonNodeFactory; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.CustomSubmodel2; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShellDescriptor; diff --git a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java index 43ed8361b..d857cd195 100644 --- a/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java +++ b/dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java @@ -29,7 +29,7 @@ import com.fasterxml.jackson.databind.node.JsonNodeFactory; import com.fasterxml.jackson.databind.JsonNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.ExampleData; import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.util.Examples; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java index 38965664a..679760b05 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlDeserializer.java @@ -23,11 +23,12 @@ import com.fasterxml.jackson.databind.module.SimpleModule; import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.deserialization.EnumDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.deserialization.EnumDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.SubmodelElementDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSchemaValidator.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSchemaValidator.java index 35dd015bb..deef0614c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSchemaValidator.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSchemaValidator.java @@ -15,7 +15,7 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SchemaValidator; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SchemaValidator; import org.xml.sax.SAXException; import javax.xml.XMLConstants; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java index eda8f98f7..86990f7a7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializer.java @@ -24,12 +24,13 @@ import com.fasterxml.jackson.dataformat.xml.XmlFactory; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.serialization.EnumSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.XmlDataformatAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.AssetAdministrationShellEnvironmentSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.OperationVariableSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.AssetAdministrationShellEnvironmentSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.OperationVariableSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java index 2fc785819..e0ac3d224 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/XmlDataformatAnnotationIntrospector.java @@ -21,10 +21,11 @@ import com.fasterxml.jackson.databind.introspect.AnnotatedClass; import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; import com.fasterxml.jackson.dataformat.xml.JacksonXmlAnnotationIntrospector; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; import java.util.Collection; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; + /** * This class helps to dynamically decide how to de-/serialize classes and * properties defined in the AAS model library. It will automatically add a default namespace diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/AbstractLangStringsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/AbstractLangStringsDeserializer.java similarity index 92% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/AbstractLangStringsDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/AbstractLangStringsDeserializer.java index dec133fca..04d215e8a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/AbstractLangStringsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/AbstractLangStringsDeserializer.java @@ -14,14 +14,15 @@ * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.helper.LangStringContent; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.util.LangStringContent; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; import java.io.IOException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/CustomJsonNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/CustomJsonNodeDeserializer.java similarity index 91% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/CustomJsonNodeDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/CustomJsonNodeDeserializer.java index 7d15fab24..20d96da24 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/CustomJsonNodeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/CustomJsonNodeDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/DataElementsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DataElementsDeserializer.java similarity index 97% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/DataElementsDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DataElementsDeserializer.java index cc3972177..c2fd58d42 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/DataElementsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DataElementsDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/DeserializationHelper.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DeserializationHelper.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/DeserializationHelper.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DeserializationHelper.java index 6b5e559c6..9e106483f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/DeserializationHelper.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DeserializationHelper.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.TreeNode; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/EmbeddedDataSpecificationsDeserializer.java similarity index 93% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/EmbeddedDataSpecificationsDeserializer.java index ea0b54ff6..c7bee01b4 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/EmbeddedDataSpecificationsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/EmbeddedDataSpecificationsDeserializer.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.DeserializationContext; import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import java.io.IOException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/KeyDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/KeyDeserializer.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/KeyDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/KeyDeserializer.java index 044fc3f1c..421d43354 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/KeyDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/KeyDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/KeysDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/KeysDeserializer.java similarity index 91% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/KeysDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/KeysDeserializer.java index 6ebee33d9..b050ff8b6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/KeysDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/KeysDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import org.eclipse.digitaltwin.aas4j.v3.model.Key; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringContentDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringContentDeserializer.java similarity index 86% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringContentDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringContentDeserializer.java index 000fcd369..7cb741f9c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringContentDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringContentDeserializer.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonNode; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.helper.LangStringContent; import java.io.IOException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.util.LangStringContent; + public class LangStringContentDeserializer implements CustomJsonNodeDeserializer { @Override public LangStringContent readValue(JsonNode node, JsonParser parser) throws IOException { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDefinitionTypeIec61360Deserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsDefinitionTypeIec61360Deserializer.java similarity index 88% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDefinitionTypeIec61360Deserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsDefinitionTypeIec61360Deserializer.java index 6979ff592..c3e6cb63b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsDefinitionTypeIec61360Deserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsDefinitionTypeIec61360Deserializer.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.helper.LangStringContent; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.util.LangStringContent; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringDefinitionTypeIec61360; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsNameTypeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsNameTypeDeserializer.java similarity index 87% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsNameTypeDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsNameTypeDeserializer.java index 3a605ae5b..2030944b5 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsNameTypeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsNameTypeDeserializer.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.helper.LangStringContent; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.util.LangStringContent; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringNameType; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsPreferredNameTypeIec61360Deserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsPreferredNameTypeIec61360Deserializer.java similarity index 89% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsPreferredNameTypeIec61360Deserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsPreferredNameTypeIec61360Deserializer.java index ba55c0b7c..77761280a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsPreferredNameTypeIec61360Deserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsPreferredNameTypeIec61360Deserializer.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.helper.LangStringContent; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.util.LangStringContent; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringPreferredNameTypeIec61360; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsShortNameTypeIec61360Deserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsShortNameTypeIec61360Deserializer.java similarity index 88% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsShortNameTypeIec61360Deserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsShortNameTypeIec61360Deserializer.java index 7d03df54c..d0bbb37b3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsShortNameTypeIec61360Deserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsShortNameTypeIec61360Deserializer.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.helper.LangStringContent; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.util.LangStringContent; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringShortNameTypeIec61360; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsTextTypeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsTextTypeDeserializer.java similarity index 87% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsTextTypeDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsTextTypeDeserializer.java index 0979967fd..edea9160c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/LangStringsTextTypeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/LangStringsTextTypeDeserializer.java @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.helper.LangStringContent; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.util.LangStringContent; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultLangStringTextType; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/NoEntryWrapperListDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/NoEntryWrapperListDeserializer.java similarity index 97% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/NoEntryWrapperListDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/NoEntryWrapperListDeserializer.java index 320ea53f0..81cfb79ee 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/NoEntryWrapperListDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/NoEntryWrapperListDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import java.io.IOException; import java.util.ArrayList; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/OperationVariableDeserializer.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/OperationVariableDeserializer.java index 441a20e85..d2c970aa0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/OperationVariableDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/OperationVariableDeserializer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/QualifierDeserializer.java similarity index 97% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/QualifierDeserializer.java index c20002096..cb6d251ec 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/QualifierDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/QualifierDeserializer.java @@ -39,7 +39,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ReferencesDeserializer.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ReferencesDeserializer.java index 6aac5f8ba..7c927e018 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ReferencesDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ReferencesDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementDeserializer.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementDeserializer.java index ee5a2c233..346091cd3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementsDeserializer.java similarity index 98% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementsDeserializer.java index 987ade7a3..0fd407cb8 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/SubmodelElementsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementsDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ValueReferencePairNodeDeserializer.java similarity index 94% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ValueReferencePairNodeDeserializer.java index 0d4c23a07..b30635b15 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairNodeDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ValueReferencePairNodeDeserializer.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.databind.JsonNode; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ValueReferencePairsDeserializer.java similarity index 92% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ValueReferencePairsDeserializer.java index 9b8fcc78e..1a7f1d20f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/deserialization/ValueReferencePairsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ValueReferencePairsDeserializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AdministrativeInformationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AdministrativeInformationMixin.java similarity index 93% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AdministrativeInformationMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AdministrativeInformationMixin.java index 4a2eaa89f..c00ca6da0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AdministrativeInformationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AdministrativeInformationMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AnnotatedRelationshipElementMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AnnotatedRelationshipElementMixin.java similarity index 79% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AnnotatedRelationshipElementMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AnnotatedRelationshipElementMixin.java index ae16bbcb3..dc412810f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AnnotatedRelationshipElementMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AnnotatedRelationshipElementMixin.java @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.DataElementsDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.DataElementsSerializer; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.DataElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.DataElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataElement; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AssetAdministrationShellMixin.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AssetAdministrationShellMixin.java index 83f36a12a..a86fbe4f6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetAdministrationShellMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AssetAdministrationShellMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AssetInformationMixin.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AssetInformationMixin.java index ae73124a9..d535001e8 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/AssetInformationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/AssetInformationMixin.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ConceptDescriptionMixin.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ConceptDescriptionMixin.java index f7d7f7643..938c32d62 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ConceptDescriptionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ConceptDescriptionMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/DataSpecificationIec61360Mixin.java similarity index 83% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/DataSpecificationIec61360Mixin.java index 64cf17940..1bb111ecd 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/DataSpecificationIec61360Mixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/DataSpecificationIec61360Mixin.java @@ -13,20 +13,21 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.serialization.EnumSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsDefinitionTypeIec61360Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsShortNameTypeIec61360Deserializer; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.serialization.EnumSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsDefinitionTypeIec61360Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsPreferredNameTypeIec61360Serializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsShortNameTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.LangStringsDefinitionTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.LangStringsPreferredNameTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.LangStringsShortNameTypeIec61360Deserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.LangStringsDefinitionTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.LangStringsPreferredNameTypeIec61360Serializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.LangStringsShortNameTypeIec61360Serializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EmbeddedDataSpecificationMixin.java similarity index 85% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EmbeddedDataSpecificationMixin.java index ed615bf18..949e03d1e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EmbeddedDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EmbeddedDataSpecificationMixin.java @@ -13,15 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.EmbeddedDataSpecificationsDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.EmbeddedDataSpecificationSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.EmbeddedDataSpecificationsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.EmbeddedDataSpecificationSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.DataSpecificationContent; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EntityMixin.java similarity index 84% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EntityMixin.java index 0a2f38932..4635a7a5a 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EntityMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EntityMixin.java @@ -13,15 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EnvironmentMixin.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EnvironmentMixin.java index 31e29a9b0..0ad244fb3 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/EnvironmentMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/EnvironmentMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ExtensionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ExtensionMixin.java similarity index 86% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ExtensionMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ExtensionMixin.java index 2c279d707..5a31c4d03 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ExtensionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ExtensionMixin.java @@ -13,11 +13,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.RefersToSerializer; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.RefersToSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasDataSpecificationMixin.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasDataSpecificationMixin.java index ca344f604..404e26f29 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasDataSpecificationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasDataSpecificationMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasExtensionsMixin.java similarity index 94% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasExtensionsMixin.java index c5228f9a0..b7641ba79 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasExtensionsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasExtensionsMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasSemanticsMixin.java similarity index 90% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasSemanticsMixin.java index cd2ae17ee..3a7596e33 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/HasSemanticsMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/HasSemanticsMixin.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ReferencesDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.ReferencesDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/KeyMixin.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/KeyMixin.java index 78190506e..c1d197557 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/KeyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/KeyMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/LevelTypeMixin.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/LevelTypeMixin.java index db54e96eb..5e3555d25 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/LevelTypeMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/LevelTypeMixin.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/MultiLanguagePropertyMixin.java similarity index 89% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/MultiLanguagePropertyMixin.java index 66437999d..747aba825 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/MultiLanguagePropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/MultiLanguagePropertyMixin.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.LangStringsTextTypeDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/OperationMixin.java similarity index 87% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/OperationMixin.java index 14926181b..0e78c1fb4 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/OperationMixin.java @@ -13,10 +13,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.OperationVariableDeserializer; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.OperationVariableDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/OperationVariableMixin.java similarity index 83% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/OperationVariableMixin.java index 582926deb..f1fae21a7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/OperationVariableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/OperationVariableMixin.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.SubmodelElementDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.SubmodelElementSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; public interface OperationVariableMixin { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/PropertyMixin.java similarity index 93% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/PropertyMixin.java index 68a0c229e..c6eddadc4 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/PropertyMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/PropertyMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/QualifiableMixin.java similarity index 90% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/QualifiableMixin.java index 871c4daba..d231c82c4 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifiableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/QualifiableMixin.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.QualifierDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.QualifierDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/QualifierMixin.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/QualifierMixin.java index 29f0b0775..5dba27387 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/QualifierMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/QualifierMixin.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ReferableMixin.java similarity index 80% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ReferableMixin.java index af190e8f5..4c91318b4 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferableMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ReferableMixin.java @@ -13,17 +13,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsNameTypeDeserializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.LangStringsTextTypeDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsNameTypeSerializer; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.LangStringsTextTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.LangStringsNameTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.LangStringsTextTypeDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.LangStringsNameTypeSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.LangStringsTextTypeSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ReferenceMixin.java similarity index 91% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ReferenceMixin.java index c6a2a26b8..a8eacf3c1 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ReferenceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ReferenceMixin.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.KeysDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.KeysDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Key; import org.eclipse.digitaltwin.aas4j.v3.model.ReferenceTypes; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ResourceMixin.java similarity index 94% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ResourceMixin.java index 21a6963e8..ae2f10e93 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ResourceMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ResourceMixin.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SpecificAssetIdMixin.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SpecificAssetIdMixin.java index cc15f92f7..e03c0b401 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SpecificAssetIdMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SpecificAssetIdMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementCollectionMixin.java similarity index 82% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementCollectionMixin.java index 511c53779..bd11afad7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementCollectionMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementCollectionMixin.java @@ -13,14 +13,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementListMixin.java similarity index 90% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementListMixin.java index 9ee63793f..5da6ae1ae 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementListMixin.java @@ -14,14 +14,15 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.AasSubmodelElements; import org.eclipse.digitaltwin.aas4j.v3.model.DataTypeDefXsd; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementMixin.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementMixin.java index 4992fb50f..b2c981b42 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelElementMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelElementMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelMixin.java similarity index 85% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelMixin.java index 4e9525647..d69cd5e17 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/SubmodelMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/SubmodelMixin.java @@ -13,15 +13,16 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.SubmodelElementsDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization.SubmodelElementsSerializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.SubmodelElementsDeserializer; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization.SubmodelElementsSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ValueListMixin.java similarity index 90% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ValueListMixin.java index 6121f1230..71c626640 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueListMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ValueListMixin.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.databind.annotation.JsonDeserialize; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.deserialization.ValueReferencePairsDeserializer; + import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization.ValueReferencePairsDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.ValueReferencePair; import java.util.List; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ValueReferencePairMixin.java similarity index 94% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ValueReferencePairMixin.java index a09a92494..3ba0e496b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/mixins/ValueReferencePairMixin.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/mixins/ValueReferencePairMixin.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins; import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AbstractLangStringSerializer.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AbstractLangStringSerializer.java index 4f88b81ee..22d3f47cf 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AbstractLangStringSerializer.java @@ -17,7 +17,7 @@ /** * */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AbstractLangStringsSerializer.java similarity index 92% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AbstractLangStringsSerializer.java index 5937ab007..505980d9d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AbstractLangStringsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AbstractLangStringsSerializer.java @@ -14,12 +14,13 @@ * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.AbstractLangString; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AssetAdministrationShellEnvironmentSerializer.java similarity index 97% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AssetAdministrationShellEnvironmentSerializer.java index ea3261e55..2c608b8b6 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/AssetAdministrationShellEnvironmentSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/AssetAdministrationShellEnvironmentSerializer.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/DataElementsSerializer.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/DataElementsSerializer.java index 3e0a20e5a..96c18d879 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/DataElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/DataElementsSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/EmbeddedDataSpecificationSerializer.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/EmbeddedDataSpecificationSerializer.java index b70aaf051..88bc537c0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/EmbeddedDataSpecificationSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/EmbeddedDataSpecificationSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.core.JsonProcessingException; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsDefinitionTypeIec61360Serializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsDefinitionTypeIec61360Serializer.java similarity index 92% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsDefinitionTypeIec61360Serializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsDefinitionTypeIec61360Serializer.java index c80f8f3d5..da102f4cb 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsDefinitionTypeIec61360Serializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsDefinitionTypeIec61360Serializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringDefinitionTypeIec61360; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsNameTypeSerializer.java similarity index 92% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsNameTypeSerializer.java index f22a61c91..7f2604ef7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsNameTypeSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsNameTypeSerializer.java @@ -13,12 +13,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringNameType; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsPreferredNameTypeIec61360Serializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsPreferredNameTypeIec61360Serializer.java similarity index 93% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsPreferredNameTypeIec61360Serializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsPreferredNameTypeIec61360Serializer.java index af86ea5cf..f3d83321f 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsPreferredNameTypeIec61360Serializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsPreferredNameTypeIec61360Serializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringPreferredNameTypeIec61360; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsShortNameTypeIec61360Serializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsShortNameTypeIec61360Serializer.java similarity index 92% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsShortNameTypeIec61360Serializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsShortNameTypeIec61360Serializer.java index 6fdd248f9..5ffc734ec 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsShortNameTypeIec61360Serializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsShortNameTypeIec61360Serializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringShortNameTypeIec61360; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsTextTypeSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsTextTypeSerializer.java similarity index 92% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsTextTypeSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsTextTypeSerializer.java index a7749b6da..f539b8c0d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/LangStringsTextTypeSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/LangStringsTextTypeSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import org.eclipse.digitaltwin.aas4j.v3.model.LangStringTextType; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/NoEntryWrapperListSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/NoEntryWrapperListSerializer.java similarity index 97% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/NoEntryWrapperListSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/NoEntryWrapperListSerializer.java index ca6c57055..f548b8761 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/NoEntryWrapperListSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/NoEntryWrapperListSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/OperationVariableSerializer.java similarity index 95% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/OperationVariableSerializer.java index cb79710fa..7d37b3a1e 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/OperationVariableSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/OperationVariableSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/RefersToSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/RefersToSerializer.java similarity index 93% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/RefersToSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/RefersToSerializer.java index 653fc24f2..38701d3d0 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/RefersToSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/RefersToSerializer.java @@ -23,13 +23,14 @@ * SPDX-License-Identifier: MIT ******************************************************************************/ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.mixins.HasSemanticsMixin; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.mixins.HasSemanticsMixin; import org.eclipse.digitaltwin.aas4j.v3.model.Extension; import org.eclipse.digitaltwin.aas4j.v3.model.Reference; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/SubmodelElementSerializer.java similarity index 96% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/SubmodelElementSerializer.java index 75361c374..a73b2b641 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/SubmodelElementSerializer.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/SubmodelElementsSerializer.java similarity index 92% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/SubmodelElementsSerializer.java index 66e2b626f..b1d05a419 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/serialization/SubmodelElementsSerializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/serialization/SubmodelElementsSerializer.java @@ -13,13 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.serialization; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.serialization; import com.fasterxml.jackson.core.JsonGenerator; import com.fasterxml.jackson.databind.JsonSerializer; import com.fasterxml.jackson.databind.SerializerProvider; import com.fasterxml.jackson.dataformat.xml.ser.ToXmlGenerator; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; + +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.SubmodelElementManager; import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/helper/LangStringContent.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/util/LangStringContent.java similarity index 93% rename from dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/helper/LangStringContent.java rename to dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/util/LangStringContent.java index 014b559d6..afc3e2fdf 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/helper/LangStringContent.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/util/LangStringContent.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.helper; +package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.util; /** * diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java index db1ba2ec6..d1e8a6e3b 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XMLDeserializerTest.java @@ -18,11 +18,11 @@ import java.io.FileNotFoundException; import java.util.List; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.Operation; import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; diff --git a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java index 47c409603..0be7247f5 100644 --- a/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java +++ b/dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java @@ -17,12 +17,12 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.DeserializationException; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.Examples; -import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.util.ReflectionHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.AasXmlNamespaceContext; import org.eclipse.digitaltwin.aas4j.v3.model.AssetKind; import org.eclipse.digitaltwin.aas4j.v3.model.ConceptDescription; From cd5973725528a319c01abe87c5f7f779f2f2dcaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 11:01:47 +0000 Subject: [PATCH 40/73] Bump com.networknt:json-schema-validator from 1.3.1 to 1.3.2 Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.3.1...1.3.2) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0a3d86ed8..1a674ff63 100644 --- a/pom.xml +++ b/pom.xml @@ -70,7 +70,7 @@ 2.1.0 4.1.0 1.5.1 - 1.3.1 + 1.3.2 4.13.2 1.1.1 2.7.8 From 4dc82ffb6694aaf0db55aba9675bf333be07e287 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 8 Feb 2024 10:21:39 +0000 Subject: [PATCH 41/73] Bump actions/delete-package-versions from 4 to 5 Bumps [actions/delete-package-versions](https://github.com/actions/delete-package-versions) from 4 to 5. - [Release notes](https://github.com/actions/delete-package-versions/releases) - [Commits](https://github.com/actions/delete-package-versions/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/delete-package-versions dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/maven-publish-snapshots.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/maven-publish-snapshots.yml b/.github/workflows/maven-publish-snapshots.yml index 97274da10..31d974da5 100644 --- a/.github/workflows/maven-publish-snapshots.yml +++ b/.github/workflows/maven-publish-snapshots.yml @@ -30,49 +30,49 @@ jobs: run: mvn -B package --file pom.xml - name: Delete old dataformat-parent package - uses: actions/delete-package-versions@v4 + uses: actions/delete-package-versions@v5 continue-on-error: true with: package-name: 'io.admin-shell.aas.dataformat-parent' - name: Delete old dataformat-core package - uses: actions/delete-package-versions@v4 + uses: actions/delete-package-versions@v5 continue-on-error: true with: package-name: 'io.admin-shell.aas.dataformat-core' - name: Delete old dataformat-aasx package - uses: actions/delete-package-versions@v4 + uses: actions/delete-package-versions@v5 continue-on-error: true with: package-name: 'io.admin-shell.aas.dataformat-aasx' - name: Delete old dataformat-xml package - uses: actions/delete-package-versions@v4 + uses: actions/delete-package-versions@v5 continue-on-error: true with: package-name: 'io.admin-shell.aas.dataformat-xml' - name: Delete old dataformat-aml package - uses: actions/delete-package-versions@v4 + uses: actions/delete-package-versions@v5 continue-on-error: true with: package-name: 'io.admin-shell.aas.dataformat-aml' - name: Delete old dataformat-rdf package - uses: actions/delete-package-versions@v4 + uses: actions/delete-package-versions@v5 continue-on-error: true with: package-name: 'io.admin-shell.aas.dataformat-rdf' - name: Delete old dataformat-json package - uses: actions/delete-package-versions@v4 + uses: actions/delete-package-versions@v5 continue-on-error: true with: package-name: 'io.admin-shell.aas.dataformat-json' - name: Delete old validator package - uses: actions/delete-package-versions@v4 + uses: actions/delete-package-versions@v5 continue-on-error: true with: package-name: 'io.admin-shell.aas.validator' From 09629e49fddd80aa9a96c237f0f932c7bf20cddb Mon Sep 17 00:00:00 2001 From: Thiago Weber Martins <68608396+twebermartins@users.noreply.github.com> Date: Tue, 13 Feb 2024 18:46:03 +0100 Subject: [PATCH 42/73] Prepares POM for release in Maven Central --- pom.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 1a674ff63..e6914ce25 100644 --- a/pom.xml +++ b/pom.xml @@ -40,9 +40,8 @@ 1 0 0 - -RC1 - ${revision.major}.${revision.minor}.${revision.patch}${revision.suffix} - 1.0.0-RC1 + ${revision.major}.${revision.minor}.${revision.patch} + 1.0.0 UTF-8 UTF-8 From e6035e16d4c18c790ca7074a35c59168b7553a10 Mon Sep 17 00:00:00 2001 From: Thiago Weber Martins <68608396+twebermartins@users.noreply.github.com> Date: Tue, 13 Feb 2024 20:23:10 +0100 Subject: [PATCH 43/73] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7ff8ea555..ddb2a347e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Eclipse AAS4J -> :newspaper: The _`Eclipse AAS4J 1.0.0-RC1`_ release is available on Maven Central Repository and includes the +> :newspaper: The _`Eclipse AAS4J 1.0.0`_ release is available on [Maven Central Repository](https://oss.sonatype.org/#nexus-search;quick~org.eclipse.digitaltwin.aas4j) and includes the > following artifacts implementing the _AAS Specs – Part 1 V3.0 (final)_: `aas4j-dataformat-core`, `aas4j-dataformat-aasx`, > `aas4j-dataformat-xml`, `aas4j-dataformat-json`, `aas4j-dataformat-parent`, and `aas4j-model`. From 6636cd209687341df0ceea0996ae4d26217344c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 10:52:02 +0000 Subject: [PATCH 44/73] Bump org.apache.commons:commons-compress from 1.25.0 to 1.26.0 Bumps org.apache.commons:commons-compress from 1.25.0 to 1.26.0. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e6914ce25..36244e099 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 4.8.165 1.15 2.15.1 - 1.25.0 + 1.26.0 3.14.0 33.0.0-jre 5.0.1 From c3fdd778d77afae390554b8729de03a69aaf7821 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Feb 2024 10:06:38 +0000 Subject: [PATCH 45/73] Bump com.networknt:json-schema-validator from 1.3.2 to 1.3.3 Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.2 to 1.3.3. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.3.2...1.3.3) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e6914ce25..7465d5107 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.1.0 4.1.0 1.5.1 - 1.3.2 + 1.3.3 4.13.2 1.1.1 2.7.8 From 6c2b04e4ee0e2413a38922828ec55093354aa7ec Mon Sep 17 00:00:00 2001 From: fvolz Date: Tue, 27 Feb 2024 15:22:57 +0100 Subject: [PATCH 46/73] [Bugfix] Files in SubmodelElementLists and NullPointerException when serializing/deserializing empty files (#250) * visit all elements (also list) and add null check * skip empty files when serializing AASX * add tests for empty files and files in submodelElementList * fix null test * change serializer test to AASFull provokes java.lang.NullPointerException: Cannot invoke "String.startsWith(String)" because "path" is null * fix serializer test, add thumbnail to AASFull * fix missing import * revert AASFull change, change AASXSerializerTest * revert unused import * remove unused imports --- .../v3/dataformat/aasx/AASXDeserializer.java | 31 ++++---------- .../v3/dataformat/aasx/AASXSerializer.java | 40 ++++++++----------- .../deserialization/AASXDeserializerTest.java | 32 +++++++++++++++ .../serialization/AASXSerializerTest.java | 27 +++++++++---- 4 files changed, 76 insertions(+), 54 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index f6ab72a13..234fe9ccb 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -21,7 +21,6 @@ import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.stream.Collectors; @@ -33,11 +32,10 @@ import org.apache.poi.openxml4j.opc.PackagingURIHelper; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.visitor.AssetAdministrationShellElementWalkerVisitor; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -207,27 +205,14 @@ private List parseReferencedFilePathsFromAASX() throws IOException, Inva && aas.getAssetInformation().getDefaultThumbnail() != null && aas.getAssetInformation().getDefaultThumbnail().getPath() != null) .forEach(aas -> paths.add(aas.getAssetInformation().getDefaultThumbnail().getPath())); - environment.getSubmodels().forEach(sm -> paths.addAll(parseElements(sm.getSubmodelElements()))); - return paths; - } - - /** - * Gets the file paths from a collection of ISubmodelElement - * - * @param elements the submodel elements to process - * @return the Paths from the File elements - */ - private List parseElements(Collection elements) { - List paths = new ArrayList<>(); - for (SubmodelElement element : elements) { - if (element instanceof File) { - File file = (File) element; - paths.add(file.getValue()); - } else if (element instanceof SubmodelElementCollection) { - SubmodelElementCollection collection = (SubmodelElementCollection) element; - paths.addAll(parseElements(collection.getValue())); + new AssetAdministrationShellElementWalkerVisitor() { + @Override + public void visit(File file) { + if(file != null && file.getValue() != null) { + paths.add(file.getValue()); + } } - } + }.visit(environment); return paths; } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 8eb4a9090..4d2d9e400 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -33,12 +33,10 @@ import org.apache.poi.openxml4j.opc.internal.MemoryPackagePart; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.visitor.AssetAdministrationShellElementWalkerVisitor; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; -import org.eclipse.digitaltwin.aas4j.v3.model.Submodel; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElement; -import org.eclipse.digitaltwin.aas4j.v3.model.SubmodelElementCollection; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -94,7 +92,7 @@ public AASXSerializer(XmlSerializer xmlSerializer) { */ public void write(Environment environment, Collection files, OutputStream os) throws SerializationException, IOException { - prepareFilePaths(environment.getSubmodels()); + prepareFilePaths(environment); OPCPackage rootPackage = OPCPackage.create(os); @@ -129,9 +127,8 @@ private void storeFilesInAASX(Environment environment, Collection .forEach(aas -> createParts(files, AASXUtils.removeFilePartOfURI(aas.getAssetInformation().getDefaultThumbnail().getPath()), rootPackage, xmlPart, aas.getAssetInformation().getDefaultThumbnail().getContentType())); - environment.getSubmodels().forEach(sm -> - findFileElements(sm.getSubmodelElements()).forEach(file -> createParts(files, - AASXUtils.removeFilePartOfURI(file.getValue()), rootPackage, xmlPart, file.getContentType()))); + findFileElements(environment).forEach(file -> createParts(files, + AASXUtils.removeFilePartOfURI(file.getValue()), rootPackage, xmlPart, file.getContentType())); } /** @@ -226,35 +223,32 @@ private void writeDataToPart(PackagePart part, byte[] content) { } /** - * Gets the File elements from a collection of elements Also recursively + * Gets the File elements from an environment * searches in SubmodelElementCollections * - * @param elements the Elements to be searched for File elements + * @param environment the Environment * @return the found Files */ - private Collection findFileElements(Collection elements) { + private Collection findFileElements(Environment environment) { Collection files = new ArrayList<>(); - - for (SubmodelElement element : elements) { - if (element instanceof File) { - files.add((File) element); - } else if (element instanceof SubmodelElementCollection) { - // Recursive call to deal with SubmodelElementCollections - files.addAll(findFileElements(((SubmodelElementCollection) element).getValue())); + new AssetAdministrationShellElementWalkerVisitor() { + @Override + public void visit(File file) { + if(file != null && file.getValue() != null) { + files.add(file); + } } - } - + }.visit(environment); return files; } /** * Replaces the path in all File Elements with the result of preparePath * - * @param submodels the Submodels + * @param environment the Environment */ - private void prepareFilePaths(Collection submodels) { - submodels.stream() - .forEach(sm -> findFileElements(sm.getSubmodelElements()).stream().forEach(f -> f.setValue(preparePath(f.getValue())))); + private void prepareFilePaths(Environment environment) { + findFileElements(environment).forEach(f -> f.setValue(preparePath(f.getValue()))); } /** diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java index 4cd02eeba..1b01f8772 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java @@ -44,6 +44,7 @@ import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultEnvironment; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultFile; import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodel; +import org.eclipse.digitaltwin.aas4j.v3.model.impl.DefaultSubmodelElementList; import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; @@ -92,6 +93,37 @@ public void relatedFilesAreOnlyResolvedIfWithinAASX() throws IOException, Serial assertEquals(Collections.singletonList(inMemoryFile), deserializer.getRelatedFiles()); } + @Test + public void emptyFiles() throws IOException, SerializationException, InvalidFormatException, DeserializationException { + File emptyFile = new DefaultFile.Builder().idShort("emptyFile").contentType(null).value(null).build(); + Submodel fileSm = new DefaultSubmodel.Builder().id("doesNotMatter").submodelElements(emptyFile).build(); + Environment env = new DefaultEnvironment.Builder().submodels(fileSm).build(); + + java.io.File file = tempFolder.newFile("output.aasx"); + new AASXSerializer().write(env, null, new FileOutputStream(file)); + + InputStream in = new FileInputStream(file); + AASXDeserializer deserializer = new AASXDeserializer(in); + assertTrue(deserializer.getRelatedFiles().isEmpty()); + } + + @Test + public void filesInElementList() throws IOException, SerializationException, InvalidFormatException, DeserializationException { + DefaultSubmodelElementList elementList = new DefaultSubmodelElementList.Builder().value(createFileSubmodelElements()).build(); + Submodel fileSm = new DefaultSubmodel.Builder().id("doesNotMatter").submodelElements(elementList).build(); + Environment env = new DefaultEnvironment.Builder().submodels(fileSm).build(); + + byte[] image = { 0, 1, 2, 3, 4 }; + InMemoryFile inMemoryFile = new InMemoryFile(image, "file:///aasx/internalFile.jpg"); + + java.io.File file = tempFolder.newFile("output.aasx"); + new AASXSerializer().write(env, Collections.singleton(inMemoryFile), new FileOutputStream(file)); + + InputStream in = new FileInputStream(file); + AASXDeserializer deserializer = new AASXDeserializer(in); + assertEquals(Collections.singletonList(inMemoryFile), deserializer.getRelatedFiles()); + } + private static List createFileSubmodelElements() { File internalFile = new DefaultFile.Builder().idShort("internalFile").contentType("image/jpeg").value("file:///aasx/internalFile.jpg").build(); File externalFile = new DefaultFile.Builder().idShort("externalFile").contentType("image/jpeg").value("http://doesNotMatter.com/image").build(); diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index aa23825ed..ebbe0c649 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -18,9 +18,9 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; -import org.junit.Before; import org.junit.Test; import javax.xml.parsers.ParserConfigurationException; @@ -43,19 +43,30 @@ public class AASXSerializerTest { private List fileList = new ArrayList<>(); - @Before - public void setup() throws IOException { + @Test + public void testBuildAASXFull() throws IOException, TransformerException, ParserConfigurationException, SerializationException { byte[] operationManualContent = { 0, 1, 2, 3, 4 }; + InMemoryFile file = new InMemoryFile(operationManualContent, "file:///TestFile.pdf"); + fileList.add(file); + // This stream can be used to write the .aasx directly to a file + // FileOutputStream out = new FileOutputStream("path/to/test.aasx"); + + // This stream keeps the output of the AASXFactory only in memory + ByteArrayOutputStream out = new ByteArrayOutputStream(); + + new AASXSerializer().write(AASFull.createEnvironment(), fileList, out); + + validateAASX(out); + } + + @Test + public void testBuildAASXSimple() throws IOException, TransformerException, ParserConfigurationException, SerializationException { byte[] thumbnail = { 0, 1, 2, 3, 4 }; + byte[] operationManualContent = { 0, 1, 2, 3, 4 }; InMemoryFile file = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); InMemoryFile inMemoryFileThumbnail = new InMemoryFile(thumbnail, "file:///master/verwaltungsschale-detail-part1.png"); fileList.add(file); fileList.add(inMemoryFileThumbnail); - } - - @Test - public void testBuildAASX() throws IOException, TransformerException, ParserConfigurationException, SerializationException { - // This stream can be used to write the .aasx directly to a file // FileOutputStream out = new FileOutputStream("path/to/test.aasx"); From a37bef701777daf861062e2ed84b858c0e253241 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:43:16 +0100 Subject: [PATCH 47/73] Prepare 1.0.1 release (#254) * Prepare 1.0.1 release * Update README.md --- README.md | 2 +- pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ddb2a347e..058b00311 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Eclipse AAS4J -> :newspaper: The _`Eclipse AAS4J 1.0.0`_ release is available on [Maven Central Repository](https://oss.sonatype.org/#nexus-search;quick~org.eclipse.digitaltwin.aas4j) and includes the +> :newspaper: The _`Eclipse AAS4J 1.0.1`_ release is available on [Maven Central Repository](https://oss.sonatype.org/#nexus-search;quick~org.eclipse.digitaltwin.aas4j) and includes the > following artifacts implementing the _AAS Specs – Part 1 V3.0 (final)_: `aas4j-dataformat-core`, `aas4j-dataformat-aasx`, > `aas4j-dataformat-xml`, `aas4j-dataformat-json`, `aas4j-dataformat-parent`, and `aas4j-model`. diff --git a/pom.xml b/pom.xml index b224c08d4..6d1076629 100644 --- a/pom.xml +++ b/pom.xml @@ -39,9 +39,9 @@ 1 0 - 0 + 1 ${revision.major}.${revision.minor}.${revision.patch} - 1.0.0 + 1.0.1 UTF-8 UTF-8 From 24b4ba16b118a67fd1348af339eeea7819d193cf Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Fri, 1 Mar 2024 09:50:09 +0100 Subject: [PATCH 48/73] Update pom.xml --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 6d1076629..7899a1d7b 100644 --- a/pom.xml +++ b/pom.xml @@ -38,10 +38,10 @@ 1 - 0 - 1 + 1 + 0-SNAPSHOT ${revision.major}.${revision.minor}.${revision.patch} - 1.0.1 + 1.1.0-SNAPSHOT UTF-8 UTF-8 From 429da9515a5bd4a5422f62031d09b0976959c116 Mon Sep 17 00:00:00 2001 From: Andreas Schilling Date: Thu, 14 Mar 2024 08:40:27 +0100 Subject: [PATCH 49/73] Use correct reference when adding thumbnail images (#263) * Use correct reference when adding thumbnail images fix #256 * Fix formatting * Apply further formatting fixes --- .../v3/dataformat/aasx/AASXSerializer.java | 44 +++++++------- .../serialization/AASXSerializerTest.java | 60 ++++++++++++++----- 2 files changed, 69 insertions(+), 35 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 4d2d9e400..c38dd3228 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -50,6 +50,7 @@ public class AASXSerializer { private static final String MIME_PLAINTXT = "text/plain"; private static final String MIME_XML = "application/xml"; + public static final String OPC_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships"; public static final String AASX_NAMESPACE = "http://admin-shell.io/aasx/relationships"; public static final String ORIGIN_RELTYPE = AASX_NAMESPACE + "/aasx-origin"; @@ -61,6 +62,8 @@ public class AASXSerializer { public static final String AASSUPPL_RELTYPE = AASX_NAMESPACE + "/aas-suppl"; + public static final String AAS_THUMBNAIL_RELTYPE = OPC_NAMESPACE + "/metadata/thumbnail"; + private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; private final XmlSerializer xmlSerializer; @@ -74,7 +77,7 @@ public AASXSerializer() { /** * Constructor with a custom serializer for serializing the aas environment - * + * * @param xmlSerializer a custom serializer used for serializing the aas environment */ public AASXSerializer(XmlSerializer xmlSerializer) { @@ -83,7 +86,7 @@ public AASXSerializer(XmlSerializer xmlSerializer) { /** * Generates the .aasx file and writes it to the given OutputStream - * + * * @param environment the aas environment that will be included in the aasx package as an xml serialization * @param files related inMemory files that belong to the given aas environment * @param os an output stream for writing the aasx package @@ -106,6 +109,12 @@ public void write(Environment environment, Collection files, Outpu // Save the XML to aasx/xml/content.xml PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(DEFAULT_CHARSET)); + environment.getAssetAdministrationShells().stream().filter(aas -> aas.getAssetInformation() != null + && aas.getAssetInformation().getDefaultThumbnail() != null + && aas.getAssetInformation().getDefaultThumbnail().getPath() != null) + .forEach(aas -> createParts(files, + AASXUtils.removeFilePartOfURI(aas.getAssetInformation().getDefaultThumbnail().getPath()), + rootPackage, rootPackage, aas.getAssetInformation().getDefaultThumbnail().getContentType(), AAS_THUMBNAIL_RELTYPE)); storeFilesInAASX(environment, files, rootPackage, xmlPart); saveAASX(os, rootPackage); @@ -113,7 +122,7 @@ public void write(Environment environment, Collection files, Outpu /** * Stores the files from the Submodels in the .aasx file - * + * * @param environment the Environment * @param files the content of the files * @param rootPackage the OPCPackage @@ -121,14 +130,8 @@ public void write(Environment environment, Collection files, Outpu */ private void storeFilesInAASX(Environment environment, Collection files, OPCPackage rootPackage, PackagePart xmlPart) { - environment.getAssetAdministrationShells().stream().filter(aas -> aas.getAssetInformation() != null - && aas.getAssetInformation().getDefaultThumbnail() != null - && aas.getAssetInformation().getDefaultThumbnail().getPath() != null) - .forEach(aas -> createParts(files, - AASXUtils.removeFilePartOfURI(aas.getAssetInformation().getDefaultThumbnail().getPath()), - rootPackage, xmlPart, aas.getAssetInformation().getDefaultThumbnail().getContentType())); findFileElements(environment).forEach(file -> createParts(files, - AASXUtils.removeFilePartOfURI(file.getValue()), rootPackage, xmlPart, file.getContentType())); + AASXUtils.removeFilePartOfURI(file.getValue()), rootPackage, xmlPart, file.getContentType(), AASSUPPL_RELTYPE)); } /** @@ -139,13 +142,14 @@ private void storeFilesInAASX(Environment environment, Collection * @param rootPackage the OPCPackage * @param xmlPart the Part the files should be related to * @param contentType the contentType of the file + * @param relType the relationship type */ private void createParts(Collection files, String filePath, OPCPackage rootPackage, - PackagePart xmlPart, String contentType) { + RelationshipSource xmlPart, String contentType, String relType) { try { InMemoryFile content = findFileByPath(files, filePath); logger.trace("Writing file '{}' to .aasx.", filePath); - createAASXPart(rootPackage, xmlPart, filePath, contentType, AASSUPPL_RELTYPE, content.getFileContent()); + createAASXPart(rootPackage, xmlPart, filePath, contentType, relType, content.getFileContent()); } catch (RuntimeException e) { // Log that a file is missing and continue building the .aasx logger.warn("Could not add File '{}'. It was not contained in given InMemoryFiles.", filePath, e); @@ -154,7 +158,7 @@ private void createParts(Collection files, String filePath, OPCPac /** * Saves the OPCPackage to the given OutputStream - * + * * @param os the Stream to be saved to * @param rootPackage the Package to be saved * @throws IOException if creating output streams for aasx fails @@ -167,7 +171,7 @@ private void saveAASX(OutputStream os, OPCPackage rootPackage) throws IOExceptio /** * Generates a UUID. Every element of the .aasx needs a unique Id according to * the specification - * + * * @return UUID */ private String createUniqueID() { @@ -177,7 +181,7 @@ private String createUniqueID() { /** * Creates a Part (a file in the .aasx) of the .aasx and adds it to the Package - * + * * @param root the OPCPackage * @param relateTo the Part of the OPC the relationship of the new Part should be added to * @param path the path inside the .aasx where the new Part should be created @@ -209,7 +213,7 @@ private PackagePart createAASXPart(OPCPackage root, RelationshipSource relateTo, /** * Writes the content of a byte[] to a Part - * + * * @param part the Part to be written to * @param content the content to be written to the part */ @@ -225,7 +229,7 @@ private void writeDataToPart(PackagePart part, byte[] content) { /** * Gets the File elements from an environment * searches in SubmodelElementCollections - * + * * @param environment the Environment * @return the found Files */ @@ -244,7 +248,7 @@ public void visit(File file) { /** * Replaces the path in all File Elements with the result of preparePath - * + * * @param environment the Environment */ private void prepareFilePaths(Environment environment) { @@ -253,7 +257,7 @@ private void prepareFilePaths(Environment environment) { /** * Finds an InMemoryFile by its path - * + * * @param files the InMemoryFiles * @param path the path of the wanted file * @return the InMemoryFile if it was found; else null @@ -269,7 +273,7 @@ private InMemoryFile findFileByPath(Collection files, String path) /** * Removes the serverpart from a path and ensures it starts with "file://" - * + * * @param path the path to be prepared * @return the prepared path */ diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index ebbe0c649..2e258efdf 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -28,8 +28,10 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.List; +import java.util.function.BiConsumer; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; @@ -38,6 +40,7 @@ public class AASXSerializerTest { + private static final String RELS_PATH_URI = "file:///_rels/.rels"; private static final String XML_PATH_URI = "file:///aasx/xml/content.xml"; private static final String ORIGIN_PATH_URI = "file:///aasx/aasx-origin"; @@ -56,7 +59,7 @@ public void testBuildAASXFull() throws IOException, TransformerException, Parser new AASXSerializer().write(AASFull.createEnvironment(), fileList, out); - validateAASX(out); + validateAASX(out, List.of(AASXSerializerTest::assertRootXml)); } @Test @@ -75,28 +78,26 @@ public void testBuildAASXSimple() throws IOException, TransformerException, Pars new AASXSerializer().write(AASSimple.createEnvironment(), fileList, out); - validateAASX(out); + validateAASX(out, List.of(AASXSerializerTest::assertRootXml, AASXSerializerTest::assertThumbnailReference)); } - private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { + private void validateAASX(ByteArrayOutputStream byteStream, List> fileValidators) { ZipInputStream in = new ZipInputStream(new ByteArrayInputStream(byteStream.toByteArray())); - ZipEntry zipEntry = null; + ZipEntry zipEntry; ArrayList filePaths = new ArrayList<>(); - while ((zipEntry = in.getNextEntry()) != null) { - if (zipEntry.getName().equals(XML_PATH_URI)) { - - // Read the first 5 bytes of the XML file to make sure it is in fact XML file - // No further test of XML file necessary as XML-Converter is tested separately - byte[] buf = new byte[5]; - in.read(buf); - assertEquals(" validator : fileValidators) { + validator.accept(zipEntry, in); + } + // Write the paths of all files contained in the .aasx into filePaths + filePaths.add("file:///" + zipEntry.getName()); } - - // Write the paths of all files contained in the .aasx into filePaths - filePaths.add("file:///" + zipEntry.getName()); + } catch (IOException e) { + throw new RuntimeException(e); } assertTrue(filePaths.contains(XML_PATH_URI)); @@ -110,4 +111,33 @@ private void validateAASX(ByteArrayOutputStream byteStream) throws IOException { } } + + private static void assertRootXml(ZipEntry zipEntry, ZipInputStream in) { + if (!XML_PATH_URI.endsWith(zipEntry.getName())) { + return; + } + // Read the first 5 bytes of the XML file to make sure it is in fact XML file + // No further test of XML file necessary as XML-Converter is tested separately + byte[] buf = new byte[5]; + try { + in.read(buf); + } catch (IOException e) { + throw new RuntimeException(e); + } + assertEquals(" Date: Thu, 14 Mar 2024 13:22:27 +0100 Subject: [PATCH 50/73] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.1.0 to 3.2.0 (#262) Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.1.0 to 3.2.0. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.1.0...maven-gpg-plugin-3.2.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- model/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/pom.xml b/model/pom.xml index 33773f8bb..d8a2f867c 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -107,7 +107,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.0 ${gpg.keyname} ${gpg.keyname} diff --git a/pom.xml b/pom.xml index 7899a1d7b..b06b0767a 100644 --- a/pom.xml +++ b/pom.xml @@ -205,7 +205,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.1.0 + 3.2.0 sign-artifacts From 4196a6e37fa03641fae1d24c1cd6902cd158fbce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:22:33 +0100 Subject: [PATCH 51/73] Bump jackson.version from 2.16.1 to 2.16.2 (#261) Bumps `jackson.version` from 2.16.1 to 2.16.2. Updates `com.fasterxml.jackson.core:jackson-databind` from 2.16.1 to 2.16.2 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.core:jackson-core` from 2.16.1 to 2.16.2 - [Commits](https://github.com/FasterXML/jackson-core/compare/jackson-core-2.16.1...jackson-core-2.16.2) Updates `com.fasterxml.jackson.core:jackson-annotations` from 2.16.1 to 2.16.2 - [Commits](https://github.com/FasterXML/jackson/commits) Updates `com.fasterxml.jackson.dataformat:jackson-dataformat-xml` from 2.16.1 to 2.16.2 - [Commits](https://github.com/FasterXML/jackson-dataformat-xml/compare/jackson-dataformat-xml-2.16.1...jackson-dataformat-xml-2.16.2) --- updated-dependencies: - dependency-name: com.fasterxml.jackson.core:jackson-databind dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.core:jackson-core dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.core:jackson-annotations dependency-type: direct:production update-type: version-update:semver-patch - dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-xml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b06b0767a..f8d07c271 100644 --- a/pom.xml +++ b/pom.xml @@ -63,7 +63,7 @@ 33.0.0-jre 5.0.1 2.2 - 2.16.1 + 2.16.2 2.0.1.Final 2.3.1 2.1.0 From 097189fd6a9e6173c07f574ddea66d7e655816ef Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:22:40 +0100 Subject: [PATCH 52/73] Bump org.apache.commons:commons-compress from 1.26.0 to 1.26.1 (#260) Bumps org.apache.commons:commons-compress from 1.26.0 to 1.26.1. --- updated-dependencies: - dependency-name: org.apache.commons:commons-compress dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f8d07c271..0659b14db 100644 --- a/pom.xml +++ b/pom.xml @@ -58,7 +58,7 @@ 4.8.165 1.15 2.15.1 - 1.26.0 + 1.26.1 3.14.0 33.0.0-jre 5.0.1 From 5433e96a1c77b16c8381ba6924e4a19315010e2b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:22:51 +0100 Subject: [PATCH 53/73] Bump io.github.classgraph:classgraph from 4.8.165 to 4.8.168 (#259) Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.165 to 4.8.168. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](https://github.com/classgraph/classgraph/compare/classgraph-4.8.165...classgraph-4.8.168) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0659b14db..8b25dde44 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 3.5.0 3.3.0 0.8.11 - 4.8.165 + 4.8.168 1.15 2.15.1 1.26.1 From 2c508b666d07d1ad24ed44c241797bae87074945 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Mar 2024 13:22:56 +0100 Subject: [PATCH 54/73] Bump org.mockito:mockito-core from 5.10.0 to 5.11.0 (#255) Bumps [org.mockito:mockito-core](https://github.com/mockito/mockito) from 5.10.0 to 5.11.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v5.10.0...v5.11.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8b25dde44..3032085a6 100644 --- a/pom.xml +++ b/pom.xml @@ -79,7 +79,7 @@ 4.4.1 2.12.1 2.9.1 - 5.10.0 + 5.11.0 0.0.20131108.vaadin1 From 1017e1d3592778d9fe4e9cf5760caac1d0165a43 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Thu, 14 Mar 2024 14:11:58 +0100 Subject: [PATCH 55/73] Bugfix/aasx files (#265) * Ensures sames files are only tried to be added once Signed-off-by: Frank Schnicke * Removes changing of file value to start with file:// on AASX serialization Signed-off-by: Frank Schnicke --------- Signed-off-by: Frank Schnicke --- .../v3/dataformat/aasx/AASXSerializer.java | 27 ++----------------- .../aasx/deserialization/ValidationTest.java | 3 +++ 2 files changed, 5 insertions(+), 25 deletions(-) diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index c38dd3228..9414df8a9 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -19,8 +19,8 @@ import java.io.OutputStream; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; -import java.util.ArrayList; import java.util.Collection; +import java.util.HashSet; import java.util.UUID; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; @@ -95,7 +95,6 @@ public AASXSerializer(XmlSerializer xmlSerializer) { */ public void write(Environment environment, Collection files, OutputStream os) throws SerializationException, IOException { - prepareFilePaths(environment); OPCPackage rootPackage = OPCPackage.create(os); @@ -234,7 +233,7 @@ private void writeDataToPart(PackagePart part, byte[] content) { * @return the found Files */ private Collection findFileElements(Environment environment) { - Collection files = new ArrayList<>(); + Collection files = new HashSet<>(); new AssetAdministrationShellElementWalkerVisitor() { @Override public void visit(File file) { @@ -246,15 +245,6 @@ public void visit(File file) { return files; } - /** - * Replaces the path in all File Elements with the result of preparePath - * - * @param environment the Environment - */ - private void prepareFilePaths(Environment environment) { - findFileElements(environment).forEach(f -> f.setValue(preparePath(f.getValue()))); - } - /** * Finds an InMemoryFile by its path * @@ -271,17 +261,4 @@ private InMemoryFile findFileByPath(Collection files, String path) throw new RuntimeException("The wanted file '" + path + "' was not found in the given files."); } - /** - * Removes the serverpart from a path and ensures it starts with "file://" - * - * @param path the path to be prepared - * @return the prepared path - */ - private String preparePath(String path) { - if (path.startsWith("/")) { - path = "file://" + path; - } - return path; - } - } diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java index a62341725..9d77fbf0c 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/ValidationTest.java @@ -48,8 +48,11 @@ public class ValidationTest { public void validateXmlInsideAasx() throws SerializationException, IOException, InvalidFormatException, DeserializationException, ParserConfigurationException, SAXException { List fileList = new ArrayList<>(); byte[] operationManualContent = { 0, 1, 2, 3, 4 }; + byte[] thumbnail = { 0, 1, 2, 3, 4 }; InMemoryFile inMemoryFile = new InMemoryFile(operationManualContent, "file:///aasx/OperatingManual.pdf"); + InMemoryFile inMemoryFileThumbnail = new InMemoryFile(thumbnail, "file:///master/verwaltungsschale-detail-part1.png"); fileList.add(inMemoryFile); + fileList.add(inMemoryFileThumbnail); File file = tempFolder.newFile("output.aasx"); From 53003287091c5672587c053077208e91d9a4c95c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Mar 2024 10:50:31 +0000 Subject: [PATCH 56/73] Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.0 to 3.2.2 Bumps [org.apache.maven.plugins:maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.2.0 to 3.2.2. - [Release notes](https://github.com/apache/maven-gpg-plugin/releases) - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.2.0...maven-gpg-plugin-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- model/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/pom.xml b/model/pom.xml index d8a2f867c..21a0520b6 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -107,7 +107,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.0 + 3.2.2 ${gpg.keyname} ${gpg.keyname} diff --git a/pom.xml b/pom.xml index 3032085a6..3c85926bf 100644 --- a/pom.xml +++ b/pom.xml @@ -205,7 +205,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.2.0 + 3.2.2 sign-artifacts From 0c53877d9845cefe9a14b08b2b7192c184cf4a9e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 10:50:58 +0000 Subject: [PATCH 57/73] Bump org.apache.maven.plugins:maven-compiler-plugin Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.12.1 to 3.13.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.12.1...maven-compiler-plugin-3.13.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3c85926bf..ef975ad1b 100644 --- a/pom.xml +++ b/pom.xml @@ -46,7 +46,7 @@ UTF-8 UTF-8 - 3.12.1 + 3.13.0 3.3.1 1.6.0 3.0.1 From 2a802b0d8efc90de3e0968f1542f2063e10cad31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 11:01:04 +0000 Subject: [PATCH 58/73] Bump com.google.guava:guava from 33.0.0-jre to 33.1.0-jre Bumps [com.google.guava:guava](https://github.com/google/guava) from 33.0.0-jre to 33.1.0-jre. - [Release notes](https://github.com/google/guava/releases) - [Commits](https://github.com/google/guava/commits) --- updated-dependencies: - dependency-name: com.google.guava:guava dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ef975ad1b..8d0c1c925 100644 --- a/pom.xml +++ b/pom.xml @@ -60,7 +60,7 @@ 2.15.1 1.26.1 3.14.0 - 33.0.0-jre + 33.1.0-jre 5.0.1 2.2 2.16.2 From 0477f3ee0290eccfb8a2fb05b5aad746d20f370c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 11:00:00 +0000 Subject: [PATCH 59/73] Bump com.networknt:json-schema-validator from 1.3.3 to 1.4.0 Bumps [com.networknt:json-schema-validator](https://github.com/networknt/json-schema-validator) from 1.3.3 to 1.4.0. - [Release notes](https://github.com/networknt/json-schema-validator/releases) - [Changelog](https://github.com/networknt/json-schema-validator/blob/master/CHANGELOG.md) - [Commits](https://github.com/networknt/json-schema-validator/compare/1.3.3...1.4.0) --- updated-dependencies: - dependency-name: com.networknt:json-schema-validator dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8d0c1c925..ba48c03a5 100644 --- a/pom.xml +++ b/pom.xml @@ -69,7 +69,7 @@ 2.1.0 4.1.0 1.5.1 - 1.3.3 + 1.4.0 4.13.2 1.1.1 2.7.8 From 91eb2f7581836ccea39ee1ee9687e7177ef61839 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 10:57:03 +0000 Subject: [PATCH 60/73] Bump org.apache.maven.plugins:maven-source-plugin from 3.3.0 to 3.3.1 Bumps [org.apache.maven.plugins:maven-source-plugin](https://github.com/apache/maven-source-plugin) from 3.3.0 to 3.3.1. - [Commits](https://github.com/apache/maven-source-plugin/compare/maven-source-plugin-3.3.0...maven-source-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-source-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- model/pom.xml | 2 +- pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/model/pom.xml b/model/pom.xml index 21a0520b6..c713af6c7 100644 --- a/model/pom.xml +++ b/model/pom.xml @@ -76,7 +76,7 @@ org.apache.maven.plugins maven-source-plugin - 3.3.0 + 3.3.1 attach-sources diff --git a/pom.xml b/pom.xml index ba48c03a5..ff3cc04fd 100644 --- a/pom.xml +++ b/pom.xml @@ -53,7 +53,7 @@ 3.3.0 3.6.3 3.5.0 - 3.3.0 + 3.3.1 0.8.11 4.8.168 1.15 From 420f5aba0a3aa8b1f3f1100b13ff9183b65671ca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 10:22:02 +0000 Subject: [PATCH 61/73] Bump io.github.classgraph:classgraph from 4.8.168 to 4.8.170 Bumps [io.github.classgraph:classgraph](https://github.com/classgraph/classgraph) from 4.8.168 to 4.8.170. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](https://github.com/classgraph/classgraph/compare/classgraph-4.8.168...classgraph-4.8.170) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ff3cc04fd..b76e6e486 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ 3.5.0 3.3.1 0.8.11 - 4.8.168 + 4.8.170 1.15 2.15.1 1.26.1 From 8e2259b98d6b99911486c4e72cf790bfb385af4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Apr 2024 05:35:59 +0000 Subject: [PATCH 62/73] Bump org.jacoco:jacoco-maven-plugin from 0.8.11 to 0.8.12 Bumps [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.11 to 0.8.12. - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.11...v0.8.12) --- updated-dependencies: - dependency-name: org.jacoco:jacoco-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b76e6e486..3e44a4323 100644 --- a/pom.xml +++ b/pom.xml @@ -54,7 +54,7 @@ 3.6.3 3.5.0 3.3.1 - 0.8.11 + 0.8.12 4.8.170 1.15 2.15.1 From 727b897097442364cf0137370d0160972918c3cf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 10:45:36 +0000 Subject: [PATCH 63/73] Bump commons-io:commons-io from 2.15.1 to 2.16.0 Bumps commons-io:commons-io from 2.15.1 to 2.16.0. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3e44a4323..5679eae39 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 0.8.12 4.8.170 1.15 - 2.15.1 + 2.16.0 1.26.1 3.14.0 33.1.0-jre From b7e467ed27deb6b251280739bc89c466ed8ef4af Mon Sep 17 00:00:00 2001 From: Rene Fischer <33397768+FischerRene@users.noreply.github.com> Date: Mon, 8 Apr 2024 14:30:12 +0200 Subject: [PATCH 64/73] Fixes example for dependency inclusion (#277) Adds missing forward slash, changes example to model itself, and adds existing latest version. --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 058b00311..69ca63153 100644 --- a/README.md +++ b/README.md @@ -50,9 +50,9 @@ or by integrating the respective modules as dependencies from [Maven Central](ht ``` org.eclipse.digitaltwin.aas4j - aas4j-dataformat-json - latest-version - + aas4j-model + 1.0.1 + ``` ## AAS4J Project Structure From ecf4dc3c6f7598bf3bd43baf82a12e6cebd14fec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 Apr 2024 10:31:32 +0000 Subject: [PATCH 65/73] Bump commons-io:commons-io from 2.16.0 to 2.16.1 Bumps commons-io:commons-io from 2.16.0 to 2.16.1. --- updated-dependencies: - dependency-name: commons-io:commons-io dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5679eae39..5ff3b4e02 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ 0.8.12 4.8.170 1.15 - 2.16.0 + 2.16.1 1.26.1 3.14.0 33.1.0-jre From 95172c5303e5a72782b652aee8868bf632a0f9f8 Mon Sep 17 00:00:00 2001 From: Michael Jacoby Date: Tue, 9 Apr 2024 16:11:19 +0200 Subject: [PATCH 66/73] Update README.md Remove link to outdated documentation --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 69ca63153..1d58f6f4b 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,6 @@ Please refer to [AAS Model README](model/README.md) for more information. ## Build and Use -Some examples can be found on the [documentation webpage](https://admin-shell-io.github.io/java-serializer/). - You can build the project using Maven by simply executing at the repository root: From e240ddc0ca924ade781bb3c31a48de88e129a24c Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Wed, 10 Apr 2024 09:40:06 +0200 Subject: [PATCH 67/73] Adds further compatibility with AASX Package Explorer & fine-tunes warning messages (#278) * Adds further compatibility with AASX Package Explorer & fine-tunes warning messages Signed-off-by: Frank Schnicke * Adresses review remarks Signed-off-by: Frank Schnicke --------- Signed-off-by: Frank Schnicke --- .../DataElementsDeserializer.java | 3 +- .../NoEntryWrapperListDeserializer.java | 6 +-- .../OperationVariableDeserializer.java | 41 +++++++++++------- .../QualifierDeserializer.java | 43 ++++++++++++------- .../ReferencesDeserializer.java | 17 ++++---- .../SubmodelElementsDeserializer.java | 7 ++- 6 files changed, 68 insertions(+), 49 deletions(-) diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DataElementsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DataElementsDeserializer.java index c2fd58d42..4c259b453 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DataElementsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/DataElementsDeserializer.java @@ -28,7 +28,6 @@ import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -47,7 +46,7 @@ public DataElementsDeserializer() { public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { TreeNode treeNode = DeserializationHelper.getRootTreeNode(parser); if (treeNode instanceof TextNode) { - return Collections.emptyList(); + return new ArrayList<>(); } ObjectNode node = (ObjectNode) treeNode; diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/NoEntryWrapperListDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/NoEntryWrapperListDeserializer.java index 81cfb79ee..550a2fe3c 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/NoEntryWrapperListDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/NoEntryWrapperListDeserializer.java @@ -17,7 +17,6 @@ import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import org.slf4j.Logger; @@ -30,6 +29,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; +import com.google.common.collect.Lists; /** * Custom deserializer for lists without individual list entry wrappers for parametrized classes. @@ -57,7 +57,7 @@ public List deserialize(JsonParser parser, DeserializationContext ctxt) throw return createEntriesFromArrayNode((ArrayNode) langStringNode, parser); } } catch (ClassCastException e) { - logger.info("Found empty list items (e.g., '' of dataSpecificationIec61360) in XML. This is most likely an error."); + logger.info("Found empty list item (e.g., '' of dataSpecificationIec61360) in XML. This is most likely an error."); return new ArrayList(); } } @@ -73,6 +73,6 @@ private List createEntriesFromArrayNode(ArrayNode langStringsNode, JsonParser private List createEntriesFromObjectNode(JsonNode langStringNode, JsonParser parser) throws IOException { T entry = nodeDeserializer.readValue(langStringNode, parser); - return Collections.singletonList(entry); + return Lists.newArrayList(entry); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/OperationVariableDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/OperationVariableDeserializer.java index d2c970aa0..a67fbd3f7 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/OperationVariableDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/OperationVariableDeserializer.java @@ -16,6 +16,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -23,30 +31,31 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.OperationVariable; - -import java.io.IOException; -import java.util.Collections; -import java.util.List; +import com.google.common.collect.Lists; public class OperationVariableDeserializer extends JsonDeserializer> { + private static Logger logger = LoggerFactory.getLogger(OperationVariableDeserializer.class); @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { - ObjectNode node = DeserializationHelper.getRootObjectNode(parser); + try { + ObjectNode node = DeserializationHelper.getRootObjectNode(parser); - if (!node.has("operationVariable")) { - return Collections.emptyList(); + if (!node.has("operationVariable")) { + return new ArrayList<>(); + } + JsonNode operationVariableNode = node.get("operationVariable"); + if (operationVariableNode.isArray()) { + return createOperationVariablesFromArrayNode(parser, node); + } else { + OperationVariable operationVariable = DeserializationHelper.createInstanceFromNode(parser, operationVariableNode, OperationVariable.class); + return Lists.newArrayList(operationVariable); + } + } catch (ClassCastException e) { + logger.info("Found empty list item in Operation (e.g., '') in XML. This is most likely an error."); + return new ArrayList<>(); } - JsonNode operationVariableNode = node.get("operationVariable"); - if (operationVariableNode.isArray()) { - return createOperationVariablesFromArrayNode(parser, node); - } else { - OperationVariable operationVariable = DeserializationHelper.createInstanceFromNode(parser, operationVariableNode, OperationVariable.class); - return Collections.singletonList(operationVariable); - } - } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/QualifierDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/QualifierDeserializer.java index cb6d251ec..5f9cffa9d 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/QualifierDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/QualifierDeserializer.java @@ -41,6 +41,14 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.databind.DeserializationContext; @@ -48,28 +56,31 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.Qualifier; - -import java.io.IOException; -import java.util.Collections; -import java.util.List; - +import com.google.common.collect.Lists; public class QualifierDeserializer extends JsonDeserializer> { + private static Logger logger = LoggerFactory.getLogger(QualifierDeserializer.class); + @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { - ObjectNode node = DeserializationHelper.getRootObjectNode(parser); + try { + ObjectNode node = DeserializationHelper.getRootObjectNode(parser); - if (!node.has("qualifier")) { - return Collections.emptyList(); - } - JsonNode qualifierNode = node.get("qualifier"); - if (qualifierNode.isArray()) { - return createConstraintsFromArrayNode(parser, node); - } else { - Qualifier qualifier = DeserializationHelper.createInstanceFromNode(parser, qualifierNode, Qualifier.class); - return Collections.singletonList(qualifier); + if (!node.has("qualifier")) { + return new ArrayList<>(); + } + JsonNode qualifierNode = node.get("qualifier"); + if (qualifierNode.isArray()) { + return createConstraintsFromArrayNode(parser, node); + } else { + Qualifier qualifier = DeserializationHelper.createInstanceFromNode(parser, qualifierNode, + Qualifier.class); + return Lists.newArrayList(qualifier); + } + } catch (ClassCastException e) { + logger.info("Found empty list item of qualifiers ('') in XML. This is most likely an error."); + return new ArrayList(); } } diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ReferencesDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ReferencesDeserializer.java index 7c927e018..df02b914b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ReferencesDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/ReferencesDeserializer.java @@ -15,6 +15,12 @@ */ package org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.internal.deserialization; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.digitaltwin.aas4j.v3.model.Reference; + import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.TreeNode; @@ -22,19 +28,14 @@ import com.fasterxml.jackson.databind.JsonDeserializer; import com.fasterxml.jackson.databind.node.ArrayNode; import com.fasterxml.jackson.databind.node.ObjectNode; -import org.eclipse.digitaltwin.aas4j.v3.model.Reference; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; +import com.google.common.collect.Lists; public class ReferencesDeserializer extends JsonDeserializer> { @Override public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { TreeNode treeNode = DeserializationHelper.getRootTreeNode(parser); - treeNode = treeNode.get("reference"); + treeNode = treeNode.get("reference"); if (treeNode.isArray()) { return createReferencesFromArray(parser, (ArrayNode) treeNode); } else { @@ -44,7 +45,7 @@ public List deserialize(JsonParser parser, DeserializationContext ctx private List createReferencesFromObjectNode(JsonParser parser, ObjectNode node) throws IOException { Reference reference = createReference(parser, node); - return Collections.singletonList(reference); + return Lists.newArrayList(reference); } private List createReferencesFromArray(JsonParser parser, ArrayNode arrayNode) throws IOException { diff --git a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementsDeserializer.java b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementsDeserializer.java index 0fd407cb8..e77e85e9b 100644 --- a/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementsDeserializer.java +++ b/dataformat-xml/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/internal/deserialization/SubmodelElementsDeserializer.java @@ -29,7 +29,6 @@ import java.io.IOException; import java.util.ArrayList; -import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -48,14 +47,14 @@ public SubmodelElementsDeserializer() { public List deserialize(JsonParser parser, DeserializationContext ctxt) throws IOException, JsonProcessingException { TreeNode treeNode = DeserializationHelper.getRootTreeNode(parser); if (treeNode instanceof TextNode) { - return Collections.emptyList(); + return new ArrayList<>(); } else { return createSubmodelElements(parser, ctxt, treeNode); } } private List createSubmodelElements(JsonParser parser, DeserializationContext ctxt, TreeNode treeNode) throws IOException, JsonProcessingException { - if (treeNode.isArray()) { + if (treeNode.isArray()) { return getSubmodelElementsFromArrayNode(parser, ctxt, (ArrayNode) treeNode); } else { return getSubmodelElementsFromObjectNode(parser, ctxt, (JsonNode) treeNode); @@ -100,7 +99,7 @@ private List getSubmodelElementsFromArrayNode(JsonParser parser private SubmodelElement getSubmodelElementFromJsonNode(JsonParser parser, DeserializationContext ctxt, JsonNode nodeSubmodelElement) throws IOException, JsonProcessingException { JsonParser parserReference = parser.getCodec().getFactory().getCodec().treeAsTokens(nodeSubmodelElement); - return deserializer.deserialize(parserReference, ctxt); + return deserializer.deserialize(parserReference, ctxt); } } From 79ff39c880bd0917abd0fae88a6610c338abd28c Mon Sep 17 00:00:00 2001 From: Frank Schnicke Date: Wed, 10 Apr 2024 09:51:00 +0200 Subject: [PATCH 68/73] Prepares 1.0.2 release Signed-off-by: Frank Schnicke --- README.md | 2 +- pom.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1d58f6f4b..787dea56f 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Eclipse AAS4J -> :newspaper: The _`Eclipse AAS4J 1.0.1`_ release is available on [Maven Central Repository](https://oss.sonatype.org/#nexus-search;quick~org.eclipse.digitaltwin.aas4j) and includes the +> :newspaper: The _`Eclipse AAS4J 1.0.2`_ release is available on [Maven Central Repository](https://oss.sonatype.org/#nexus-search;quick~org.eclipse.digitaltwin.aas4j) and includes the > following artifacts implementing the _AAS Specs – Part 1 V3.0 (final)_: `aas4j-dataformat-core`, `aas4j-dataformat-aasx`, > `aas4j-dataformat-xml`, `aas4j-dataformat-json`, `aas4j-dataformat-parent`, and `aas4j-model`. diff --git a/pom.xml b/pom.xml index 5ff3b4e02..1745f03a3 100644 --- a/pom.xml +++ b/pom.xml @@ -38,10 +38,10 @@ 1 - 1 - 0-SNAPSHOT + 0 + 2 ${revision.major}.${revision.minor}.${revision.patch} - 1.1.0-SNAPSHOT + 1.0.2 UTF-8 UTF-8 From 535de9068f10982401bdb8ee31d77a6c3c9872a9 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:38:07 +0200 Subject: [PATCH 69/73] Update pom.xml --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 1745f03a3..5ff3b4e02 100644 --- a/pom.xml +++ b/pom.xml @@ -38,10 +38,10 @@ 1 - 0 - 2 + 1 + 0-SNAPSHOT ${revision.major}.${revision.minor}.${revision.patch} - 1.0.2 + 1.1.0-SNAPSHOT UTF-8 UTF-8 From c30483c303dea04793be3120302b21282fbba7d4 Mon Sep 17 00:00:00 2001 From: Frank Schnicke <77283144+FrankSchnicke@users.noreply.github.com> Date: Thu, 11 Apr 2024 11:46:38 +0200 Subject: [PATCH 70/73] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 787dea56f..fd11e3b66 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ or by integrating the respective modules as dependencies from [Maven Central](ht org.eclipse.digitaltwin.aas4j aas4j-model - 1.0.1 + 1.0.2 ``` From b84ffe3b95d633150832c5d4d84006dbd0a1df3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:36:57 +0000 Subject: [PATCH 71/73] Bump org.apache.maven.plugins:maven-jar-plugin from 3.3.0 to 3.4.0 Bumps [org.apache.maven.plugins:maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.3.0...maven-jar-plugin-3.4.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ff3b4e02..cd28a88af 100644 --- a/pom.xml +++ b/pom.xml @@ -50,7 +50,7 @@ 3.3.1 1.6.0 3.0.1 - 3.3.0 + 3.4.0 3.6.3 3.5.0 3.3.1 From 9fccc12e1b6ada03e29320befef2dc030092eb1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Apr 2024 10:37:00 +0000 Subject: [PATCH 72/73] Bump slf4j.version from 2.0.12 to 2.0.13 Bumps `slf4j.version` from 2.0.12 to 2.0.13. Updates `org.slf4j:slf4j-api` from 2.0.12 to 2.0.13 Updates `org.slf4j:slf4j-simple` from 2.0.12 to 2.0.13 --- updated-dependencies: - dependency-name: org.slf4j:slf4j-api dependency-type: direct:development update-type: version-update:semver-patch - dependency-name: org.slf4j:slf4j-simple dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5ff3b4e02..acf7cfc45 100644 --- a/pom.xml +++ b/pom.xml @@ -74,7 +74,7 @@ 1.1.1 2.7.8 5.2.5 - 2.0.12 + 2.0.13 1.3.2 4.4.1 2.12.1 From 64e6ae4c3aa275f818aad6bcc06e873488bcc361 Mon Sep 17 00:00:00 2001 From: Tobias Kraft Date: Wed, 17 Apr 2024 07:03:17 +0200 Subject: [PATCH 73/73] GH-287: Add JSON support for serializing and deserializing AASX files (#288) * GH-287: Add JSON support for serializing and deserializing AASX files * GH-287: rework after code review --- dataformat-aasx/pom.xml | 4 + .../v3/dataformat/aasx/AASXDeserializer.java | 94 ++++++++++++++++--- .../v3/dataformat/aasx/AASXSerializer.java | 73 +++++++++++--- .../v3/dataformat/aasx/AASXValidator.java | 15 ++- .../dataformat/aasx/MetamodelContentType.java | 24 +++++ .../deserialization/AASXDeserializerTest.java | 16 +++- .../serialization/AASXSerializerTest.java | 41 ++++++-- pom.xml | 5 + 8 files changed, 231 insertions(+), 41 deletions(-) create mode 100644 dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/MetamodelContentType.java diff --git a/dataformat-aasx/pom.xml b/dataformat-aasx/pom.xml index 83054e604..121da2131 100644 --- a/dataformat-aasx/pom.xml +++ b/dataformat-aasx/pom.xml @@ -16,6 +16,10 @@ ${project.groupId} aas4j-dataformat-xml + + ${project.groupId} + aas4j-dataformat-json + ${project.groupId} aas4j-dataformat-core diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java index 234fe9ccb..dc38c5250 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXDeserializer.java @@ -33,6 +33,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.visitor.AssetAdministrationShellElementWalkerVisitor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlDeserializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; @@ -52,7 +53,8 @@ public class AASXDeserializer { private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; - private final XmlDeserializer deserializer; + private final XmlDeserializer xmlDeserializer; + private final JsonDeserializer jsonDeserializer; private Environment environment; private final OPCPackage aasxRoot; @@ -66,20 +68,40 @@ public class AASXDeserializer { */ public AASXDeserializer(InputStream inputStream) throws InvalidFormatException, IOException { aasxRoot = OPCPackage.open(inputStream); - this.deserializer = new XmlDeserializer(); + this.xmlDeserializer = new XmlDeserializer(); + this.jsonDeserializer = new JsonDeserializer(); } /** - * Constructor for custom XML deserialization - * - * @param deserializer a custom deserializer used for deserializing the aas environment + * Constructor for custom deserialization + * + * @param xmlDeserializer a custom XML deserializer used for deserializing the aas environment + * @param inputStream an input stream to an aasx package that can be read with this instance + * @throws InvalidFormatException if aasx package format is invalid + * @throws IOException if creating input streams for aasx fails + */ + public AASXDeserializer(XmlDeserializer xmlDeserializer, + InputStream inputStream) throws InvalidFormatException, IOException { + aasxRoot = OPCPackage.open(inputStream); + this.xmlDeserializer = xmlDeserializer; + this.jsonDeserializer = new JsonDeserializer(); + } + + /** + * Constructor for custom deserialization + * + * @param xmlDeserializer a custom XML deserializer used for deserializing the aas environment + * @param jsonDeserializer a custom JSON deserializer used for deserializing the aas environment * @param inputStream an input stream to an aasx package that can be read with this instance * @throws InvalidFormatException if aasx package format is invalid * @throws IOException if creating input streams for aasx fails */ - public AASXDeserializer(XmlDeserializer deserializer, InputStream inputStream) throws InvalidFormatException, IOException { + public AASXDeserializer(XmlDeserializer xmlDeserializer, + JsonDeserializer jsonDeserializer, + InputStream inputStream) throws InvalidFormatException, IOException { aasxRoot = OPCPackage.open(inputStream); - this.deserializer = deserializer; + this.xmlDeserializer = xmlDeserializer; + this.jsonDeserializer = jsonDeserializer; } /** @@ -96,18 +118,61 @@ public Environment read() throws InvalidFormatException, IOException, Deserializ if (environment != null) { return environment; } - environment = deserializer.read(getXMLResourceString(aasxRoot)); + if (MetamodelContentType.XML.equals(getContentType())) { + environment = xmlDeserializer.read(getResourceString(aasxRoot)); + } + if (MetamodelContentType.JSON.equals(getContentType())) { + environment = jsonDeserializer.read(getResourceString(aasxRoot), Environment.class); + } return environment; } + /** + * Currently XML and JSON are supported for deserializing. + * @return The content type of the metafile + * @throws InvalidFormatException if aasx package format is invalid + * @throws IOException if creating input streams for aasx fails + */ + protected MetamodelContentType getContentType() throws InvalidFormatException, IOException { + MetamodelContentType contentType; + PackagePart packagePart = getPackagePart(aasxRoot); + // We also check for the none official content types "test/xml" and "text/json", which are commonly used + switch (packagePart.getContentType()) { + case "text/xml": + case "application/xml": + contentType = MetamodelContentType.XML; + break; + case "text/json": + case "application/json": + contentType = MetamodelContentType.JSON; + break; + default: + throw new RuntimeException("The following content type is not supported: " + packagePart.getContentType()); + } + return contentType; + } + /** * Return the Content of the xml file in the aasx-package as String - * + * + * @deprecated This method will be replaced by the method {@link AASXDeserializer#getResourceString()}. + * * @throws InvalidFormatException if aasx package format is invalid * @throws IOException if creating input streams for aasx fails */ + @Deprecated public String getXMLResourceString() throws InvalidFormatException, IOException { - return getXMLResourceString(this.aasxRoot); + return getResourceString(this.aasxRoot); + } + + /** + * Return the Content of the xml or json file in the aasx-package as String + * + * @throws InvalidFormatException if aasx package format is invalid + * @throws IOException if creating input streams for aasx fails + */ + public String getResourceString() throws InvalidFormatException, IOException { + return getResourceString(this.aasxRoot); } /** @@ -134,13 +199,14 @@ public List getRelatedFiles() throws InvalidFormatException, IOExc return files; } - private String getXMLResourceString(OPCPackage aasxPackage) throws InvalidFormatException, IOException { + private PackagePart getPackagePart(OPCPackage aasxPackage) throws InvalidFormatException, IOException { PackagePart originPart = getOriginPart(aasxPackage); - PackageRelationshipCollection originRelationships = getXMLDocumentRelation(originPart); + return originPart.getRelatedPart(originRelationships.getRelationship(0)); + } - PackagePart xmlPart = originPart.getRelatedPart(originRelationships.getRelationship(0)); - + private String getResourceString(OPCPackage aasxPackage) throws InvalidFormatException, IOException { + PackagePart xmlPart = getPackagePart(aasxPackage); return readContentFromPackagePart(xmlPart); } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java index 9414df8a9..6f3727e02 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXSerializer.java @@ -34,6 +34,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.internal.AASXUtils; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.internal.visitor.AssetAdministrationShellElementWalkerVisitor; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSerializer; import org.eclipse.digitaltwin.aas4j.v3.model.Environment; import org.eclipse.digitaltwin.aas4j.v3.model.File; @@ -49,6 +50,7 @@ public class AASXSerializer { private static final String MIME_PLAINTXT = "text/plain"; private static final String MIME_XML = "application/xml"; + private static final String MIME_JSON = "application/json"; public static final String OPC_NAMESPACE = "http://schemas.openxmlformats.org/package/2006/relationships"; public static final String AASX_NAMESPACE = "http://admin-shell.io/aasx/relationships"; @@ -59,6 +61,7 @@ public class AASXSerializer { public static final String AASSPEC_RELTYPE = AASX_NAMESPACE + "/aas-spec"; public static final String XML_PATH = "/aasx/xml/content.xml"; + public static final String JSON_PATH = "/aasx/json/content.json"; public static final String AASSUPPL_RELTYPE = AASX_NAMESPACE + "/aas-suppl"; @@ -67,25 +70,39 @@ public class AASXSerializer { private static final Charset DEFAULT_CHARSET = StandardCharsets.UTF_8; private final XmlSerializer xmlSerializer; + private final JsonSerializer jsonSerializer; /** * Default constructor */ public AASXSerializer() { this.xmlSerializer = new XmlSerializer(); + this.jsonSerializer = new JsonSerializer(); } /** - * Constructor with a custom serializer for serializing the aas environment + * Constructor with a custom XML serializer for serializing the aas environment * - * @param xmlSerializer a custom serializer used for serializing the aas environment + * @param xmlSerializer a custom serializer used for serializing the aas environment in XML */ public AASXSerializer(XmlSerializer xmlSerializer) { this.xmlSerializer = xmlSerializer; + this.jsonSerializer = new JsonSerializer(); } /** - * Generates the .aasx file and writes it to the given OutputStream + * Constructor with custom serializers for serializing the aas environment + * + * @param xmlSerializer a custom serializer used for serializing the aas environment in XML + * @param jsonSerializer a custom serializer used for serializing the aas environment in JSON + */ + public AASXSerializer(XmlSerializer xmlSerializer, JsonSerializer jsonSerializer) { + this.xmlSerializer = xmlSerializer; + this.jsonSerializer = jsonSerializer; + } + + /** + * Generates the .aasx file and writes it to the given OutputStream, by using XML as the default content type. * * @param environment the aas environment that will be included in the aasx package as an xml serialization * @param files related inMemory files that belong to the given aas environment @@ -96,25 +113,53 @@ public AASXSerializer(XmlSerializer xmlSerializer) { public void write(Environment environment, Collection files, OutputStream os) throws SerializationException, IOException { + write(environment, files, os, MetamodelContentType.XML); + } + + /** + * Generates the .aasx file and writes it to the given OutputStream + * + * @param environment the aas environment that will be included in the aasx package as an xml serialization + * @param files related inMemory files that belong to the given aas environment + * @param os an output stream for writing the aasx package + * @param contentType the content type for the metamodel serialization + * @throws SerializationException if serializing the given elements fails + * @throws IOException if creating output streams for aasx fails + */ + public void write(Environment environment, Collection files, OutputStream os, MetamodelContentType contentType) + throws SerializationException, IOException { + OPCPackage rootPackage = OPCPackage.create(os); // Create the empty aasx-origin file PackagePart origin = createAASXPart(rootPackage, rootPackage, ORIGIN_PATH, MIME_PLAINTXT, ORIGIN_RELTYPE, ORIGIN_CONTENT.getBytes()); - // Convert the given Metamodels to XML - String xml = xmlSerializer.write(environment); - - // Save the XML to aasx/xml/content.xml - PackagePart xmlPart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(DEFAULT_CHARSET)); + PackagePart packagePart; + switch (contentType) { + case JSON: + // Convert the given Metamodels to JSON + String json = jsonSerializer.write(environment); + // Save the JSON to aasx/json/content.json + packagePart = createAASXPart(rootPackage, origin, JSON_PATH, MIME_JSON, AASSPEC_RELTYPE, json.getBytes(DEFAULT_CHARSET)); + break; + case XML: + // Convert the given Metamodels to XML + String xml = xmlSerializer.write(environment); + // Save the XML to aasx/xml/content.xml + packagePart = createAASXPart(rootPackage, origin, XML_PATH, MIME_XML, AASSPEC_RELTYPE, xml.getBytes(DEFAULT_CHARSET)); + break; + default: + throw new IllegalArgumentException("Unsupported content type: " + contentType); + } environment.getAssetAdministrationShells().stream().filter(aas -> aas.getAssetInformation() != null - && aas.getAssetInformation().getDefaultThumbnail() != null - && aas.getAssetInformation().getDefaultThumbnail().getPath() != null) - .forEach(aas -> createParts(files, - AASXUtils.removeFilePartOfURI(aas.getAssetInformation().getDefaultThumbnail().getPath()), - rootPackage, rootPackage, aas.getAssetInformation().getDefaultThumbnail().getContentType(), AAS_THUMBNAIL_RELTYPE)); - storeFilesInAASX(environment, files, rootPackage, xmlPart); + && aas.getAssetInformation().getDefaultThumbnail() != null + && aas.getAssetInformation().getDefaultThumbnail().getPath() != null) + .forEach(aas -> createParts(files, + AASXUtils.removeFilePartOfURI(aas.getAssetInformation().getDefaultThumbnail().getPath()), + rootPackage, rootPackage, aas.getAssetInformation().getDefaultThumbnail().getContentType(), AAS_THUMBNAIL_RELTYPE)); + storeFilesInAASX(environment, files, rootPackage, packagePart); saveAASX(os, rootPackage); } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXValidator.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXValidator.java index c11a8544c..a92ed8837 100644 --- a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXValidator.java +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/AASXValidator.java @@ -16,6 +16,8 @@ package org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.json.JsonSchemaValidator; import org.eclipse.digitaltwin.aas4j.v3.dataformat.xml.XmlSchemaValidator; import org.xml.sax.SAXException; @@ -29,10 +31,12 @@ public class AASXValidator { private XmlSchemaValidator xmlValidator; + private JsonSchemaValidator jsonValidator; private AASXDeserializer deserializer; public AASXValidator(InputStream is) throws SAXException, IOException, InvalidFormatException { this.xmlValidator = new XmlSchemaValidator(); + this.jsonValidator = new JsonSchemaValidator(); this.deserializer = new AASXDeserializer(is); } @@ -44,8 +48,15 @@ public AASXValidator(InputStream is) throws SAXException, IOException, InvalidFo * @throws InvalidFormatException specified URI is invalid */ public Set validateSchema() throws IOException, InvalidFormatException { - String file = deserializer.getXMLResourceString(); - return xmlValidator.validateSchema(file); + String file = deserializer.getResourceString(); + Set errorMessages = null; + if (MetamodelContentType.XML.equals(deserializer.getContentType())) { + errorMessages = xmlValidator.validateSchema(file); + } + else if (MetamodelContentType.JSON.equals(deserializer.getContentType())) { + errorMessages = jsonValidator.validateSchema(file); + } + return errorMessages; } } diff --git a/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/MetamodelContentType.java b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/MetamodelContentType.java new file mode 100644 index 000000000..f6b1ccb4a --- /dev/null +++ b/dataformat-aasx/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/MetamodelContentType.java @@ -0,0 +1,24 @@ +/* + * Copyright 2024 the original author or authors. + * + * 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.eclipse.digitaltwin.aas4j.v3.dataformat.aasx; + +/** + * Supported ContentType's for serializing and deserializing Metamodels. + */ +public enum MetamodelContentType { + + JSON, + XML + +} diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java index 1b01f8772..84ab7eb7f 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/deserialization/AASXDeserializerTest.java @@ -34,6 +34,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXDeserializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.MetamodelContentType; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.DeserializationException; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; @@ -65,8 +66,8 @@ public void roundTrip() throws SerializationException, IOException, InvalidForma fileList.add(inMemoryFile); fileList.add(inMemoryFileThumbnail); - java.io.File file = tempFolder.newFile("output.aasx"); - + // check round trip with XML content + java.io.File file = tempFolder.newFile("output-xml.aasx"); new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file)); InputStream in = new FileInputStream(file); @@ -74,8 +75,17 @@ public void roundTrip() throws SerializationException, IOException, InvalidForma assertEquals(AASSimple.createEnvironment(), deserializer.read()); assertTrue(CollectionUtils.isEqualCollection(fileList, deserializer.getRelatedFiles())); - } + // check round trip with JSON content + file = tempFolder.newFile("output-json.aasx"); + new AASXSerializer().write(AASSimple.createEnvironment(), fileList, new FileOutputStream(file), MetamodelContentType.JSON); + + in = new FileInputStream(file); + deserializer = new AASXDeserializer(in); + + assertEquals(AASSimple.createEnvironment(), deserializer.read()); + assertTrue(CollectionUtils.isEqualCollection(fileList, deserializer.getRelatedFiles())); + } @Test public void relatedFilesAreOnlyResolvedIfWithinAASX() throws IOException, SerializationException, InvalidFormatException, DeserializationException { Submodel fileSm = new DefaultSubmodel.Builder().id("doesNotMatter").submodelElements(createFileSubmodelElements()).build(); diff --git a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java index 2e258efdf..b5f86d6ce 100644 --- a/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java +++ b/dataformat-aasx/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/aasx/serialization/AASXSerializerTest.java @@ -18,6 +18,7 @@ import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer; import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile; +import org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.MetamodelContentType; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASFull; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.AASSimple; import org.eclipse.digitaltwin.aas4j.v3.dataformat.core.SerializationException; @@ -42,6 +43,7 @@ public class AASXSerializerTest { private static final String RELS_PATH_URI = "file:///_rels/.rels"; private static final String XML_PATH_URI = "file:///aasx/xml/content.xml"; + private static final String JSON_PATH_URI = "file:///aasx/json/content.json"; private static final String ORIGIN_PATH_URI = "file:///aasx/aasx-origin"; private List fileList = new ArrayList<>(); @@ -56,10 +58,14 @@ public void testBuildAASXFull() throws IOException, TransformerException, Parser // This stream keeps the output of the AASXFactory only in memory ByteArrayOutputStream out = new ByteArrayOutputStream(); - - new AASXSerializer().write(AASFull.createEnvironment(), fileList, out); - - validateAASX(out, List.of(AASXSerializerTest::assertRootXml)); + // validate AASX with XML content + new AASXSerializer().write(AASFull.createEnvironment(), fileList, out, MetamodelContentType.XML); + validateAASX(out, XML_PATH_URI, List.of(AASXSerializerTest::assertRootXml)); + + out = new ByteArrayOutputStream(); + // validate AASX with JSON content + new AASXSerializer().write(AASFull.createEnvironment(), fileList, out, MetamodelContentType.JSON); + validateAASX(out, JSON_PATH_URI, List.of(AASXSerializerTest::assertRootJson)); } @Test @@ -75,13 +81,17 @@ public void testBuildAASXSimple() throws IOException, TransformerException, Pars // This stream keeps the output of the AASXFactory only in memory ByteArrayOutputStream out = new ByteArrayOutputStream(); - + // validate AASX with XML content new AASXSerializer().write(AASSimple.createEnvironment(), fileList, out); + validateAASX(out, XML_PATH_URI, List.of(AASXSerializerTest::assertRootXml, AASXSerializerTest::assertThumbnailReference)); - validateAASX(out, List.of(AASXSerializerTest::assertRootXml, AASXSerializerTest::assertThumbnailReference)); + out = new ByteArrayOutputStream(); + // validate AASX with JSON content + new AASXSerializer().write(AASSimple.createEnvironment(), fileList, out, MetamodelContentType.JSON); + validateAASX(out, JSON_PATH_URI, List.of(AASXSerializerTest::assertRootJson, AASXSerializerTest::assertThumbnailReference)); } - private void validateAASX(ByteArrayOutputStream byteStream, List> fileValidators) { + private void validateAASX(ByteArrayOutputStream byteStream, String contentFilePath, List> fileValidators) { ZipInputStream in = new ZipInputStream(new ByteArrayInputStream(byteStream.toByteArray())); ZipEntry zipEntry; @@ -100,7 +110,7 @@ private void validateAASX(ByteArrayOutputStream byteStream, Listaas4j-dataformat-xml ${revision} + + ${project.groupId} + aas4j-dataformat-json + ${revision} + ${project.groupId} aas4j-model