cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Chaffee" <jchaf...@ebates.com>
Subject Re: JAXB: Any way to incorporate restrictions into annotations?
Date Wed, 02 Mar 2011 04:01:13 GMT
This is what my understanding is as well.  Was just really hoping  
soneone knew something I didn't.  :)

Jason

On Mar 1, 2011, at 7:23 PM, "Daniel Kulp" <dkulp@apache.org> wrote:

> On Tuesday 01 March 2011 7:27:16 PM Jason Chaffee wrote:
>> The question is how to do these things with annotations.   That is  
>> why
>> you were given xsd examples because we know how to do them in the  
>> XSD.
>> But in a code-first approach, you would want to specify these in the
>> annotations and then generate the schema from it.  That is the  
>> question,
>> how to do that.
>
> I really don't think you can.  JAXB doesn't really have anything for  
> those
> types of things.   I also looked at the EclipseLink Moxy custom  
> annotations
> and didn't see anything there either.  :-(
>
> Dan
>
>
>
>>
>> Jason
>>
>> -----Original Message-----
>> From: KARR, DAVID (ATTSI) [mailto:dk068x@att.com]
>> Sent: Tuesday, March 01, 2011 4:19 PM
>> To: users@cxf.apache.org
>> Subject: RE: JAXB: Any way to incorporate restrictions into  
>> annotations?
>>
>>> -----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?
>
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> Talend - http://www.talend.com

Mime
View raw message