You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@sis.apache.org by "Martin Desruisseaux (Jira)" <ji...@apache.org> on 2022/12/07 18:49:00 UTC
[jira] [Closed] (SIS-286) Add @XmlSchemaType annotations where appropriate
[ https://issues.apache.org/jira/browse/SIS-286?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Desruisseaux closed SIS-286.
-----------------------------------
> Add @XmlSchemaType annotations where appropriate
> ------------------------------------------------
>
> Key: SIS-286
> URL: https://issues.apache.org/jira/browse/SIS-286
> Project: Spatial Information Systems
> Issue Type: Improvement
> Components: Metadata, Referencing
> Affects Versions: 0.6
> Reporter: Martin Desruisseaux
> Assignee: Martin Desruisseaux
> Priority: Minor
> Fix For: 0.7
>
>
> The XML type of metadata and CRS properties could be declared more accurately by adding the {{XmlShemaType}} annotation where appropriate. Examples:
> {code:java}
> @XmlSchemaType(name = "positiveInteger")
> private Integer integerValue;
> @XmlSchemaType(name = "anyURI")
> private String valueFile;
> @XmlSchemaType(name="date")
> public XMLGregorianCalendar date;
> {code}
> The easiest way to find where this annotation is missing is to search for the {{"xs:}} string in XSD files. Some data types in use are: {{anyURI}}, {{boolean}}, {{date}}, {{dateTime}}, {{decimal}}, {{double}}, {{integer}}, {{negativeInteger}}, {{nonNegativeInteger}}, {{nonPositiveInteger}}, {{positiveInteger}} and {{string}}. But we probably do not need to declare all of them. In particular we should be okay to not repeat the default mapping:
> || Java Data Type || XML Schema Data Type
> | boolean | boolean
> | byte | byte
> | short | short
> | int | int
> | long | long
> | float | float
> | double | double
> | java.math.BigInteger | integer
> | java.math.BigDecimal | decimal
> | java.util.Date | dateTime
> | java.util.Calendar | dateTime
> | javax.xml.datatype.XMLGregorianCalendar | anySimpleType
> | javax.xml.datatype.Duration | duration
> | java.lang.String | string
> | java.net.URI | string
> | java.util.UUID | string
> | java.lang.Object | anyType
> | javax.xml.namespace.QName | Qname
> | java.awt.Image | base64Binary
> | javax.activation.DataHandler | base64Binary
> | javax.xml.transform.Source | base64Binary
> Note that {{@XmlSchemaType}} annotations are rarely applied on the public class like Metadata implementations, because the properties of those classes are themselves wrapped in other properties (e.g. {{GO_Decimal}}). The target for {{@XmlSchemaType}} is rather (usually) the internal classes used as wrappers.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)