jarnotator parameters explained
Last Updated on Monday, 06 September 2010 20:38 Written by jarnotator Monday, 16 August 2010 09:53
The analysis and subsequent annotation performed by jarnotator can be control by set of parameters. This document describes these different parameters. Each of these options are available whether the standalone jar, Ant task or maven plugin is used. The actual names may differ slightly in the case of the standalone jar. Please refer to the dedicated documentation for the correct values.
Illustration of parameters
This section briefly illustrates the default parameters for both the Ant task and the maven plugin. A more detailed description of these options is given in the next section.
Ant task
Maven plugin
Below the different parameters are listed using the java declaration syntax. The initial value in the declaration is corresponds to the default value for that parameter.
By default jarnotator display a minimal amout of information during execution. To totally surpress any output to stdout set the quiet value to true.
Although jarnotator uses slf4j for its logging one can obtain some additional information by setting the option to true.
When set to true jarnotator output a textual representation of the bytecode instructions to stdout. This happens when jarnoator parses bytecode or produces (writes) bytecode.The output tends to be verbose and is for debugging purpose only.
Prior to the analysis jarnotator renames the original jar or classs directory by appending a predefined (but configurable) extension to the original. After processing the bytecodejarnotator can be told not to keep the backup of the orginial by setting to parameter to true.
By default the orginal jar or classes directory is renamed to file or directory with the same name and the extension "orig" appended to it. One can enforce another extension withthis parameter.
Whenever jarnotator parses bytecode or produces (writes) bytecode the resulting bytes are passed through a verification.phase. This means that invalid bytecode will not be analyzed. Similarily, bytecode annotated by jarnotator is verified to be valid.
jarnotator is able to propagate annotation it applied on concrete methods to interfaces defining those methods. Consider for instance the case where method m() of class Foo get annotated @CheckForNull. Continuing this example assume method m() is implementation of the interface Bar by the class Foo. jarnotator will not only annotate the method m() in Foo but also Bar's method m().
This similar to annotation propagation for interface but this time for abstract classes. jarnotator can propagate annotation on implementations of abstract methods to the abstract method in the abstract classes themselves.
Annotations are only supported since Java 5. Hence it is not possible to annotate pre-java 5 bytecode. By setting the option to true old classes which get annotated will get a higherversion (i.e. version 49.0) when written back to disc. Note that no other form of conversion is performed.
To improve the quality of the static analysis one can provide the class path needed by the classes at runtime. jarnotator benefits from this additional information since it has access to possible parents classes, interfaces being implemented, external classes used in the bytecode. Furthermore jarnotator uses jsr-305 annotations present in class path entries which improvesthe correctness of the analysis. This parameter consists of the path (relative or absolute) path to the jar and classes to use during analysis.
Currently, version 1.2, jarnotator produces a minimalistic report after analysis. The information present in this report is limited and tools to process it do not exist.
Feed Display
| Linuxtoday.com |
|














