Description
The ISO 19115 specification defines some properties as conditional. Most of the time, they are a set of mutually exclusive properties. For example the MD_Resolution class defines two properties: equivalentScale and distance, both of them flagged as conditional. The specification said: "Only one of equivalent scale and ground sample distance may be provided".
Currently those two properties are defined in separated fields and could be defined together. We could replace the two private fields by a single private Object field, and use instanceof check in getter methods. The advantage would be:
- Automatically gain enforcement of the ISO specification.
- Save a little bit of memory space for metadata instances.
One consequence is that if an XML document contains two properties, the last property would silently overwrite the previous one at unmarshalling time. To prevent such thing to happen silently, we would need the APPENDABLE mode proposed in SIS-81.