views:

51

answers:

1

What data flavor should I use to transfer a list of strings? I guess I can serialize the list of strings in JSON format, but was hoping I could just transfer a List directly.

+2  A: 

From Java Tutorial

For example, to create a data flavor for the java.util.ArrayList class:

   new DataFlavor(ArrayList.class, "ArrayList");

Transferring Data across the JVM boundary

stacker
+1 (for, among other reasons, finding an official Sun document that uses the phrase "bass-ackwards" regarding Microsoft's OLE :-)
Jason S
Hmm... is there a way to signify ArrayList<String> vs. just plain ArrayList?
Jason S
@Jason S I'm afraid that's not possible since it is defined like this:public DataFlavor(Class<?> representationClass, String humanPresentableName)
stacker
well, that's OK: at least I can use "humanPresentableName" to encode template parameter in string form, if not in a type-safe way.
Jason S