Skip to content
This repository was archived by the owner on Feb 15, 2024. It is now read-only.

Feature/aml deserializer#11

Merged
sebbader merged 20 commits intomainfrom
feature/aml-deserializer
Aug 27, 2021
Merged

Feature/aml deserializer#11
sebbader merged 20 commits intomainfrom
feature/aml-deserializer

Conversation

@br-iosb
Copy link
Copy Markdown
Contributor

@br-iosb br-iosb commented Aug 27, 2021

Implementation from Jens' fork.
Small fix for Eclipse IDE.

mjacoby and others added 20 commits August 19, 2021 14:50
   * submodels are collected and added to AAS
   * LangString, ReferenceElement, RelationshipElement are properly handled
   * refactoring utility methods to handle custom subtypes (e.g. when cloning or creating new references)
   * updated MappingProvider to also accept classes with remaining generic type
   * submodels are collected and added to AAS
   * LangString, ReferenceElement, RelationshipElement are properly handled
   * refactoring utility methods to handle custom subtypes (e.g. when cloning or creating new references)
   * updated MappingProvider to also accept classes with remaining generic type
…hell-io/java-serializer into feature/aml-deserializer

# Conflicts:
#	dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/deserialization/Aml2AasMapper.java
…fication.

Adapt FullExample and some bugfixing
accepted merge request Feature/aml deserializer
@sebbader
Copy link
Copy Markdown
Contributor

@akiskips here is the PR.

Copy link
Copy Markdown

@akiskips akiskips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My comments are more of informative nature

.build());
return mapper.map(aml);
} catch (JAXBException ex) {
throw new DeserializationException("error deserializing AssetAdministrationShellEnvironment", ex);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it not be error deserializing AML file?

context.setDocumentInfo(AmlDocumentInfo.fromFile(aml));
Object result = context.getMappingProvider().getMapper(AssetAdministrationShellEnvironment.class).map(parser, context);
AssetAdministrationShellEnvironment result = context.map(AssetAdministrationShellEnvironment.class, parser);
parser.resolveIdsToReferences(result);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this call modify the AASEnvironment object?

//not possible with AML due to the mapping specifications

//remove asset administration shells with no submodels
adaptAssetAdministrationShells(expected);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this required? should the submodels that are not referenced from an AAShell just be ignored?

assertEquals(expected.getAssetAdministrationShells(), actual.getAssetAdministrationShells());
}

private void adaptAssetAdministrationShells(AssetAdministrationShellEnvironment env){
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the test AASEnv should be revised to contain no such invalid cases.
Adapting an existing test object makes the test class much more complex

@sebbader sebbader merged commit 529d659 into main Aug 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants