Closed TanguyBarthelemy closed 1 year ago
It is because you are using the wrong class for the output. You can use the function .jmethods
to see the methods associated to a type of object and the output:
library(RJDemetra)
library(rJava)
ws <- new_workspace()
mp <- new_multiprocessing(ws, "sa1")
add_sa_item(ws, "sa1", x13(ipi_c_eu[, 1]), "X13")
sa_item <- ws |> RJDemetra::get_object(1) |> RJDemetra::get_object(1)
jt <- .jcall(sa_item, "Ljd2/datatypes/sa/SaItemType;", "getSaDefinition")
metadata <- jt$getMetaData()
.jmethods(jt, "getMetaData")
#> [1] "public java.util.Map jd2.datatypes.sa.SaItemType.getMetaData()"
metadata2 <- .jcall(jt, "Ljava/util/Map;", "getMetaData")
Thank you Alain a lot ! This .jmethods
function is very magical !
I'm trying to translate some java call with
$
into.jcall
call.For example, I'm working with a workspace created by JDemetra+ v2.2.4 :
Then I can get the SA defintion of my SA-ITEM and the included metadata
But with a .jcall call, I only have errors and I don't succeed to access the same object:
Did I forget something or (as usual), am I using the wrong version of my R packages / the v2 java core routines ?
Thank you !
(the purpose behind this is to fix bugs in
rjdworkspace::get_comment
function)