Hello,
I am using the Apache POI library to read Excel files. The following is from within Slime.
I am struggling to extract cell types as returned by getCellTypeEnum ( https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Cell.html#getCell... ())
My code returns a Java Object like so: #<org.apache.poi.ss.usermodel.CellType FORMULA {5C25A9}>
It is of class #<java class org.apache.poi.ss.usermodel.CellType>
I would like to grab the "FORMULA" in the above object description.
Slime can see it, it's inspector can see it, even DESCRIBE can see it:
READER> (describe *) #<org.apache.poi.ss.usermodel.CellType FORMULA {11CC24A}> is an object of type JAVA-OBJECT.
The wrapped Java object is an instance of org.apache.poi.ss.usermodel.CellType:
"FORMULA"
But, I could not figure out a way to get to "FORMULA". I tried to accessing the slot `name' but that does not work. I looked at the FFI page, but found no clues. I tried to get slot names via AMOP:
(mop:class-direct-slots (class-of java-cell-type))
returns NIL
It must be something simple that I am overlooking.
Help is appreciated. Thanks!
Mirko
On Fri, Apr 14, 2017 at 01:43:38PM +0000, Mirko Vukovic wrote:
It is of class #<java class org.apache.poi.ss.usermodel.CellType>
I would like to grab the "FORMULA" in the above object description.
Slime can see it, it's inspector can see it, even DESCRIBE can see it:
READER> (describe *) #<org.apache.poi.ss.usermodel.CellType FORMULA {11CC24A}> is an object of type JAVA-OBJECT.
The wrapped Java object is an instance of org.apache.poi.ss.usermodel.CellType:
"FORMULA"
But, I could not figure out a way to get to "FORMULA". I tried to accessing the slot `name' but that does not work.
It's a method of the Java enum, not a field, or slot, e.g.
(java:jcall "name" (java:jfield "org.armedbear.lisp.Stream$EolStyle" "RAW"))
returns `"RAW"`, so either that or `(#"name" ...)` via JSS should work.
On Fri, Apr 14, 2017 at 7:58 PM Olof-Joachim Frahm olof@macrolet.net wrote:
On Fri, Apr 14, 2017 at 01:43:38PM +0000, Mirko Vukovic wrote:
It is of class #<java class org.apache.poi.ss.usermodel.CellType>
I would like to grab the "FORMULA" in the above object description.
Slime can see it, it's inspector can see it, even DESCRIBE can see it:
READER> (describe *) #<org.apache.poi.ss.usermodel.CellType FORMULA {11CC24A}> is an object of type JAVA-OBJECT.
The wrapped Java object is an instance of org.apache.poi.ss.usermodel.CellType:
"FORMULA"
But, I could not figure out a way to get to "FORMULA". I tried to accessing the slot `name' but that does not work.
It's a method of the Java enum, not a field, or slot, e.g.
(java:jcall "name" (java:jfield "org.armedbear.lisp.Stream$EolStyle"
"RAW"))
returns `"RAW"`, so either that or `(#"name" ...)` via JSS should work.
Thank you, that did it.
Mirko
armedbear-devel@common-lisp.net