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

Commit 3739c76

Browse files
committed
refactored static string literal
1 parent 483102e commit 3739c76

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/mappers/AssetAdministrationShellMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private void mapAsset() {
5454
}
5555

5656
private void mapSubmodels() {
57-
UAObject smFolder = createReferenceList(AAS_SUBMODELREFERENCES_LIST);
57+
UAObject smFolder = createReferenceList(AAS_SUBMODELREFERENCES_LIST_BROWSENAME);
5858
List<io.adminshell.aas.v3.model.Reference> submodels = source.getSubmodels();
5959
for (int i = 0; i < submodels.size(); i++) {
6060
io.adminshell.aas.v3.model.Reference reference = submodels.get(i);
@@ -67,7 +67,7 @@ private void mapSubmodels() {
6767
private void mapDerivedFrom() {
6868
io.adminshell.aas.v3.model.Reference derivedFrom = source.getDerivedFrom();
6969
if (derivedFrom != null) {
70-
UAObject uaDerivedFrom = new ReferenceMapper(derivedFrom, ctx, AAS_DERIVEDFROM).map();
70+
UAObject uaDerivedFrom = new ReferenceMapper(derivedFrom, ctx, AAS_DERIVEDFROM_BROWSENAME).map();
7171
attachAsComponent(target, uaDerivedFrom);
7272
}
7373
}

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/mappers/ReferenceMapper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ protected UAObject createTargetObject() {
5959
protected void mapAndAttachChildren() {
6060
UAVariable UAKeyVariable = UAVariable.builder().withNodeId(ctx.newModelNodeIdAsString())
6161
.withDataType(I4AASIdentifier.AASKeyDataType.getName()).withValueRank(1).withArrayDimensions("0")
62-
.withAccessLevel(3L).withDisplayName(createLocalizedText("Keys"))
63-
.withBrowseName(createI4AASBrowseName("Keys")).build();
62+
.withAccessLevel(3L).withDisplayName(createLocalizedText(REFERENCE_KEYS_BROWSENAME))
63+
.withBrowseName(createI4AASBrowseName(REFERENCE_KEYS_BROWSENAME)).build();
6464
addTypeReferenceFor(UAKeyVariable, UaIdentifier.PropertyType);
6565
attachAsProperty(target, UAKeyVariable);
6666
addToNodeset(UAKeyVariable);

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/mappers/utils/I4AASConstants.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ public interface I4AASConstants {
4141

4242
public static final String DATASPECIFICATION_BROWSENAME = "DataSpecification";
4343

44-
public static final String AAS_SUBMODELREFERENCES_LIST = "Submodel";
45-
public static final String AAS_DERIVEDFROM = "DerivedFrom";
44+
public static final String AAS_SUBMODELREFERENCES_LIST_BROWSENAME = "Submodel";
45+
public static final String AAS_DERIVEDFROM_BROWSENAME = "DerivedFrom";
46+
47+
public static final String REFERENCE_KEYS_BROWSENAME = "Keys";
4648

4749

4850
}

dataformat-uanodeset/src/main/java/io/adminshell/aas/v3/dataformat/i4aas/parsers/AssetAdministrationShellParser.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,9 @@ protected AssetAdministrationShell createTargetObject() {
4040
protected void parseAndAttachChildren() {
4141
super.parseAndAttachChildren();
4242

43-
source.getI4AASComponent(AAS_SUBMODELREFERENCES_LIST).ifPresent(uanode -> {
43+
source.getI4AASComponent(AAS_SUBMODELREFERENCES_LIST_BROWSENAME).ifPresent(uanode -> {
4444
uanode.getComponentsOfType(I4AASIdentifier.AASReferenceType).forEach(uaref -> {
45-
uaref.getI4AASProperty("Keys").ifPresent(uaKeys -> {
45+
uaref.getI4AASProperty(REFERENCE_KEYS_BROWSENAME).ifPresent(uaKeys -> {
4646
Reference parse = new ReferenceParser(uaKeys, ctx).parse();
4747
target.getSubmodels().add(parse);
4848
});

dataformat-uanodeset/src/test/java/io/adminshell/aas/v3/dataformat/i4aas/TestUANodeset.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
import org.opcfoundation.ua._2011._03.uanodeset.UANodeSet;
2323

24-
import io.adminshell.aas.v3.dataformat.SerializationException;
25-
import io.adminshell.aas.v3.dataformat.i4aas.UANodeSetUnmarshaller;
2624
import io.adminshell.aas.v3.dataformat.i4aas.parsers.ParserContextTest;
2725

2826
public class TestUANodeset {

0 commit comments

Comments
 (0)