Almost newbie in jaxb, trying to bind PLMXMLSchema.xsd to java classes with xjc (jdk 8).
Here is an excerpt of the schema
<xsd:complexType name="ProductType">
<xsd:annotation>
<xsd:documentation>
This is the revision-independent Product, derived from Structure.
It corresponds to the STEP 'product'.
Attributes:
productId: The identifier of the Product, unique in some context, e.g. an
Organisation.
alternateForRef: An 'alternate' Product is one which is substitutable, in all
contexts, for a particular Product. If this is an 'alternate'
Product, then this attribute references the Product for which
this is an alternate.
unitRef: The default Unit for the 'quantity' attribute of any referencing
ProductInstance elements.
designRequired: true if all the revisions of this Product must have
at least one associated DesignRevision
source: whether the Product is manufactured or bought-in
vendorRef: References the Vendor when the Product represents a
vendor part.
</xsd:documentation>
</xsd:annotation>
<xsd:complexContent>
<xsd:extension base="plm:StructureBase">
<xsd:attribute name="productId" type="xsd:string" use="optional"/>
<xsd:attribute name="alternateForRef" type="plm:anyURIType" use="optional" plm:refType="plm:Product"/>
<xsd:attribute name="unitRef" type="plm:anyURIType" use="optional" plm:refType="plm:Unit"/>
<xsd:attribute name="designRequired" type="xsd:boolean" default="true"/>
<xsd:attribute name="source" type="plm:ProductSourceEnum" use="optional"/>
<xsd:attribute name="vendorRef" type="plm:anyURIType" use="optional" plm:refType="plm:Vendor"/>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="Product" type="plm:ProductType" substitutionGroup="plm:Structure"/>
First point
the xjc compiler builds the class ProductType.java, but I'd prefer Product.java. This is only an example, since the schema use consistently the naming convention "FooType" with the "Type" suffix I prefer to get rid of.
Using the "simple" binding as suggested here https://stackoverflow.com/a/4818344/2668213 seems to have no effect..
Second point
The attribute in the schema
<xsd:attribute name="alternateForRef" type="plm:anyURIType" use="optional" plm:refType="plm:Product"/>
is translated into
@XmlAttribute(name = "alternateForRef")
protected String alternateForRef;
but I would greatly prefer
@XmlAttribute(name = "alternateForRef")
@XmlIDREF
protected Product alternateForRef;
This pattern applies consistently in the schema, where some attributes are idrefs to plm:refType classes. So I hope there should be an (external bindings?) solution to address all these cases at once.