ExternalClass
mechanism described in [Special.html].
In order to releave the BETA programmer of this tedious work, two
command line tools have been created, thart does this for Java and
.NET respectively.
Most of the files in the directories javalib
and
dotnetlib
in the root of your BETA.Net/BETA.Java
installation were generated using these tools.
If you encounter an external class that you need to use from BETA, and
which has not yet been converted, you may do it yourself, as described
below.
java2beta
is provided.
Basic usage is e.g.
java2beta[.bat] java.lang.Stringwhich will open the
java/lang/String
class and produce
the file <BETALIB>/javalib/java/lang/String.bet
(where <BETALIB>
denotes the placement of your BETA installation
as set in the BETALIB
environment variable, see
Installation of BETA.Net and
BETA.Java.java2beta.bat
and not just java2beta
to invoke the tool.
A few options are available as will be revealed by invoking
java2beta -h
:
Usage: Script: java2beta [-h][-v][-l][-f|-F|-] <java class name> e.g. java2beta java.lang.String Output files will be placed in $BETALIB/javalib in a directory structure corresponding to the package of the class. e.g. $BETALIB/javalib/java/lang/String.bet Options: -h Display this help -v Verbose output -l Generate to local directory instead of to $BETALIB/javalib -f Force overwrite of existing output file -F Force overwrite of existing output file AND files for refered classes - Output to terminal instead of file
CLASSPATH
before calling java2beta
:
If you are converting the class
org.myplace.myclassand the class is placed in a directory named
/users/smith/java/classes/org/myplaceyou should set
CLASSPATH
to
/users/smith/java/classesYou should also include paths to any non-standard refered classes in your
CLASSPATH
. So if a method in
org.myplace.myclass
has a parameter of type
org.otherplace.otherclassand this class is found in directory
/users/jones/java/classes/org/otherplaceyou should set
CLASSPATH
to
/users/smith/java/classes:/users/jones/java/classes(on windows the
CLASSPATH
separator is semicolon instead
of colon).
Finally, if your custom classes are packed into JAR files, each JAR
file should be listed in the CLASSPATH
. So in the
example, of the two involved packages where placed in two JAR files,
in the previously named directories, and these JAR files were named in
the conventional way, you should set CLASSPATH
to
/users/smith/java/classes/org.myplace.jar:/users/jones/java/classes/org.otherplace.jar
dotnet2beta
is provided.
Basic usage is e.g.
dotnet2beta System.Stringwhich will open the
System.String
class and produce
the file <BETALIB>/dotnetlib/System/String.bet
(where <BETALIB>
denotes the placement of your BETA installation
as set in the BETALIB
environment variable, see
Installation of BETA.Net and
BETA.Java.
A few options are available as will be revealed by invoking
dotnet2beta -h
:
Usage: dotnet2beta [-h][-v][-w][-f][-F][-][-tt][-tf][-tr] <dotnet class name> e.g. dotnet2beta System.String Output files will be placed in BETALIB/dotnetlib in a directory structure corresponding to the namespace of the class. e.g. c:/beta/r5.3/dotnetlib/System/String.bet Options: -h Display this help -v Verbose output -w Suppress warnings (ignored if -v) -f Force overwrite of existing output file -F Force overwrite of existing output file AND files for refered classes - Output to terminal instead of file -tt Debug: type related verbose output -tf Debug: file related verbose output -tr Debug: runtime related verbose output
dotnet2beta
operates can
be configured by editing the file
<BETALIB>/dotnetlib/conversion-rules.txt
.
...