Changes between Version 108 and Version 109 of j2p
- Timestamp:
- 07/25/24 17:16:04 (4 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
j2p
v108 v109 113 113 Inner classes (classes inside classes) have very limited support. 114 114 115 When an inner class translator is needed, eg A$B where B is an inner class of A, the translator searches for a translator for class A/B where A is used as a *directory*. If it is found, then that translator B is used. 115 When an inner class translator is needed, eg p.A$B where B is an inner class of A, the translator searches for a translator for class p.a/B where p/a is used as a *directory* and is the lower case version of A. If it is found, then that translator B is used. 116 117 Note that that translated class will be in package p.a, rather than inside class p.A. Therefore this mechanism, has limited use in practice. 116 118 117 119 Otherwise, no support is available. This includes anonymous inner classes. You can not import, call or use inner classes. This is for many reasons but the brief summary: … … 125 127 * For the non-static inner class: pass the enclosing class as argument to the child class constructor. You may have to use more tricks to get around cyclic dependencies. 126 128 127 ===== Exception to inner classes128 There are a very few exceptions to the 'no inner classes' rule. 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. One example is the JsonDeserializer (jackson-t package) that recognises use of "com.fasterxml.jackson.databind.JsonDeserializer.None". Check the documentation of the translators for details.129 ===== Workaround 130 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". 129 131 130 132 === Auto Boxing