jarnotator parameters explained

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

<jarnotator fileName="${myjar}"
                    annotateInterfaces="true" 
                   annotateAbstractMethods="true" 
                   processOlderJava="false" 
                   verify="true" 
                   showByteCode="false" 
                   keepOriginal="false" 
                   backupFileExtension="orig" 
                   quiet="false" 
                   simpleDebug="true">

Maven plugin

<configuration>	    <annotateInterfaces>true</annotateInterfaces	    <annotateAbstractMethods>true</annotateAbstractMethods	    <simpleDebug>true</simpleDebug>                <processOlderJava>true</processOlderJava>                <verify>true</verify>                <showByteCode>false</showByteCode>                <keepOriginal>false</keepOriginal>                <backupFileExtension>orig</backupFileExtension>                <quiet>false</quiet>                <simpleDebug>true</simpleDebug></configuration>

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.

/**
* Suppress all output to stdout*/
boolean quiet = false;

By default jarnotator display a minimal amout of information during execution. To totally surpress any output to stdout set the quiet value to true.

/**
 * Display simple debug information to stdout
*/
boolean simpleDebug = false;

Although jarnotator uses slf4j for its logging one can obtain some additional information by setting the option to true.

/**
* Display bytecode during analysis step
*/
boolean showByteCode = false;

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.

/**
* Whether to keep the orignal classes dir /jar after annotation
*/
boolean keepOriginal = true;

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.

/**
* Extension to append to original
*/
String backupFileExtension = "orig";

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.

/**
* Verify the bytecode upon read and write
*/
boolean verify = true;

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.

/**
* propagate annotations from implementation to interfaces*/
boolean annotateInterfaces = true;

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().

/**
* propagate annotations from implementation to the abstract methods
*/
boolean annotateAbstractMethods = true;

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.

/**
* Process pre java5 classes to java5
*/
boolean processOlderJava = false;

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. 

/**
* Entries representing the class path elements needed by the package at runtime. This will be used
*/
final List classPathEntries;

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.

/**
* Whether to save a report
*/
boolean saveReport = true;

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.

Follow Me

Follow us on Twitter

Feed Display

Linuxtoday.com
  • The challenge of Byzantine Fault Tolerance

    eSecurityPlanet: The big problem Bromium is working on is called Byzantine Fault Tolerance. In computer science, this concept describes a system that is able to survive multiple and arbitrary forms of attack or failure of its component parts.

  • Who is the biggest control freak of them all?

    Toolbox.com: When it comes to computing, especially operating systems, the trend seems to reducing the amount of control the end users have over their operating system environments [stares hard at garden gnomes].

  • How to dual-boot Ubuntu 12.04 and Windows 7

    LinuxBSDos.com: One tool that has seen very little or no change over the past several releases in Ubuntu Desktop is the installation program. So it is somewhat surprising that some users are having problems dual-booting Windows 7 and Ubuntu 12.04 using a tutorial written for Ubuntu 11.04.

Phoca - Google AdSense Easy

Google Search

Webwww.biggerbytes.be

RSS socialnet

Add to MyYahoo!
Subscribe in NewsGator Online
Add to Newsburst
Add to Google
Add to My AOL
Add to Pluck
Subscribe in FeedLounge
Add to Windows Live
Add to NetVibes
Subscribe in Rojo
Subscribe in Bloglines
Add to MyMSN
Add to Plusmo for your cellphone
Add to PageFlakes
Add to Technorati
Add to BlinkBits
Copyright © 2012 BiggerBytes.Be. All Rights Reserved.
Joomla! is Free Software released under the GNU/GPL License.