Changes between Version 140 and Version 141 of j2p
- Timestamp:
- 10/08/24 16:33:10 (6 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
j2p
v140 v141 130 130 ===== Workaround 131 131 If some particular inner classes, particularly constants, are used in very specific translators, these translators may opt to attempt to recognise these and process them separately (thus avoiding calling the translator for them). One example is the JsonDeserializer (jackson-t package) that recognises use of "com.fasterxml.jackson.databind.JsonDeserializer.None". 132 133 ==== Enum 134 Enum classes are translated to normal Python classes. For instance if you have a class MyEnum and it has items P and Q, we assume on the python side that a class MyEnum is there with static public fields P and Q. As usual the translator initializes P and Q in the {{{_static_init}} method. This approach matches with the traditional way python supported enumerations, for example {{{math.pi}}} directly delivers the value of pi, not some placeholder. 135 136 This approach ignores the more recent Python Enum class. This new approach is incompatible with the traditional approach, it gives an extra layer of indirection, it does not allow the custom constructors that we need, it is very complex, and all this complicates our translation job. 132 137 133 138 === Auto Boxing