jeudi 28 mai 2015

How to get type hinting in Clojure from classes declared by Java?

The following code

(-> (.getField (Class/forName
                "ccg.flow.processnodes.text.retrievers.Dictionary.Dictionary")
     "wordsTuples") .getType)

tells me that wordsTuples is a java.util.ArrayList. But what I would like to be able to learn is that it is an ArrayList of Strings, since it happens to be declared like this:

public class Dictionary extends ProcessNode {
    public ArrayList<String[]> wordsTuples;

    public ArrayList<String> words;
...

Is there a way to obtain the type hint information programmatically within Clojure?





Aucun commentaire:

Enregistrer un commentaire