Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newly generated V3.0.1 Classes and toString() Method #159

Conversation

sebbader-sap
Copy link
Contributor

@sebbader-sap sebbader-sap commented Aug 21, 2023

This PR contains the model classes as generated by the latest V3.0.1 RDF schema files.
Additionally,

  • a new toString() method was added to the default implementations, and
  • the usage of default values in the constructors has been readied, e.g., for DefaultSubmodel: this.kind = ModellingKind.INSTANCE;

@sebbader-sap
Copy link
Contributor Author

sebbader-sap commented Aug 21, 2023

solves #127, #96, and #20 / #145

@sebbader-sap
Copy link
Contributor Author

I just realise that I have re-added the "dataformat-rdf" and "validator". Will remove them before merging.

"DefaultBlob (" + "value=%s,"
+ "contentType=%s,"
+ ")",
this.value, this.contentType);
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably would be nice if we could use Arrays.toString(this.value) here as the value is a byte[] and converting it to String might "change", or better "hide", its original value.
For example, depending on the encoding, two different byte[] value might produce the same output, e.g. [-1, -2, -3] and [-17, -65, -67, -17, -65, -67, -17, -65, -67] both produce the output [B@57fa26b7 when serialized this way.

When using Arrays.toString(...) the values would be printed as arrays and not be converted to string and therefore would produce different output as expected.

@mjacoby
Copy link
Contributor

mjacoby commented Sep 1, 2023

Waiting for the following issues to be addressed before starting review

emildinchev and others added 17 commits September 4, 2023 14:28
…ostring

# Conflicts:
#	dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/core/util/MostSpecificClassComparator.java
#	dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/Mapper.java
#	dataformat-core/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/mapping/MappingException.java
#	dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonDeserializer.java
#	dataformat-json/src/main/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializer.java
#	dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableDeserializerTest.java
#	dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonReferableSerializerTest.java
#	dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/JsonSerializerTest.java
#	dataformat-json/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/json/util/Examples.java
#	dataformat-xml/src/test/java/org/eclipse/digitaltwin/aas4j/v3/dataformat/xml/XmlSerializerTest.java
#	model/pom.xml
@twebermartins
Copy link
Contributor

@arnoweiss would it be possible for you to review this PR?

@arnoweiss
Copy link
Contributor

Builds, tests updated, looks good to me.
Please resolve the TODO.

@sebbader-sap
Copy link
Contributor Author

Builds, tests updated, looks good to me. Please resolve the TODO.

This is not possible, or at least I don't know how, other than doing it manually.

Copy link
Contributor

@arnoweiss arnoweiss left a comment

Choose a reason for hiding this comment

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

all good

.annotationIntrospector(new ReflectionAnnotationIntrospector())
.build();
ReflectionHelper.JSON_MIXINS.entrySet().forEach(x -> mapper.addMixIn(x.getKey(), x.getValue()));
}

protected SimpleModule buildCustomSerializerModule() {
SimpleModule module = new SimpleModule();
// TODO: module.addSerializer(EmbeddedDataSpecification.class, new EmbeddedDataSpecificationSerializer());
Copy link
Contributor

Choose a reason for hiding this comment

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

either remove or implement

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@sebbader-sap sebbader-sap merged commit d0ba1dd into eclipse-aas4j:main Nov 2, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants