Hi,
Here I am using primitive type int. I cannot do anything like you have
mentioned with int.
I can change that to java.lang.Integer but again this class does not have
any no argument constructor or factory method that returns new instance of
Integer.
Infact I had tried replacing int with java.lang.Integer and this still did
not work.
So question is how can we use primitive types in jibx mappings.
Thanks
Sachin
Thomas Jones-Low wrote:
>
> Sachin Mittal wrote:
>> Hi,
>> I am getting this above error.
>> My mapping is as followed:
>> <structure get-method="getCalendarCampaignId"
>> set-method="setCalendarCampaignId" name="calendar_campaign_identifier">
>> <value style="element" name="calendar_campaign_id"
>> type="int"/>
>> </structure>
>>
>> Also as per docs I have added a serializer and deserializer methods for
>> type
>> int:
>> <format type="int" serializer="java.lang.String.valueOf"
>> deserializer="java.lang.Integer.parseInt"/>
>>
>> So even after all this its not working and I am getting this error when
>> binding is compiled:
>> Error: Need no-argument constructor or factory method for class int;
>>
> As the error message says, the class you are putting the value into
> needs to be created in some way. JiBX requires either you create a
> constructor with no argument (e.g. MyClass() {} ) or create a method
> which returns a (potentially new copy) of your class (e.g. static
> MyClass getNewMyClass() {...}).
>
>
-----
http://www.assembla.com/wiki/show/sachin_mittal about me:
--
View this message in context:
http://www.nabble.com/Need-no-argument-constructor-or-factory-method-for-class-int-tp23557952p23559723.html
Sent from the jibx-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users