[nbusers] Re: Code generation from XSD

  • From: Gary Greenberg < >
  • To:
  • Subject: [nbusers] Re: Code generation from XSD
  • Date: Sat, 13 Oct 2012 19:19:42 -0700

Thank you Milos,
As I removed outputDir from the plugin description it stopped complaining.
However I still have some other problem with the generated code and I would 
greatly appreciate the advice.
I had some code written before the XSD was introduced as an ultimate source 
of truth.
In that code I had an abstract class and several concrete subclasses. In yet 
another class I had an attribute with the type of abstract class.
When I tried to reflect this in XSD I made it in the form of <xs:choice> in 
which I listed my concrete types.
The generated code has a references to every concrete class, just like it 
would be with a <xs:sequence>
I don't need these multiple references - it has to be one and one only.
I tried to move <xs:choice> into a separate complexType but got the same 
result.
Does anyone know how to eliminate these multiple references?

Thanks.
On Oct 13, 2012, at 1:49 AM, Milos Kleint wrote:

> On Sat, Oct 13, 2012 at 1:44 AM, Gary Greenberg 
> < >
>  wrote:
>> I've followed the advice and incorporated JAXB mojo into my POM.
>> Everything works fine except one little annoyance.
>> Generated Java code goes into ${project.basedir}/src/main/generated as I 
>> need to refer to it in my other code.
> 
> it should go into target/generated-sources/XXX where XXX is probably
> jaxb in this case. That's where netbeans recognizes generated
> sources.. See the Sources panel in priject properties..
> 
> Milos
> 
>> However, even within same package I have two generated classes: Event and 
>> EvenList where the last one is basically List<Event>. And in the source 
>> code I see this red wiggly line under the event.
>> And I have several of these.
>> Why NB does not see the other class in the same directory is beyond me.
>> It does see them under ../src/main/java.
>> It builds successfully, though.
>> How can I get rid of this wavy line?
>
>> Thanks.
>
>> On Oct 11, 2012, at 6:47 PM, Gary Greenberg wrote:
>
>>> I am not using JAXB directly.
>>> I do need to write a bunch of REST services in the Spring framework (but 
>>> no Jersey) compliant with the interfaces defined by XML schema. I wanted 
>>> to save some work for myself and generate these classes.
>>> 
>>> 
>>> On Oct 11, 2012, at 1:12 PM, Fabrizio Giudici wrote:
>>> 
>>>> On Thu, 11 Oct 2012 21:55:07 +0200, Edson Richter 
>>>> < >
>>>>  wrote:
>>>> 
>>>>> Em 11/10/2012 15:05, Gary Greenberg escreveu:
>>>>>> Can Netbeans generate Java class from the XML schema definition?
>>>>>> What plugin I need for that?
>>>> 
>>>> Gary, are you using JAXB?
>>>> 
>>>> 
>>>> --
>>>> Fabrizio Giudici - Java Architect @ Tidalwave s.a.s.
>>>> "We make Java work. Everywhere."
>>>> http://tidalwave.it/fabrizio/blog - ;
>>>> 
>>> 
>



[nbusers] Code generation from XSD

Gary Greenberg 10/11/2012

[nbusers] Re: Code generation from XSD

Edson Richter 10/11/2012

[nbusers] Re: Code generation from XSD

Javier Ortiz 10/11/2012

[nbusers] Re: Code generation from XSD

Fabrizio Giudici 10/11/2012

[nbusers] Re: Code generation from XSD

Fabrizio Giudici 10/11/2012

[nbusers] Re: Code generation from XSD

Gary Greenberg 10/12/2012

[nbusers] Re: Code generation from XSD

Gary Greenberg 10/12/2012

[nbusers] Re: Code generation from XSD

Fabrizio Giudici 10/13/2012

[nbusers] Re: Code generation from XSD

Milos Kleint 10/13/2012

[nbusers] Re: Code generation from XSD

Gary Greenberg 10/14/2012

[nbusers] Re: Code generation from XSD

Timon Veenstra 10/14/2012

[nbusers] Re: Code generation from XSD

Gary Greenberg 10/16/2012

[nbusers] Re: Code generation from XSD

Timon Veenstra 10/16/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20140418.2d69abc). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close