cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KARR, DAVID (ATTSI)" <dk0...@att.com>
Subject RE: JAXB: Any way to incorporate restrictions into annotations?
Date Wed, 02 Mar 2011 00:18:41 GMT
> -----Original Message-----
> From: Jason Chaffee [mailto:jchaffee@ebates.com]
> Sent: Tuesday, March 01, 2011 4:04 PM
> To: users@cxf.apache.org
> Subject: RE: JAXB: Any way to incorporate restrictions into
> annotations?
> 
> I can give an example,
> 
> How do I do either of these with annotations:
> 
> 
>   <!-- Custom restriction for name -->
>   <xs:simpleType name="name">
>     <xs:restriction base="xs:string">
>       <xs:pattern value="[a-zA-Z0-9_\.][a-zA-Z0-9_\-\.]*" />
>     </xs:restriction>
>   </xs:simpleType>
> 
> OR a key
> 
>   <!-- Custom key for address name in user -->
>   <xs:element name="user" type="user">
>     <xs:key name="nameKey">
>       <xs:selector xpath="addresses/address" />
>       <xs:field xpath="name" />
>     </xs:key>
>   </xs:element>

Yeah.  I didn't mean elaborate on the schema, I meant on the
annotations.  However, I think I've figured that out in the meantime, at
least for type references.  I believe you would use
'@XmlSchemaType(name="nameKey")", for example, correct?

I have no idea how you could deal with "xs:key" references.

> -----Original Message-----
> From: KARR, DAVID (ATTSI) [mailto:dk068x@att.com]
> Sent: Tuesday, March 01, 2011 3:49 PM
> To: users@cxf.apache.org
> Subject: RE: JAXB: Any way to incorporate restrictions into
> annotations?
> 
> > -----Original Message-----
> > From: jbradfor [mailto:jbradfor@amfam.com]
> > Sent: Tuesday, March 01, 2011 3:46 PM
> > To: users@cxf.apache.org
> > Subject: Re: JAXB: Any way to incorporate restrictions into
> > annotations?
> >
> > We use SimpleTypes, range restrictions (which will not gen but will
> > validate,
> > if requested), and Enums for name/value pairs.
> 
> Could you please elaborate, for instance range restrictions?

Mime
View raw message