users@jaxb.java.net

Re: RE: RE: how to create objects instead of primitives

From: Felipe Gaúcho <fgaucho_at_gmail.com>
Date: Mon, 21 Jul 2008 11:11:43 +0200

I created a small example, using JAXB customization....

The concept is well explained on this link:
http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html

The example is attached to this email, and it reads an XSD Schema and
do create a Java type with an Integer attribute (instead of int).

* you should adapt the ant task used to produce the Java classes,
since my libraries here are wrong and I don't have much time to fix it
:)

I hope that helps :)



On Mon, Jul 21, 2008 at 11:23 AM, Shahar Valdman
<Shahar.Valdman_at_modelity.com> wrote:
> Thanks. I have come across the same issue with the boolean type (jaxb creates boolean whilst I'm interested in Boolean).
> Is there any way to indicated jaxb to create Boolean? Is there any documentation where I may check this stuff out myself and not bother everybody?
> Thanks!
>
> -----Original Message-----
> From: Ted Poovey [mailto:tpoovey_at_uscentral.org]
> Sent: Tuesday, July 15, 2008 5:35 PM
> To: users_at_jaxb.dev.java.net
> Subject: RE: RE: RE: how to create objects instead of primitives
>
> Yes, use xsd:integer as your datatype in xsd
>
> Thank you
>
> Ted Poovey
> Software Engineer III
> I.T. Application Management
> U.S. Central
> 9701 Renner Blvd
> Lenexa, KS 66219
> (ph) 913-227-6106
> (fax) 913-227-6254
>
>
> -----Original Message-----
> From: Shahar Valdman [mailto:Shahar.Valdman_at_modelity.com]
> Sent: Tuesday, July 15, 2008 11:26 AM
> To: users_at_jaxb.dev.java.net
> Subject: RE: RE: how to create objects instead of primitives
>
> Thanks!
> Actually, it's a good solution for me (I did not know JAXB will create
> a BigDecimal). Is there a similar solution for integer/positiveInteger
> schema objects?
>
> -----Original Message-----
> From: Ted Poovey [mailto:tpoovey_at_uscentral.org]
> Sent: Tuesday, July 15, 2008 3:04 PM
> To: users_at_jaxb.dev.java.net
> Subject: RE: RE: how to create objects instead of primitives
>
> Is there a reason you are not using decimal instead of double?
>
> Thank you
>
> Ted Poovey
> Software Engineer III
> I.T. Application Management
> U.S. Central
> 9701 Renner Blvd
> Lenexa, KS 66219
> (ph) 913-227-6106
> (fax) 913-227-6254
>
>
> -----Original Message-----
> From: Shahar Valdman [mailto:Shahar.Valdman_at_modelity.com]
> Sent: Tuesday, July 15, 2008 3:45 AM
> To: users_at_jaxb.dev.java.net
> Subject: RE: how to create objects instead of primitives
>
> a type for example from my schema:
> <xs:complexType name="T2">
> <xs:complexContent>
> <xs:extension base="T1">
> <xs:sequence>
> <xs:element name="myName"
> type="xs:double"></xs:element>
> </xs:sequence>
> </xs:extension>
> </xs:complexContent>
> </xs:complexType>
>
> The generated class: (I would like myName to be of type Double)
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "T2", propOrder = {
> " myName "
> })
> public class T2 extends T1{
> protected double myName;
> public double getMyName () {
> return myName;
> }
> public void setMyName (double value) {
> this. myName = value;
> }
> public boolean isSetMyName () {
> return true;
> }
> }
>
> -----Original Message-----
> From: Felipe Gaúcho [mailto:fgaucho_at_gmail.com]
> Sent: Tuesday, July 15, 2008 9:37 AM
> To: users_at_jaxb.dev.java.net
> Subject: Re: how to create objects instead of primitives
>
> ok, please send us a fragment of your schema.. an example of element
> and what types you want in the java class....
>
> On Tue, Jul 15, 2008 at 10:20 AM, Shahar Valdman
> <Shahar.Valdman_at_modelity.com> wrote:
>> Hi,
>> Thanks for the rapid reply, but I have searched through the
> customization guide and could not find such an option.
>> I noticed choice attributes lead to similar results, but my schema
> does not have choices for these cases.
>>
>> -----Original Message-----
>> From: Felipe Gaúcho [mailto:fgaucho_at_gmail.com]
>> Sent: Tuesday, July 15, 2008 9:17 AM
>> To: users_at_jaxb.dev.java.net
>> Subject: Re: how to create objects instead of primitives
>>
>> use customizations:
>>
> http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html
>>
>> On Tue, Jul 15, 2008 at 10:12 AM, Shahar Valdman
>> <Shahar.Valdman_at_modelity.com> wrote:
>>> Hi everyone,
>>>
>>>
>>>
>>> I am having an issue with instructing JAXB to generate java classes
> without
>>> using primitives (I would like jaxb not to create double, but
> Double etc). I
>>> noticed it's possible to set parse and print methods for those
> primitives,
>>> but it leads to undesirable results, involving adapters..
>>>
>>> Is that somehow possible to inform JAXB not to use primitives?
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Shahar.valdman_at_modelity.com
>>>
>>>
>>
>>
> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
>> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>