Wow. Interesting idea. Not something CXF really has much control over though. This is really a question for the JAXB list:
http://jaxb.dev.java.net We just delegate the schema->java stuff down to the JAXB code generators. (xjc) XJC DOES have a plugin model that allows some manipulation of the generated code. I'm not sure if it's flexible enough to do all this though. That would be something you would need to ask them. Dan On Wed May 6 2009 2:40:38 pm Suresh Adluru wrote: > Hi, > > > > Can anyone help me with the following issue? > > > > I have defined TestObject object in WSDL schema definition. This object > has defined annotations (documentation and appInfo) in its schema. I am > trying to get the JAVA code generated for these defined annotations. I > am also posting my sample TestObject and CustomAppInfo elements schema > definition. We are using CXF's WsdlToJava for the code generation tool. > > > > Any suggestions would be greatly appreciated. > > <complexType name="TestObject"> > > <extension base="xy:Foo"> > > <sequence> > > <element name="field1" minOccurs="0" type="xy:FooField"> > > <annotation> > > <documentation xml:lang="en"> > > Some documentation for field1 > > </documentation> > > > > <appinfo> > > <xy:CustomAppInfo> > > <readonly>true</readonly> > > </xy:CustomAppInfo> > > </appinfo> > > > > </annotation> > > </element> > > </sequence> > > </extension> > > > > <complexType name="CustomAppInfo"> > > <sequence> > > <element name="readonly" minOccurs="0" type="boolean"> > > </element> > > </sequence> > > </complexType> > > > > The generated Java code: > > @XmlAccessorType(XmlAccessType.FIELD) > > @XmlType(name = " TestObject ", propOrder = { > > " field1"}) > > public class TestObject extends Foo > > { > > protected String field1; > > //get/sets for field1 > > } > > > > And > > > > XmlAccessorType(XmlAccessType.FIELD) > > @XmlType(name = " CustomAppInfo ", propOrder = { > > "readonly" > > }) > > public class CustomAppInfo { > > > > protected Boolean readonly; > > //get/sets for readOnly field > > } > > > > However, I am trying to extract the CustomAppInfo as annotation to the > generated Java object for example, the expected result is : > > > > @XmlAccessorType(XmlAccessType.FIELD) > > @XmlType(name = " TestObject ", propOrder = { > > " field1"}) > > public class TestObject extends Foo > > { > > @CustomAppInfo (readonly=true) > > protected String field1; > > //get/sets for field1 > > } > > > > > > Thanks, > > Suresh -- Daniel Kulp dk...@apache.org http://www.dankulp.com/blog