eclipse-aas4j / aas4j

Eclipse AAS Model for Java
Apache License 2.0
38 stars 26 forks source link

[Enhancement] Serializer / Deserializer (AASX) should have some warning handler (instead of just logging) #112

Open in-fke opened 1 year ago

in-fke commented 1 year ago

This may not just apply to AASXSerializer / AASXDeserializer but to others as well (which should share a common interface). Also, this may have some impact on all sorts of classes, e.g. ReflectionHelper. IS: ReflectionHelper et al issue logger WARN Sould: Caller should be able to pass some optional lambda (e.g. a consumer for warnings), to catch warnings programmatically.

Example output from (modified) routine similar to org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.serialization.AASXSerializerTest, but with 1.0.0-milestone-03 (main branch does not produce the first two warnings, and the last warning is due to the modification of our test).

[main] WARN org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper - could not auto-resolve target class for mixin 'DataSpecificationPhysicalUnitMixin'
[main] WARN org.eclipse.digitaltwin.aas4j.v3.dataformat.core.util.ReflectionHelper - could not auto-resolve target class for mixin 'LangStringMixin'
[main] WARN org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.AASXSerializer - Could not add File '/aasx/OperatingManual.pdf'. It was not contained in given InMemoryFiles.
twebermartins commented 1 year ago

Thanks for pointing this out! We will have a look at it.