users@jaxb.java.net

Re: Custom interfaces

From: Bill Chmura <Bill_at_Explosivo.com>
Date: Fri, 29 Nov 2002 09:57:07 -0500

I was able to successfully register and search, but not the way that the
instructions said. I think I ended up going into the main list serve
admin thing after and signing up for this specific list...


-----Original Message-----
From: Discussion list for the Java Architecture for XML Binding
[mailto:JAXB-INTEREST_at_JAVA.SUN.COM] On Behalf Of Marek Malowidzki
Sent: Friday, November 29, 2002 4:07 AM
To: JAXB-INTEREST_at_JAVA.SUN.COM
Subject: Custom interfaces


Hi all,

I have a question regarding using custom Java interfaces in the recent
JAXB implementation. I believe that this answer could have been already
answered, but I failed twice to register to be able to search the
archives (did anyone success?).

In the early access release, there was a nice feature that allowed to
declare custom interfaces to be implemented by generated content Java
interfaces. For example, it could be done using:

<interface name="BasicColumnTemplate" members="ColumnTemplate
ColumnImportTemplate" properties="name label prompt description
reference [...]"/>

This feature disappeared and there does not seem to be any replacement
(or am I missing something?). The problem is that when I have two
elements with a similar subsert of sub-elements and attributes, often I
would like to be able to group the common features in an interface. For
elements, it could be (partially, because of the order in which the
elements appear) solved by using groups with modelGroupAsClass="true"
(however, the current RI does not support this feature). But for
attributes I cannot see a possible (elegant) solution - groups can't
contain attributes.

The solution I am using is to include in the schema some artificial
types grouping these common features. Then, after the content classes
have been generated, I manually extend the generated interfaces with the
"artificial" ones. Quite ugly and error-prone, but is there a better
solution.

The second question: It is not possible anymore to find out if
attribute's value has been provided in an instance document (the
hasXXX() methods from the early release version). Is this true?

Best regards and thanks for the help.

Marek