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

Commit d30ff42

Browse files
committed
Bugifx AML serializer: now serializes all properties of View
1 parent d3996a6 commit d30ff42

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

dataformat-aml/src/main/java/io/adminshell/aas/v3/dataformat/aml/serialization/mappers/ViewMapper.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ public void map(View view, AmlGenerator generator, MappingContext context) throw
3939
if (view == null) {
4040
return;
4141
}
42-
InternalElementType.Builder builder = InternalElementType.builder();
43-
builder = builder.withName(context.getClassNamingStrategy().getName(
44-
view.getClass(),
45-
view,
46-
null))
47-
.withRoleRequirements(generator.roleRequirement(ReflectionHelper.getModelType(view.getClass())));
42+
InternalElementType.Builder builder = toInternalElement(view, generator, context);
4843
generator.with(builder).appendReferenceTargetInterfaceIfRequired(view, context);
4944
for (Reference reference : view.getContainedElements()) {
5045
Referable referable = AasUtils.resolve(reference, context.getEnvironment());

dataformat-aml/src/test/resources/test_demo_full_example.aml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,10 +1183,18 @@
11831183
</Attribute>
11841184
</Attribute>
11851185
<InternalElement ID="74" Name="ExampleView">
1186+
<Attribute Name="idShort">
1187+
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">ExampleView</Value>
1188+
<RefSemantic CorrespondingAttributePath="AAS:Referable/idShort"/>
1189+
</Attribute>
11861190
<InternalElement ID="72" Name="TestSubmodel" RefBaseSystemUnitPath="73"/>
11871191
<RoleRequirements RefBaseRoleClassPath="AssetAdministrationShellRoleClassLib/View"/>
11881192
</InternalElement>
11891193
<InternalElement ID="75" Name="ExampleView2">
1194+
<Attribute Name="idShort">
1195+
<Value xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xsd:string">ExampleView2</Value>
1196+
<RefSemantic CorrespondingAttributePath="AAS:Referable/idShort"/>
1197+
</Attribute>
11901198
<RoleRequirements RefBaseRoleClassPath="AssetAdministrationShellRoleClassLib/View"/>
11911199
</InternalElement>
11921200
<InternalElement ID="73" Name="TestSubmodel">

0 commit comments

Comments
 (0)