poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mohamed Ennahdi El Idrissi <mohamed.enna...@yahoo.com.INVALID>
Subject Re: Java Dynamic Casting in Apache POI
Date Tue, 01 Sep 2015 14:02:48 GMT
Hi Dominik,
I attached the .java files hereby.
I wanted to commit changes on SVN, but I am not allowed to.
The changes are very minor. a setCellValue() method with an Object argument.

  From: Dominik Stadler <dominik.stadler@gmx.at>
 To: POI Users List <user@poi.apache.org> 
 Sent: Tuesday, September 1, 2015 1:17 PM
 Subject: Re: Java Dynamic Casting in Apache POI
   
Hi,

I think you missed to attach the actual changed classes that you refer
to, additionally a diff/patch file would be easier to look at as it
will show what are the actual changes that you propose...

Dominik.

On Tue, Sep 1, 2015 at 1:01 PM, Nick Burch <apache@gagravarr.org> wrote:
> On Mon, 31 Aug 2015, Mohamed Ennahdi El Idrissi wrote:
>>
>> I have been using Apache POI, and I faced a situation where I could use
>> reflection to determine which datatype a cell should have based on the
>> datatype of the value that is going to contain in Excel.
>
>
> For reading, the normal way to do that is to fetch the cell's type, and read
> the value based on that. Or, use DataFormatter to give you back a string
> representation
>
> For writing, POI accepts both objects and primatives. If you're writing
> something like a number, writing just the number isn't normally enough, you
> normally also need to apply cell formatting rules to format the cell's
> contents.
>
>> When I tried to use, for instance, anObject.getClass().cast(), the POI
>> library would show an error at compile time, while this code is certainly
>> valid at runtime.
>
>
> What are you trying to cast to what?
>
> Nick
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org


>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org



   
Mime
View raw message