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 17:31:28 GMT

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.


> (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 {}
}

required is in there.

Dan

 

>
> Thanks,
> Glen
>
> [1] https://issues.apache.org/jira/browse/CXF-963



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