cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glen Mazza <glen.ma...@verizon.net>
Subject Re: where is "required" property added to XMLElement annotation?
Date Tue, 04 Sep 2007 18:08:10 GMT
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




Mime
View raw message