contrib/jwrapper: intro `JavaModel`
authorAlexis Laferrière <alexis.laf@xymus.net>
Sun, 19 Jul 2015 17:24:19 +0000 (13:24 -0400)
committerAlexis Laferrière <alexis.laf@xymus.net>
Mon, 20 Jul 2015 21:34:28 +0000 (17:34 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

contrib/jwrapper/src/model.nit

index 31b8c6b..6ebe954 100644 (file)
@@ -1,6 +1,7 @@
 # This file is part of NIT (http://www.nitlanguage.org).
 #
 # Copyright 2014 Frédéric Vachon <fredvac@gmail.com>
+# Copyright 2015 Alexis Laferrière <alexis.laf@xymus.net>
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -288,17 +289,30 @@ class NitType
        end
 end
 
+# Model of a single Java class
 class JavaClass
+       # Type of this class
        var class_type = new JavaType(new JavaTypeConverter)
+
+       # Attributes of this class
        var attributes = new HashMap[String, JavaType]
 
        # Methods of this class organized by their name
        var methods = new MultiHashMap[String, JavaMethod]
 
-       var unknown_types = new HashSet[JavaType]
+       # Importations from this class
        var imports = new HashSet[NitModule]
 end
 
+# Model of all the Java class analyzed in one run
+class JavaModel
+       # Unknown Java types used in `classes`
+       var unknown_types = new HashSet[JavaType]
+
+       # All analyzed classes
+       var classes = new Array[JavaClass]
+end
+
 # A Java method, with its signature
 class JavaMethod
        # Type returned by the method