users@jaxb.java.net

Re: How can I specify length constraints?

From: Benson Margulies <bimargulies_at_gmail.com>
Date: Tue, 1 Mar 2011 18:59:24 -0500

Did I write anything about 'important'? I'm just reporting the sad
fact -- which you seem to already know -- that JAX-B is not, and does
not try to be, complete. It does not even have an extension mechanism
to allow you to add additional bits that are important to you but
didn't feel important to KK et. al. when he designed it.

On Tue, Mar 1, 2011 at 6:47 PM, KARR, DAVID (ATTSI) <dk068x_at_att.com> wrote:
>> -----Original Message-----
>> From: Benson Margulies [mailto:bimargulies_at_gmail.com]
>> Sent: Tuesday, March 01, 2011 3:43 PM
>> To: users_at_jaxb.java.net
>> Cc: KARR, DAVID (ATTSI)
>> Subject: Re: How can I specify length constraints?
>>
>> David,
>>
>> JAX-B is not a complete representation of XML Schema. There are many
>> schema constructs that do not correspond to any @nnotation. If you run
>> xsd-to-java they get dropped, and of course in the other direction
>> they never appear.
>
> I understand that it cannot be a one-to-one mapping.  The fact that it's not obvious what the semantics of a length restriction annotation would be in Java doesn't mean that it's not important to have that information in an XML schema.
>
>> On Tue, Mar 1, 2011 at 6:30 PM, KARR, DAVID (ATTSI) <dk068x_at_att.com>
>> wrote:
>> >> -----Original Message-----
>> >> From: KARR, DAVID (ATTSI)
>> >> Sent: Tuesday, March 01, 2011 3:17 PM
>> >> To: users_at_jaxb.java.net
>> >> Subject: How can I specify length constraints?
>> >>
>> >> When I write pure XML Schema, I can define a simple type based on
>> >> string
>> >> that has length restrictions, being a minimum and maximum length.  I
>> >> don't see a way to do that with JAXB annotations.  Assuming I've
>> just
>> >> missed it, will schemagen respect that annotation in the generated
>> >> schema?
>> >
>> > Is the only reasonable strategy to have a hand-coded "simple types"
>> > schema, and to have your JAXB classes reference those types?
>> >
>