You are currently viewing a snapshot of www.mozilla.org taken on April 21, 2008. Most of this content is highly out of date (some pages haven't been updated since the project began in 1998) and exists for historical purposes only. If there are any pages on this archive site that you think should be added back to www.mozilla.org, please file a bug.



Utility classes for Java Code

This project is a collection of utility classes for Java programmers. These classes supplement the classes found in java.util and in the JDK collections classes. This document presents the highlights of the util classes and also provides information on checking out the code.

The complete API documentation can be found at http://www.mozilla.org/projects/blackwood/java-util/api/.

Highlights

    Assert

      One thing sorely lacking in Java is an assertion facility. This class provides a robust, complete, assertion facility. The best way to use the Assert class is:

      if (Assert.enabled && Assert.assert_it(mytest(), "my test failed"));

      Such usage prevents not only mytest() from being executed if assertions are disabled but also the assert method itself, and some compilers can remove the entire statement if assertions are disabled.

    ParameterCheck

      ParameterCheck provides convenient means for parameter checking. Class methods in the ParameterCheck class can be used to verify that method parameters meet certain conditions and to raise exceptions if the conditions are not met.

      Typical usage:

      ParameterCheck.nonNull(myParameter);

      This verifies that myParameter is not null, throwing an IllegalArgumentException if it is.

Downloading the Jar

    Version 1.0 of the mozilla util jar file is available here.

Checking out the code

    Right now there is no module for just the java-util code, you must check out the whole blackwood tree, which includes java-util. It can be found at http://www.mozilla.org/cvs.html, but instead of cvs checkout SeaMonkeyAll use cvs checkout Blackwood


Ed Burns
Last modified: Tue Dec 18 12:28:53 PST 2001