java classes inherited
Data::Inherited 1.00
Data::Inherited is a Perl module with hierarchy-wide accumulation of list and hash results. more>>
SYNOPSIS
package Foo;
use base Data::Inherited;
use constant PROPERTIES => (qw/name address/);
package Bar;
use base Foo;
use constant PROPERTIES => (qw/age/);
package main;
my $bar = Bar->new;
print "$_n" for $bar->every_list(PROPERTIES);
prints
name
address
age
This is a mixin class. By inheriting from it you get two methods that are able to accumulate hierarchy-wide list and hash results.
every_list(String $method_name, Bool ?$override_cache = 0)
Takes as arguments a method name (mandatory) and a boolean indicating whether to override the cache (optional, off by default)
Causes every method in the objects hierarchy with the given name to be invoked. The resulting list is the combined set of results from all the methods, pushed together in top-to-bottom order (hierarchy-wise).
every_list() returns a list in list context and an array reference in scalar context.
The result is cached (per calling package) and the next time the method is called from the same package with the same method argument, the cached result is returned.
This is to speed up method calls, because internally this module uses NEXT, which is quite slow. It is expected that every_list() is used for methods returning static lists (object defaults, static class definitions and such). If you want to override the caching mechanism, you can provide the optional second argument. The result is cached in any case.
Runtime Java Class Editor 1.0
Runtime Java Class Editor is a tool for editing loaded (running) Java classes and much more. more>>
This helps you to test your application in an interactive way; altering running programs helping a trial and error approach to programming; testing code and saving it when its correct. Long running algorithms, such as simulations, can also easily be refined without the need for restarts or lose of data.
RJCE can be used to write a program from within itself ensuring high coupling between testing and development, with no delay before the outcome of any alterations.
RJCE allows scripts to run from within your application, allowing users to configure or extend an application dynamically, bypassing normal language access rules controlled by public, private and protected. This can be done by easily instatiating an instance of CodeEditorFrame from the rom.gui package.
RJCE permits faster development of applications by allowing easy migration from scripts to Java programs.
Class::Inner 0.1
Class::Inner is a perlish implementation of Java like inner classes. more>>
SYNOPSIS
use Class::Inner;
my $object = Class::Inner->new(
parent => ParentClass,
methods => { method => sub { ... } }, },
constructor => new,
args => [@constructor_args],
);
Yet another implementation of an anonymous class with per object overrideable methods, but with the added attraction of sort of working dispatch to the parent classs method.
METHODS
new HASH
Takes a hash like argument list with the following keys.
parent
The name of the parent class. Note that you can only get single inheritance with this or SUPER wont work.
methods
A hash, keys are method names, values are CODEREFs.
constructor
The name of the constructor method. Defaults to new.
args
An anonymous array of arguments to pass to the constructor. Defaults to an empty list.
Returns an object in an anonymous class which inherits from the parent class. This anonymous class has a couple of extra methods:
SUPER
If you were to pass something like
$obj = Class::Inner->new(
parent => Parent,
methods => { method => sub { ...; $self->SUPER::method(@_) } },
);
then $self-gtSUPER::method almost certainly wouldnt do what you expect, so we provide the SUPER method which dispatches to the parent implementation of the current method. There seems to be no good way of getting the full SUPER:: functionality, but Im working on it.
DESTROY
Because Class::Inner works by creating a whole new class name for your object, it could potentially leak memory if you create a lot of them. So we add a DESTROY method that removes the class from the symbol table once its finished with.
If you need to override a parents DESTROY method, adding a call to Class::Inner::clean_symbol_table(ref $self) to it. Do it at the end of the method or your other method calls wont work.
clean_symbol_table
The helper subroutine that DESTROY uses to remove the class from the symbol table.
new_classname
Returns a name for the next anonymous class.

Java Clazz Utils 1.2.2
Java Clazz Utils offers you a full-featured and crossplatform Java bytecode viewer and decompiler which can support latest Java versions (from 1.4 till 1.6). more>>
Java Clazz Utils 1.2.2 offers you a full-featured and crossplatform Java bytecode viewer and decompiler which can support latest Java versions (from 1.4 till 1.6). It can be used both as command line tool and user application with Swing interface. It contains InfoJ, Decompiler and jclazz-GUI.
Major Features:
- InfoJ can be used to generate information about Java class. The output includes all possible data that can be extracted from class file: fields, methods, attributes, access flags, signatures, debug information, opcodes etc.
- Decompiler can be used to reproduce Java source code from compiled Java class file. It uses debug information to produce Java code which is nearly the same as original source file. Nevertheless, there are several restrictions and Java code constructions that prevent decompiler from producing the same code as original and even correct Java code. You can find out more about these cases below on this page.
- jclazz-GUI is user-friendly interface for quick start and easy to use.
Enhancements:
- Save of decompiled file writes to predefined file name - Fixed
- Condition structures "condition ? operation1 : operation2" were decompiled incorrectly - Fixed
- URL to bug reporting page is corrected
jclassinfo 0.19.1
jclassinfo is an information extractor for Java bytecode. more>>
Main features:
Class Information
- Java VM version required,
- super class,
- interfaces implemented. --general-info
- Constant pool dump --constant-pool
- Methods --methods
- Fields --fields
- Class attributes --attributes
Dependency Information
- Packages required --packages
- Classes required --classes
- Methods required --methods-ref
Options affecting verbosity
- Disassemble code --disasm
- Print limits and exception table for methods --verbose
- Print debugging information --method-debug-info
- Change visibility --visibility=< public | package | protected | private | synthetic >
Domino Javadoc Generator 0.4
Domino Javadoc Generator project aims to create a documentation to the Lotus Notes API for Java. more>>
The Lotus Notes API is delivered as a Java archive together with the original documentation in the native format of a Domino database with the IBM Domino Designer. The documentation can be read only in the Lotus Notes. Java-oriented tools cannot use it to display a description of a Java class, to browse classes and their methods or to offer an automatic code insertion based on a Java object and its class.
The goal is to create a Javadoc documentation together with a pseudo-source code of the Lotus Notes API. The documentation can be viewed, indexed and integrated to IDEs. The pseudo-source code can be integrated to IDEs to support object browsing and automatic source code insertion.
C# Java Virtual Machine 1.0.1
C# Java Virtual Machine is a tiny implementation of the Java VM, including simple native classes. more>>
Enhancements:
- The DbConnection class, which provides a connection to MS SQL or PostgreSQL using ADO.NET, was added.
- The Syst.MachineName method, which returns the machine name, was added.
- String.startsWith and String.endsWith functions were added.
- Some comments for VM.cs were written.
Java Platform Invoke API Demo (Linux) 2.01.04
Java Platform Invoke API (Demo version) for Linux, i386. Enables Java code to call native functions implemented in shared libraries like in Microsoft .NET Framework. Written for JSE 1.5.x and later. more>>
Java Platform Invoke API Demo (Linux) - Java Platform Invoke API (Demo version) for Linux/Unix, i386.
Enables Java code to call native functions implemented in shared link libraries like in Microsoft .NET Framework. Written for JSE 1.5.x and later.
Java platform invoke an API that enables Java code to call native functions implemented in shared libraries, such as those in the Linux API. It locates and invokes an exported function and marshals its arguments (integers, strings, arrays, structures, and so on) across the interoperation boundary as needed. This API supports implicit marshaling that makes Java coding with native functions very simple.
To consume a shared library functions you need
1.Identify functions in shared librarys.
Minimally, you must specify the name of the function and name of the the shared library that contains it.
2.Create a class to hold shared library functions.
You can use an existing class, create an individual class for each native function, or create one class that contains a set of related native functions. This class should extend CNativeLibrary. Use the annotation ImportLibrary to bind your class to the native library.
3.Create prototypes in Java code.
Write prototype of a native function as a method with signature that corresponds to the native function using data type map agreement. To identify the native function use the annotation Function. Mark the method with the native modifier.
4.Call a shared library function.
Call the method on your Java class as you would any other Java method. As parameters can be passed structures and implemented in Java callback functions.
Enhancements:
Version 2.01.04
System Requirements:JSE 1.5.x<<less
Java::Build::GenericBuild 0.05
Java::Build::GenericBuild is a high level driver to control Java builds. more>>
SYNOPSIS
There are two (or more) code files needed to effectively use this module. First, create a subclass of this class:
package Java::Build::MyBuild;
use Carp;
# Do the following in a BEGIN block before the use base statement:
BEGIN { $ENV{CLASSPATH} .= ":/path/to/suns/lib/tools.jar"; }
use base Java::Build::GenericBuild;
# use any other Java::Build modules you need
my @args = (
{ BUILD_SUCCESS => sub { croak "You must supply a BUILD_SUCCESS" } },
{ CONFIG_LOC => sub { croak "You must supply a CONFIG_LOC" } },
{ MAIN_DIR => &_form_main_dir },
# ...
); # Include all the attributes that matter to your build here, and
# what to do if the caller omits them.
# If they are required, die in the subroutine, otherwise provide a
# subroutine reference which will fill in the default
sub new {
my $class = shift;
my $self = shift;
$self->{ATTRIBUTES} = @attrs;
process_attrs($self);
return bless $self, $class;
}
# Include common targets callers can share here. Put unique targets
# in the calling scripts (see below).
sub init { my $self = shift; ... }
sub cvs_refresh { my $self = shift; ... }
sub compile { ... }
# ...
sub _form_main_dir { my $self = shift; $self->{MAIN_DIR} = /usr/src; }
In some script:
#!/usr/bin/perl
use strict; use warnings;
use Java::Build::MyBuild;
my $project = Java::Build::MyBuild->new(
BUILD_SUCCESS => /where/this/module/can/store/build/state.info,
CONFIG_LOC => /some/path/to/my.conf,
NAME => MyApplication,
SRC_DIR => /where/my/java/files/live,
SUBPROJECTS => [
{ NAME => "util" },
{ NAME => "app", USING => &compile_app },
],
);
$project->targets(qw( init cvs_refresh unique compile ));
$project->GO(@ARGV);
package Java::Build::MyBuild; # re-enter the build package to add targets
sub unique {...} # a routine that MyBuild doesnt provide
asm2class 0.1.2
asm2class is an assembly Java to class file compiler. more>>
Asm2class is release under the terms of the GPL License. The current version of asm2class (0.1.2) is a beta version and allow generating class file from java assembly file that contains class definition, field definition, method definition and constructor definition.
This release support also abstract class, abstract method and native method definition.
Asm2class know more thatn 90% of the java assembly language. Asm2class can do dead code detection, uninitialized register detection.
Class::Classless 1.35
Class::Classless is a Perl framework for classless OOP. more>>
SYNOPSIS
use strict;
use Class::Classless;
my $ob1 = $Class::Classless::ROOT->clone;
$ob1->{NAME} = Ob1;
$ob1->{stuff} = 123;
$ob1->{Thing} = 789;
my $ob2 = $ob1->clone;
$ob2->{NAME} = Ob2;
printf "ob1 stuff: n", $ob1->{stuff};
printf "ob2 stuff: n", $ob2->{stuff};
printf "ob1 Thing: n", $ob1->{Thing};
printf "ob2 Thing: n", $ob2->{Thing};
$ob1->{METHODS}{zaz} = sub {
print "Zaz! on ", $_[0]{NAME}, "n";
};
$ob1->zaz;
$ob2->zaz;
$ob1->EXAMINE;
$ob2->EXAMINE;
This prints the following:
ob1 stuff: < 123 >
ob2 stuff: < 123 >
ob1 Thing: < 789 >
ob2 Thing: < >
Zaz! on Ob1
Zaz! on Ob2
< Class::Classless::X=HASH(0x200236f4) >
stuff, 123,
NAME, Ob1,
Thing, 789,
METHODS, { zaz, CODE(0x20068360) },
PARENTS, [ ROOT ],
< Class::Classless::X=HASH(0x2002cb48) >
stuff, 123,
NAME, Ob2,
METHODS, { },
PARENTS, [ Ob1 ],
In class-based OOP frameworks, methods are applicable to objects by virtue of objects belonging to classes that either provide those methods, or inherit them from classes that do.
In classless OOP frameworks (AKA delegation-and-prototypes frameworks), what methods an object is capable of is basically an attribute of that object. That is, in Perl terms: instead of methods being entries in the symbol table of the package/class the object belongs to, they are entries in a hash table inside the object. Inheritance is implemented not by having classes inheriting from other classes (via ISA lists), but by having objects inherit from other objects (via PARENTS lists).
In class-based OOP frameworks, you get new objects by calling constructors. In a classless framework, you get new objects by copying ("cloning") an existing object -- and the new clone becomes a child (inheritor) of the original object. (Where do you get the one original object? The language provides one, which has no parents, and which contains some general purpose methods like "clone".)
Claros Downloader 1.0
Claros Downloader is a simple, highly customizable, multi-threaded, web based downloader manager. more>>
Installation:
For Tomcat Users:
Copy the war file to $TOMCAT_INSTALL_DIR/webapps folder
Start Tomcat
For other application servers, you shall know what to do with a war file. If war extension means nothing to you, just unzip is it, if it was a regular zip archive.
All configuration is done in WEB-INF/resources directory. Open config.properties with your favorite editor, and follow the instructions.
Please Note: There is a Java class called AddUser.class in WEB-INF/classes/org/claros/downloader/admin directory. Run this class from console to add a new user to the system.
Java::Import 0.03
Java::Import is Perl module to use Java classes in Perl. more>>
SYNOPSIS
use Java::Import qw(
some.package.SomeClass
);
my $instance = new some.package.SomeClass();
$instance->someMethod();
my $ret_val = some::package::SomeClass::someStaticMethod();
$ret_val->someMethod();
$ret_val2 = $instance->someOtherMethod($ret_val);
$ret_val2->someMethod();
my $java_array_ref $instance->someMethod2();
foreach my $obj ( @$java_array_ref ) {
$obj->someMethod();
}
The purpose of this module is to provide a simple method for using Java classes from a Perl program while using the latest in Open Source Java Technology. Thus, this module makes great use of the GNU Compiler Tools for Java in its implimentation.
Class::Contract 1.00
Class::Contract - Design-by-Contract OO in Perl. more>>
SYNOPSIS
package ClassName
use Class::Contract;
contract {
inherits BaseClass;
invar { ... };
attr data1;
attr data2 => HASH;
class attr shared => SCALAR;
ctor new;
method methodname;
pre { ... };
failmsg Error message;
post { ... };
failmsg Error message;
impl { ... };
method nextmethod;
impl { ... };
class method sharedmeth;
impl { ... };
# etc.
};
Background
Design-by-contract is a software engineering technique in which each module of a software system specifies explicitly what input (or data or arguments) it requires, and what output (or information or results) it guarantees to produce in response.
These specifications form the "clauses" of a contract between a module and the client software that uses it. If the client software abides by the input requirements, the module guarantees to produce the correct output. Hence by verifying these clauses at each interaction with a module, the overall behaviour of the system can be confidently predicted.
Design-by-contract reinforces the benefits of modular design techniques by inserting explicit compile-time or run-time checks on a contract. These checks are most often found in object-oriented languages and are typically implemented as pre-conditions and post-conditions on methods, and invariants on classes.
Note that these features differ from simple verification statements such as the C assert statement. Conditions and invariants are properties of a class, and are inherited by derived classes.
An additional capacity that is often provided in design-by-contract systems is the ability to selectively disable checking in production code. This allows the contractual testing to be carried out during implementation, without impinging on the performance of the final system.
Adding design-by-contract to Perl
The Class::Contract module provides a framework for specifying methods and attributes for a class (much like the existing class definition modules Class::Struct, Class::MethodMaker, and Class::Generate). Class::Contract allows both per-object and per-class methods and attributes to be defined. Attributes may be scalar-, array-, hash-, or object-based.
Class::Contract differs from other class-specification modules (except Class::Generate) in that it also provides the ability to specify invariant conditions on classes, and pre- and post-conditions on methods and attributes. All of these clauses are fully inheritable, and may be selectively disabled. It differs from all other modules in that it has a cleaner, simpler specification syntax, and -- more importantly -- it enforces encapsulation of object attributes, thereby ensuring that the class contract cannot be subverted.
Defining classes
Class::Contract provides an explicit syntax for defining the attributes, methods, and constructors of a class. The class itself is defined using the contract subroutine. contract takes a single argument -- a subroutine reference or a block. That block is executed once and the results used to construct and install the various components of the class in the current package:
package Queue;
contract {
# specification of class Queue attributes and methods here
};
Class::Maker 0.05.18
Class::Maker Perl module contains classes, reflection, schema, serialization, attribute- and multiple inheritance. more>>
SYNOPSIS
use Class::Maker qw(class);
class Human, { isa => [qw( ParentClass )],
public =>
{
string => [qw(name lastname)],
ref => [qw(father mother)],
array => [qw(friends)],
custom => [qw(anything)],
},
private =>
{
int => [qw(dummy1 dummy2)],
},
configure =>
{
ctor => create,
explicit => 0,
},
};
sub Human::greeting : method { my $this = shift;
printf This is %s (%d), $this->name, $this->uid;
}
class UnixUser, { isa => [qw( Human )],
public =>
{
int => [qw(uid gid)],
string => [qw(username)],
},
};
my $a = Human->new( uid => 1, gid => 2, name => Bart );
$a->father( Human->new( name => Houmer ) );
$a->greeting();
$a->uid = 12;
$a->_dummy1( bla );
Class::Maker introduces the concept of classes via a "class" function. It automatically creates packages, ISA, new and attribute-handlers. The classes can inherit from common perl-classes and class-maker classes. Single and multiple inheritance is supported.
This package is for everybody who wants to program oo-perl and does not really feel comfortable with the common way.
Java-like reflection is also implemented and allows one to inspect the class properties and methods during runtime. This is helpfull for implementing persistance and serialization. A Tangram (see cpan) schema generator is included to the package, so one can use Tangram object-persistance on the fly as long as he uses Class::Maker classes.