Recent

Author Topic: Java class with interface to Object Pascal  (Read 2104 times)

JdeHaan

  • Full Member
  • ***
  • Posts: 121
Java class with interface to Object Pascal
« on: July 05, 2015, 08:54:10 am »
Anyone knows how to translate this piece of Java to Object Pascal?

public class ABC
    extends Map<String, Object>
    implements IABC {
….
}

I tried (using FGL) the following, which doesn’t compile, since the methods of the Interface are not implemented, which requires descending from TInterfacedObject. It's not possible to put both TInterfacedObject and TXYZ in the descendant list...

type
  IABC = interface
  …
  end;

  TXYZ = Specialize TFPGMap<String, TObject>;

  TABC = class(TXYZ, IABC)
  …
  end;

Thanks

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Java class with interface to Object Pascal
« Reply #1 on: July 05, 2015, 11:17:38 am »
The default interface in FPC is COM, Java uses CORBA. Change the interface style to CORBA and you're all set.

JdeHaan

  • Full Member
  • ***
  • Posts: 121
Re: Java class with interface to Object Pascal (SOLVED!)
« Reply #2 on: July 05, 2015, 04:10:50 pm »
Thanks Leledumbo

 

TinyPortal © 2005-2018