|
While we do have AnnotationAware interface, the solution is not complete, as we have leaf-equivalents which cannot have this interface attached:
- unrestricted leaf types (which boil down to final java.lang objects)
- restricted leaf types, i.e. TypeObjects (which boil down to java.lang.Enums) and which would need MDSAL-90/
MDSAL-440 resolved to allow AnnotationAware subclassing
- leaf-lists of the above
An obvious solution would be to generate metadataFoo() counterparts to getFoo() methods, but this feels like an overkill. It also does not quite align with leaf-lists, as we will end up disconnecting related data into two Lists – and we'd need empty metadata instances for leaf-list entries which do not have metadata (which is a minor annoyance).
The secondary problem is transporting metadata across builders and similar – if the metadata object is detached, copy builders break down. This is probably okay, as metadata is not data and hence it probably should not be automatically transportable.
|