Spacer Spacer Spacer Spacer Spacer Spacer Spacer Spacer Spacer Spacer Spacer Spacer
R1c1 home products company support R1c10 Spacer
R2c5 Spacer
vbj_home features download Prod_nav_doc_roll price buy faq Prod_r3c8 Spacer
Prod_r4c1 Prod_vbj Prod_down Prod_r4c10 Spacer
Prod_buy Spacer

Introduction

Many if not most businesses use both Java and Microsoft platforms and products. But there is a barrier of incompatibility, of language and platform differences, that prevents re-use of of VB.Net components and applications in a Java context. Our products and services are designed to bridge this barrier.

Our goal is to support you in leveraging your software investment across platforms according to your business requirements. VBeeJ for Java converters are platform conversion tools. Our tools:

  • Convert VB.Net to Java (see features ).
  • Use an advanced type inference engine to create an interface layer in Java which resolves all unknowns.
  • Have a built in, open, and extensible plugin adapter library which implements .Net services on the Java platform.
    • All plugin adapters are pure open source Java and can be used in any Java context.
    • Plugin adapters can also be developed independently and loaded dynamically.
    • The free trial

      comes with an open platform for building plugin adapters.
  • The free trial

    comes with a convert-and-run demo example suite that shows these capabilities.
    • The example code generates the Xml plugin adapter, supporting .Net Xml API on Java 6.0.

VBeeJ for Java converters create a complete object oriented interface in pure Java for any VB.Net program.

Flowchart1
Back to top

Installing VBeeJ for Java Free Trial Converter

  • After you have entered your order information, you will be able to initiate the download of a Windows installer which will install the VBeeJ for Java Free Trial Converter, along with a convert-and-run demo example suite and other files, into a directory of your choice.


Back to top

Running VBeeJ for Java Free Trial Converter

The VBeeJ for Java Free Trial Converter can be run

  • With the gui.
  • As a jar file, from the command line
  • As an external tool within the Eclipse Platform.
    • The free trial

      comes with a demo example suite and an Eclipse workspace. The commands built into the installation Eclipse workspace show how to run VBeeJ for Java Free Trial Converter as a tool within Eclipse. Documentation is included in the installation.
Note that VBeeJ for Java Free Trial Converter requires a jre of version 1.6.0 or higher to run.

  1. Running the VBeeJ for Java Free Trial Converter with the gui

    Click on the VBeeJ For Java icon and the gui will execute. You can select files to convert and output directory.

  2. Running the VBeeJ for Java Free Trial Converter jar file

    The VBeeJ for Java Free Trial Converter jar file is distributed with the examples in the VBeeJTools directory. Go to that directory and enter

    java -jar VBeeJ.jar -help

    to see the command line options. If no options are supplied, the gui will be invoked.


Back to top

Input and Output Files

Here is a simple example, where the input and output is shown in the Eclipse Platform (version 3.2).

  1. VB.Net Input

    Click the link to view a simple test program which defines a property. The source file contains a base class and a derived class.

  2. Java Output

    Click the link to view the result of translation. Three files are created, for each class in the input source. Each defines a Java class with the same name as the class in the input source. Note that the Module is converted to a final class.

    The converted code includes the comments from the original source.

    The Java produced by VBeeJ conforms to Java version 1.6.0.

  3. The beelucid Directory

    This is a special directory created by VBeeJ for Java converters. The beelucid directory is:

    • where plugin adapters needed by the sources are generated.
    • where any unresolved references to types, methods, or system libraries are resolved.
    • where any needed Bridge type definitions are generated

    Bridge classes provide a 'bridge' between similar classes on the different platforms. Click the link to show the contents of the beelucid directory for a simple test case. A few Bridge classes are shown, including the Bridge classes which support Events and EventHandlers. The contents of the beelucid directory will vary depending on the characteristics and requirements of the source program. All class definitions are in the form of Java source files.


Back to top

Messages

The VBeeJ for Java Free Trial Converter produces messages to clarify the process and results of translation.

  1. Info Messages

    'Info' messages are messages which describe the translation choices made by VBeeJ. They are for infomational purposes, to help you understand the generated code better. In general no response is required.

    In the message, the source file name is followed by a line number and message category, and followed by the message text.

    [TestRedim.vb] 1: Beelucid info: Every Visual Basic namespace creates a package directory in the Java context (namespace 'TestRedim')

  2. Warning Messages

    'Warning' messages are messages which notify the user that the Java translation may not completely match the VB.Net functionality for all cases. You should check the code indicated by these warning messages. The more common cases will most likely require no modification.

    In the message, the source file name is followed by a line number and message category, and followed by the message text.

    [TestRedim.vb] 6: Beelucid warning: Visual Basic operator 'GetType(<className>)' converted to Java '<classname>.class', which has equivalent but not identical functionality and syntax.

  3. Error Messages

    'Error' messages are messages which notify the user there is no Java construct or functionality that can be automatically converted to implement the VB.Net statement. There aren't many of these and they are mostly generated for features included in VB.Net for VB6 compatibility. You will need to check the code and manually convert.

    In the message, the source file name is followed by a line number and message category, and followed by the message text.

    [TestRedim.vb] 8: Beelucid error: 'ReDim' statement requires manual translation if the operand has not been declared with specific dimensions but is an object of 'Array' type (array name 'my3DIntArray').

Click the link to view an example of VB.Net source with its translation and translation messages. The linked example shows info messages, warning messages, and an error message.


Back to top

Primitive Bridge Types

VB.Net supports primitive types Boolean, Char, Byte, Short, Integer, Long, Single, and Double. Java's parallel types are boolean, char, byte, etc. Basic types in Java and VB.Net behave identically in some contexts but not in others. Where they behave identically, the translation is direct. Where they do not behave identically, a Bridge type wrapper object is created, that wraps the underlying basic value. The Bridge type definitions are contained in the beelucid directory.

For example, a VB.Net statement of the form

Dim II As Integer = 3

converts directly into the Java variable initialization statement

int II = 3;

VB.Net primitive types and Java basic types are parallel but they do not behave identically in all contexts. The VB.Net variables are objects which support services. An int variable in Java is a simple value. When this difference results in a difference of functionality or behavior, VBeeJ uses bridge types to bridge the difference. The goal is to have your VB.Net program convert into legal Java.

For example, in VB.Net, the following variable initialization relies on the fact that Integer variables are object of class Integer:

Dim II As New Integer(3) 'Integer is a class and 'New' creates a new Integer object

A direct translation of this into a Java initialization would not be legal because int is a value not an object type:

int II = new int(3); // Illegal Java because 'new' can't be used to create a value

In this example, VBeeJ will generate a IntegerBridge class in the beelucid directory in order to create the int value:

int II = new IntegerBridge(3).intValue();

The IntegerBridge class creates an object which is a wrapper for the underlying Java basic int value, and the method intValue() returns that underlying value.


Back to top

Bridge Types for Events and Event Handling

VBeeJ for Java converters implement complete and robust support of support of events and event handling. For events, the class EventBridge is generated. This class associates an event object with a set of handlers, which can be added and removed. For event handling, the class EventHandlerBridge is generated, which supports associating a handler with an event object.

VBeeJ for Java converters will generate all the code needed to fully implement in Java the event and event handling functionality in your VB.Net program. Click this link to view a VB.Net example Test.vb which has a WithEvents variable, an event class, an event handler, and raises an event.

Click this link to view classes in Test.vb after they've been converted into Java. The converted classes use the bridge classes. The VB.Net Event variable MyEvent has the type in Java of EventBridge, which associates MyEvent with a set of handlers. The class declaring this event, MyEventClass, utilizes the class EventHandlerBridge, to support associating handlers with MyEvent. For a high level view of EventBridge and EventHandlerBridge click this link .

After conversion, this example compiles and executes identically on both platforms with no modification.


Back to top

Type Inference

VBeeJ For Java is designed to be flexible, powerful, and robust even when information about class definitions and interfaces used by the source program is missing or incomplete. The type inference engine allows it to handle missing classes and interfaces in source programs.

The VBeeJ For Java type inference engine performs several functions.

  • It identifies classes, methods, and properties whose definitions are not available in the VB.Net source program.
    • For these unknowns, it infers method and property signatures and creates a type hierarchy if one is needed.
  • It extracts all the unknowns in your VB.net class or module into the beelucid directory.

This is a special directory created by VBeeJ for Java converters. The beelucid directory is:

  • where plugin adapters needed by the sources are generated.
  • where any unresolved references to types, methods, or system libraries are resolved.
  • where any needed Bridge type definitions are generated


Back to top


Note: Microsoft, Microsoft .Net, Windows, and Visual Basic .Net are registered trademarks of Microsoft Corporation in the United States and other countries.

Note: Java is a registered trademark of Sun Microsystems, Inc. in the United States and other countries.

Spacer
R7c1 Spacer