Resp. opytam sa inak:

Vytvaram spravne instanciu Config() pomocou operatora new?

Pohladom do kodu vidim, ze vygenerovane classy neobsahuju ziaden kod, len 
deklaracie a kopu @XmlElement, takze imho by som mal pouzit jaxb, ale neviem 
ako.

> Ahoj.
>
> Zapasim s jaxb. Mam nasledovne xsd:
>
>   <xsd:element name="config">
>         <xsd:complexType>
>             <xsd:sequence>
>                 <xsd:element name="tst" type="tns:test_ct" nillable="true"
> /> </xsd:sequence>
>         </xsd:complexType>
>     </xsd:element>
>
>     <xsd:complexType name="test_ct">
>         <xsd:sequence>
>             <xsd:element name="a" type="xsd:string" nillable="true"/>
>         </xsd:sequence>
>     </xsd:complexType>
>
>
> ... z ktoreho vznika class-a Config.
>
> Problem je, ze v nasledovnom kode:
>
> Config c = new Config();
> c.getTst().setA("a");
>
> dostavam null exception, pretoze getTst() vrati null.
>
> Da sa nejak jaxb donutit, aby defaultne vytvoril instanciu typu "test_ct"?
>
> Dik



-- 
Dusan


... tykajte mi

Odpovedet emailem