Download Download

Package Info

Version: 1.2, 27.11.2000

1. Licence

The package openfuture.packageinfo and all its sub-packages and extensions is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the

Free Software Foundation, Inc.,
59 Temple Place,
Suite 330, Boston,
MA 02111-1307

Or visit

Goto Start

2. Description

2.1. Objectives

The objectives of the openfuture.packageinfo classes are to provide the means to retrieve package information and configuration at runtime. Therefore all packages of an application and its components have to provide a class named _PackageDescription which at least implements a method named version() which provides the version number of the package.

The classes of openfuture.packageinfo now can read the information of these classes using the Java reflection mechanisms. To create configuration information for a system an instance of the class Configuration is used, which searches for classes with the name _PackageDescription within a given package name and recursively within all packages specified in the package description's prerequisites() method. Finally this configuration informatin can be dumped to a Writer or a HTML file.

The following methods of a class _PackageDescription are exploited:

Type Method Description



The version number of the package, e.g. "1.0"



The author of the package



A textual description for the package



The Name of the package / component / application / bean / framework....



A URL where documentation and/or downloadable versions of the package is available



A copyright statement (e.g. GNU licence statement)



A statement describing the required JDK to run the package.



An array of String which describe, which packages must be available at runtime to load and instantiate the classes of the package.

2.2. Usage

To retrieve a configuration of your system simply create an instance of the class Configuration:

Configuration conf = new Configuration("");

The package name passed as argument should indicate a "top" package of the system. There must be a _PackageDescription class within this package. To provide information about the available versions of other packages the prerequisites() method of this package description should list all packages used by the system (see all used import statements to identify the prerequsisites of your system!).

To output the configuration just request the toString() presentation of the configuration.

To write a HTML file of the configuration use the writeHTML() method of the the Configuration:


To write a XML file of the configuration use the writeXML() method of the the Configuration:


Goto Start

3. Changes:


First release of the component


Version history support added


XML export structure improved; HistoryRecord introduced; XMLWriter and HTMLWriter introduced to improve file generation

Goto Start

4. References

[R1] GNU Lesser General Public License

[R2] Download Sources here.

Author: Markus Giebeler
Last Update: 08.05.2000 - 09:16