A number of tags have been created to facilitate the communication between Soot and Eclipse. For more information about tags in Soot see Tags.
When the options xml-attributes and output Jimple are selected a tag containing the start line number and end line number is added to each Jimple value box, statement, field and method automatically as needed.
When the options xml-attributes and output Jimple are selected a tag containing the start column and end column is added to each Jimple value box, statement, field and method automatically.
When the options xml-attributes and src-prec Java are selected line number and column position tags are added to each Jimple value box, statement, field and method with information indicating the position of the Java source code related to the Jimple.
These first three types of tags are generated automatically as needed and require no work for the analysis developer. The next three tags are added by the analysis developer to annotate their analysis as the like.
String tags can be attatched to a statement, field or method, and take a string as a paremeter, indicating a textual representatio of the analysis results.
stmt.addTag(new StringTag(val+": "+analysisResult(val)));
This tag must be added manually to a value box, statement, field or method. It has six predefined colors red, yellow, blue, green, orange and purple. You may use one of these or define your own using a rgb color specification. Keep in mind that dark colors make text difficult to see. In addition, you may specify whether with a boolean if the background or foreground should be coloured. By default the background is coloured.
stmt.addTag(new ColorTag(ColorTag.GREEN)));
stmt.addTag(new ColorTag(245, 200, 34)));
method.addTag(new ColorTag(Color.RED, true)));
This tag extends StringTag and takes a string for a label. It also needs a host (this is where the link is to) a className (the class that contains the host)
String text = "Target:"+m.toString()"; Host h = m; String className = m.getDeclaringClass().getName(); stmt.addTag(new LinkTag(text, h, className));