I am currently working on xsd which uses the following contruct:
<xs:attribute name="listVersionID" type="xs:normalizedString" use="required" fixed="1.0">
Not a problem in itself, it is rather unpleasant for work, since the fixed cost of this definition increases between releases of the xsd specification, and we need to change the values in a separate class of constants in order to keep them valid, although I have little interest in xsd. Xsd is supported elsewhere, so just changing it is not.
So I asked myself if there is a jaxb plugin or similarly turn fixed value attributes into ala constants
@XmlAttribute(name = "listVersionID")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
@XmlSchemaType(name = "normalizedString")
protected final String listVersionID = "1.0";
instead
@XmlAttribute(name = "listVersionID")
@XmlJavaTypeAdapter(NormalizedStringAdapter.class)
@XmlSchemaType(name = "normalizedString")
protected String listVersionID;
which must be filled in manually.
Does anyone know about this?