cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: where is "required" property added to XMLElement annotation?
Date Tue, 04 Sep 2007 18:12:30 GMT

Glen,

One thing you could try:

Add all the jaxb 2.1 things (api jar, impl jar, and xjc jar) in front of 
the CXF stuff on your classpath.   It may generate different code.  CXF 
should work with 2.1.   However, it doesn't pass the JAX-WS 2.0 TCK that 
way which is why we don't ship it that way.

Dan


On Tuesday 04 September 2007, Glen Mazza wrote:
> Am Dienstag, den 04.09.2007, 13:31 -0400 schrieb Daniel Kulp:
> > Glen,
> >
> > On Monday 03 September 2007, Glen Mazza wrote:
> > > During wsdl2java generation, where in our code is the "required"
> > > property added to the @XMLElement annotation?  I would like to
> > > supply a patch for CXF-963[1] that will stop adding this property
> > > to this annotation.
> >
> > That is generated in the JAXB code, not CXF.    Not much you can do
> > about it.   The reason Metro might be generating things differently
> > is they may be using a different version of JAXB.   They may be up
> > to 2.1 since they are targetting JAX-WS 2.1 right now.
>
> Oh, I see.  Glad I asked--questions like these help clarify things
> greatly for me.
>
> > > (BTW, if someone knows if I was wrong in my analysis of CXF-963,
> > > i.e., required *is* a valid property for the XMLElement
> > > annotation, please advise.)
> >
> > required is definitely a valid property of XmlElement annotation.  
> > If you check the JAXB spec, section 8.9.1 defines the XmlElement
> > annotation as:
> > @Retention(RUNTIME) @Target({FIELD, METHOD}
> > public @interface XmlElement {
> >     String name() default "##default" ; // name for XML elemen
> >     boolean nillable() default false;
> >     boolean required() default false;
> >     String namespace() default "##default" ;
> >     Class type() default DEFAULT.class;
> >     String defaultValue() default "\u0000";
> >     static final class DEFAULT {}
> > }
>
> I see again.  I was mistaken here because the Sun annotations guide
> for some reason does not mention that property:
> https://jax-ws.dev.java.net/jax-ws-ea3/docs/annotations.html#4.4%
> 20javax.xml.bind.annotation.XmlElement%7Coutline
>
> Thanks,
> Glen



-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Mime
View raw message