JISDLab

View on GitHubtklab-group/JISDLab

lang
ja en

5. Getting static information

One of the functions of JISD is to provide static information about classes and methods.

First, static information is loaded by specifying the source directory and class directory, and then the user can access the static information.

Initialize the StaticInfoFactory class as shown below. The static information will be loaded and the .jisd_static_data{number} directory will be created under binDir. {number} is a sequential number starting from 0.

var sif = new StaticInfoFactory(".", "../sample") // set srcDir and binDir

After this, for example, if you want to display the methods and fields contained in the jisd.demo.HelloWorld class, you can do the following

ClassInfo ci = sif.createClass("jisd.demo.HelloWorld")
ci.methodNames()
ci.fieldNames()

Also, if you want to know the line where you can set an observation point to observe the local variable a in the main method of the class jisd.demo.HelloWorld, you can use

MethodInfo mi = ci.method("main(java.lang.String[])");
LocalInfo li = mi.local("a");
li.canSet();

From this result, you can see that the user should place the observation points from line 26 to 32 of the jisd.demo.HelloWorld.