users@jaxb.java.net

RE: How can I specify length constraints?

From: KARR, DAVID (ATTSI) <"KARR,>
Date: Tue, 1 Mar 2011 15:30:46 -0800

> -----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?