unitsofmeasurement / indriya

JSR 385 - Reference Implementation
Other
118 stars 40 forks source link

introduces EncodingUtil to support JavaBeans XML serialization #266

Closed andi-huber closed 4 years ago

andi-huber commented 4 years ago

in reference to #264:

Most of the new code is for testing.

The encoding/decoding code is simple and bullet-proof (does not require formatting/parsing), with the trade-off, that the generated serialized XML form is not human readable. That is, the serialized XML content is binary data converted to base64.

(also improves java-doc on NumberSystem)


This change is Reviewable

keilw commented 4 years ago

@andi-huber Sorry but this is not acceptable: ERROR] /indriya/src/main/java/tech/units/indriya/quantity/EncodingUtil.java:[35,12] package java.beans is not visible [ERROR] (package java.beans is declared in module java.desktop, but module tech.units.indriya does not read it) [ERROR] /indriya/src/main/java/tech/units/indriya/quantity/EncodingUtil.java:[98,9] method does not override or implement a method from a supertype [ERROR] -> [Help 1] There must be no dependency on java.desktop in the RI, that is unnecessary, we have to define this in a different place, e.g. uom-client.

andi-huber commented 4 years ago

No worries. Thought this could be a candidate for having at least one serialization solution for Quantities within RI, not realizing the downsides of java.beans when going beyond jdk-8.