Details
-
Improvement
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
0.3
-
None
-
None
Description
Metadata objects can specified gco:uuid, xlink:href and similar attributes by implementing the org.apache.sis.xml.IdentifiedObject interface. However we can not do that for JDK final classes like Integer and String. This is a problem similar to the one described in SIS-115 (NilReason for primitive types) and may be solved in a similar way. We have not yet solved this problem because the use case for gco:uuid or xlink:href attributes on elements as small as Integer or String are unclear at this stage.
If nevertheless the above-cited support for identifiers is needed, then we could proceed as below:
- In org.apache.sis.internal.jaxb.gco.PropertyType, complete the PropertyType(BoundType value, boolean mayBeNil) constructor in order to check for XLink and UUID in addition to NilReason.
- Search usages of the above constructor. Conditions like value.intValue() == 0 may need to be removed.
- We may need to provide a special implementation of org.apache.sis.xml.IdentifierMap which delegate its work to the org.apache.sis.internal.jaxb.PrimitiveTypeProperties static methods.
- We may need to provide some static method (location to be determined) returning an IdentifierMap for a given Object, something similar to what we currently have in NilReason.forObject(Object).