I recently worked on a project that wraps Android classes into callable wrappers from Delphi by reading from a Java archive (JAR). Since the Android platform uses Java, this dips into my Java skills.
Let's first look at the Delphi unit for an Android callable wrapper.
unit
Namespace...;
interface
uses
listofunits...;
type
// forward declarations
CallableWrapper1 =
;
CallableWrapper2 =
CallableWrapper1Class =
(SomeParentClass)
// method declarations
end
(SomeParent)
TJCallableWrapper1 =
class
(TJavaGenericImport<CallableWrapper1Class, CallableWrapper1>)
CallableWrapper2Class =
(SomeOtherParentClass)
(SomeOtherParent)
TJCallableWrapper2 =
(TJavaGenericImport<CallableWrapper2Class, CallableWrapper2>)
After obtaining the list of classes to generate wrappers for, there is a loop that iterates the class, and we need to run through it 2 times. Why 2 times? The first, is to generate the forward interfaces.
The second, is to generate the actual wrappers.