@@ -110,25 +110,25 @@ public class AspectModelAASVisitor implements AspectVisitor<Environment, Context
110
110
*/
111
111
private static final Map <Resource , DataTypeIEC61360 > TYPE_MAP =
112
112
ImmutableMap .<Resource , DataTypeIEC61360 > builder ()
113
- .put ( XSD .xboolean , DataTypeIEC61360 .BOOLEAN )
114
- .put ( XSD .decimal , DataTypeIEC61360 .INTEGER_MEASURE )
115
- .put ( XSD .integer , DataTypeIEC61360 .INTEGER_MEASURE )
116
- .put ( XSD .xfloat , DataTypeIEC61360 .REAL_MEASURE )
117
- .put ( XSD .xdouble , DataTypeIEC61360 .REAL_MEASURE )
118
- .put ( XSD .xbyte , DataTypeIEC61360 .INTEGER_COUNT )
119
- .put ( XSD .xshort , DataTypeIEC61360 .INTEGER_COUNT )
120
- .put ( XSD .xint , DataTypeIEC61360 .INTEGER_COUNT )
121
- .put ( XSD .xlong , DataTypeIEC61360 .INTEGER_COUNT )
122
- .put ( XSD .unsignedByte , DataTypeIEC61360 .INTEGER_COUNT )
123
- .put ( XSD .unsignedShort , DataTypeIEC61360 .INTEGER_COUNT )
124
- .put ( XSD .unsignedInt , DataTypeIEC61360 .INTEGER_COUNT )
125
- .put ( XSD .unsignedLong , DataTypeIEC61360 .INTEGER_COUNT )
126
- .put ( XSD .positiveInteger , DataTypeIEC61360 .INTEGER_COUNT )
127
- .put ( XSD .nonPositiveInteger , DataTypeIEC61360 .INTEGER_COUNT )
128
- .put ( XSD .negativeInteger , DataTypeIEC61360 .INTEGER_COUNT )
129
- .put ( XSD .nonNegativeInteger , DataTypeIEC61360 .INTEGER_COUNT )
130
- .put ( RDF .langString , DataTypeIEC61360 .STRING )
131
- .build ();
113
+ .put ( XSD .xboolean , DataTypeIEC61360 .BOOLEAN )
114
+ .put ( XSD .decimal , DataTypeIEC61360 .INTEGER_MEASURE )
115
+ .put ( XSD .integer , DataTypeIEC61360 .INTEGER_MEASURE )
116
+ .put ( XSD .xfloat , DataTypeIEC61360 .REAL_MEASURE )
117
+ .put ( XSD .xdouble , DataTypeIEC61360 .REAL_MEASURE )
118
+ .put ( XSD .xbyte , DataTypeIEC61360 .INTEGER_COUNT )
119
+ .put ( XSD .xshort , DataTypeIEC61360 .INTEGER_COUNT )
120
+ .put ( XSD .xint , DataTypeIEC61360 .INTEGER_COUNT )
121
+ .put ( XSD .xlong , DataTypeIEC61360 .INTEGER_COUNT )
122
+ .put ( XSD .unsignedByte , DataTypeIEC61360 .INTEGER_COUNT )
123
+ .put ( XSD .unsignedShort , DataTypeIEC61360 .INTEGER_COUNT )
124
+ .put ( XSD .unsignedInt , DataTypeIEC61360 .INTEGER_COUNT )
125
+ .put ( XSD .unsignedLong , DataTypeIEC61360 .INTEGER_COUNT )
126
+ .put ( XSD .positiveInteger , DataTypeIEC61360 .INTEGER_COUNT )
127
+ .put ( XSD .nonPositiveInteger , DataTypeIEC61360 .INTEGER_COUNT )
128
+ .put ( XSD .negativeInteger , DataTypeIEC61360 .INTEGER_COUNT )
129
+ .put ( XSD .nonNegativeInteger , DataTypeIEC61360 .INTEGER_COUNT )
130
+ .put ( RDF .langString , DataTypeIEC61360 .STRING )
131
+ .build ();
132
132
133
133
private interface SubmodelElementBuilder {
134
134
SubmodelElement build ( Property property );
@@ -150,9 +150,9 @@ public AspectModelAASVisitor withPropertyMapper( final PropertyMapper propertyMa
150
150
151
151
protected <T extends SubmodelElement > PropertyMapper <T > findPropertyMapper ( final Property property ) {
152
152
return (PropertyMapper <T >) getCustomPropertyMappers ().stream ()
153
- .filter ( mapper -> mapper .canHandle ( property ) )
154
- .findAny ()
155
- .orElse ( DEFAULT_MAPPER );
153
+ .filter ( mapper -> mapper .canHandle ( property ) )
154
+ .findAny ()
155
+ .orElse ( DEFAULT_MAPPER );
156
156
}
157
157
158
158
protected List <PropertyMapper <?>> getCustomPropertyMappers () {
@@ -212,9 +212,9 @@ private List<SubmodelElement> visitProperties(
212
212
213
213
private SubmodelElement map ( final Property property , final Context context ) {
214
214
final Supplier <SubmodelElement > defaultResultForProperty = () -> context .getSubmodel ().getSubmodelElements ().stream ()
215
- .filter ( i -> i .getIdShort ().equals ( property .getName () ) )
216
- .findFirst ()
217
- .orElse ( new DefaultProperty .Builder ().build () );
215
+ .filter ( i -> i .getIdShort ().equals ( property .getName () ) )
216
+ .findFirst ()
217
+ .orElse ( new DefaultProperty .Builder ().build () );
218
218
if ( recursiveProperty .contains ( property ) ) {
219
219
// The guard checks for recursion in properties. If a recursion happens, the respective
220
220
// property will be excluded from generation.
@@ -284,12 +284,12 @@ private Operation map( final io.openmanufacturing.sds.metamodel.Operation operat
284
284
.idShort ( operation .getName () )
285
285
.inputVariables (
286
286
operation .getInput ().stream ()
287
- .map ( i -> mapOperationVariable ( i , context ) )
288
- .collect ( Collectors .toList () ) )
287
+ .map ( i -> mapOperationVariable ( i , context ) )
288
+ .collect ( Collectors .toList () ) )
289
289
.outputVariables (
290
290
operation .getOutput ().stream ()
291
- .map ( i -> mapOperationVariable ( i , context ) )
292
- .collect ( Collectors .toList () ) )
291
+ .map ( i -> mapOperationVariable ( i , context ) )
292
+ .collect ( Collectors .toList () ) )
293
293
.build ();
294
294
}
295
295
@@ -363,9 +363,9 @@ private EmbeddedDataSpecification extractEmbeddedDataSpecification( final Aspect
363
363
364
364
private DataSpecificationIEC61360 extractDataSpecificationContent ( final Property property ) {
365
365
final List <LangString > definitions = property .getCharacteristic ().stream ().flatMap ( characteristic ->
366
- characteristic .getDescriptions ().stream () )
367
- .map ( langStringMapper ::map )
368
- .collect ( Collectors .toList () );
366
+ characteristic .getDescriptions ().stream () )
367
+ .map ( langStringMapper ::map )
368
+ .collect ( Collectors .toList () );
369
369
370
370
return new DefaultDataSpecificationIEC61360 .Builder ()
371
371
.definition ( definitions )
@@ -473,23 +473,23 @@ private <T extends Collection> Environment visitCollectionProperty(
473
473
private <T extends Collection > List <SubmodelElement > getValues ( final T collection , final Property property , final Context context ,
474
474
final ArrayNode arrayNode ) {
475
475
return collection .getDataType ()
476
- .map ( dataType -> {
477
- if ( Scalar .class .isAssignableFrom ( dataType .getClass () ) ) {
478
- return List .of ( (SubmodelElement ) new DefaultBlob .Builder ().value ( StreamSupport .stream ( arrayNode .spliterator (), false )
479
- .map ( JsonNode ::asText )
480
- .collect ( Collectors .joining ( "," ) )
481
- .getBytes ( StandardCharsets .UTF_8 ) ).build () );
482
- } else {
483
- final var values = StreamSupport .stream ( arrayNode .spliterator (), false )
484
- .map ( n -> {
485
- context .iterate ( property );
486
- return decideOnMapping ( property , context );
487
- } )
488
- .toList ();
489
- context .finishIteration ( property );
490
- return values ;
491
- }
492
- } ).orElseGet ( () -> List .of () );
476
+ .map ( dataType -> {
477
+ if ( Scalar .class .isAssignableFrom ( dataType .getClass () ) ) {
478
+ return List .of ( (SubmodelElement ) new DefaultBlob .Builder ().value ( StreamSupport .stream ( arrayNode .spliterator (), false )
479
+ .map ( JsonNode ::asText )
480
+ .collect ( Collectors .joining ( "," ) )
481
+ .getBytes ( StandardCharsets .UTF_8 ) ).build () );
482
+ } else {
483
+ final var values = StreamSupport .stream ( arrayNode .spliterator (), false )
484
+ .map ( n -> {
485
+ context .iterate ( property );
486
+ return decideOnMapping ( property , context );
487
+ } )
488
+ .toList ();
489
+ context .finishIteration ( property );
490
+ return values ;
491
+ }
492
+ } ).orElseGet ( () -> List .of () );
493
493
}
494
494
495
495
// Either will be mapped by adding both the left and the right side to the SubmodelTemplate.
@@ -603,13 +603,13 @@ public Environment visitEnumeration(
603
603
dataSpecificationContent .setDataType ( mapIEC61360DataType ( enumeration ) );
604
604
final List <ValueReferencePair > valueReferencePairs =
605
605
enumeration .getValues ().stream ()
606
- .map (
607
- x ->
608
- new DefaultValueReferencePair .Builder ()
609
- .value ( x .toString () )
610
- .valueId ( buildReferenceToEnumValue ( enumeration , x ) )
611
- .build () )
612
- .collect ( Collectors .toList () );
606
+ .map (
607
+ x ->
608
+ new DefaultValueReferencePair .Builder ()
609
+ .value ( x .toString () )
610
+ .valueId ( buildReferenceToEnumValue ( enumeration , x ) )
611
+ .build () )
612
+ .collect ( Collectors .toList () );
613
613
614
614
final ValueList valueList =
615
615
new DefaultValueList .Builder ().valueReferencePairs ( valueReferencePairs ).build ();
0 commit comments