createMap
extracts type information from R function
definitions, and uses this to create Java-style function calls with
appropriately typed arguments. Types are then converted to Java
objects.A side effect is to create or modify a directory structure in the current working directory containing Java class information.
There are three methods defined:
createMap(standardGeneric, missing, ...)
createMap(character, missing, ...)
createMap(missing, pkgs=character, ...)
pkgs
with typeInfo
applied. pkgs
can be a character vecorr of package names,
or in conjunction with the argument splitPkgsToVector=TRUE
a comma-delimited list of packages. The latter behavior is meant
to faciliate use with the ant
command line, as
ant -Dpkg=caDNAcopy,caPROcess gen-map-from-package
.
createMap(funcs, pkgs, generateTests = TRUE, outputDirectory = stop("specify outputDirectory"), typeMode = "javalib", deployMode = "jms", verbose = FALSE, ...)
"createMap"(funcs, pkgs, generateTests = TRUE, outputDirectory = stop("specify outputDirectory"), typeMode = "javalib", deployMode = "jms", verbose = FALSE, splitPkgsToVector=TRUE, ..., extraClasses=character())
generateDataMap
and
converters
. typemode
may be over-written by
values in system.file("rservices", "properties.R",
package=pkg)
.S4DefaultTypedSig
used for providing type specifications for S4 functions when
funcs
is of class standardGeneric
, or
splitPkgsToVector=TRUE
to treat pkgs
as a
comma-delimited list of packages.character(1)
pkgs as
split(pkgs, ",")
, primarily for ant-based integration.extraClasses
for this method are augmented by any
classes defined in the file system.file("rservices",
"properties.R", package=pkg)
.createMap
. Returns a list of Java signatures function definitions..
createMap
operates either on functions with
typeInfo
applied, or on S4 generic
methods. Some coercion occurs with typeInfo
functions. All signatures
have an explict return type.
IndependentTypeSpecification
classes are 'expanded' to a complete set of typed signatures.
Function signatures for S4 methods are created from information used
in generic method construction, supplemented by an optional default
type signature supplied as a named argument S4DefaultTypedSig
. Each method defined for a
generic results in a Java signature. Arguments used for method
dispatch are typed according to the dispatch rules for the
function. Return types are determined by the valueClass
of the
generic (the valueClass
of methods seem not to defined,
despite what the documentation indicates). Default values for other
arguments, and for return values if valueClass
is not used, can
be created with a
TypedSignature
passed as
a named argument S4DefaultTypedSig
. Values implied by S4 method
definitions override the defaults.
See typeInfo2Java
for additional information on how
conversion occurs.
createMap,missing,character-method
library(RWebServices)
## S4
## Not run:
# setClass("A", representation(x="character"))
# setGeneric("foo", function(obj) standardGeneric("foo"))
# setMethod("foo", "numeric", function(obj) new("A", x=as.character(obj)))
# setMethod("foo", "character", function(obj) new("A", x=obj))
#
# createMap(foo, outputDirectory=tempdir(), S4DefaultTypedSig=TypedSignature(returnType="A"))
#
#
#
#
#
# ## End(Not run)
Run the code above in your browser using DataLab