artefaktur
software engineer &        architecture

 
 
 
 

Type mapping between ACDK and Java

| Intro | acdk.java.AcdkObject | acdk::java::JavaObject | Type mapping | Compile acdk_java |


In the interfaces of acdk.java.AcdkObject and acdk::java::JavaObject the arguments, return values and Exception will be mapped from one language to the other.


Content of this chapter:

     Basic Types
     Strings
     Object types
     Exceptions
   Enhanced DMI functions
     Overloading
     Named Parameters
     OUT/BYVAL




 Basic Types

To enable a generic argument passing from Java to ACDK and vice versa, the basic types will be boxed with the corresponding Object types:
  • boolean to Boolean
  • char to Character
  • byte to Byte
  • short to Short
  • int to Integer
  • float to Float
  • double to Double

 Strings

Strings will be converted from Java to ACDK.

 Object types


All other object will be converted:
  • From Java java.lang.Boolean, java.lang.Character, java.lang.Byte, java.lang.Short, java.lang.Integer, java.lang.Long, java.lang.Float and java.lang.Double to the corresponding ACDK class.
  • From all other Java java.lang.Object to ACDK acdk::java::JavaObject and vice versa
  • From ACDK acdk::lang::Object to Java acdk.java.AcdkObject

 Exceptions

Some basic Exceptions will be automatically converted in the the call interfaces of acdk.java.AcdkObject and acdk::java::JavaObject:
  • java.io.EOFException to and from acdk::io::EOFException
  • java.io.IOException to and from acdk::io::IOException
  • java.lang.Error to and from acdk::lang::Error
  • java.lang.NoSuchMethodException to and from acdk::lang::NoSuchMethodException
  • java.lang.ClassNotFoundException to and from acdk::lang::ClassNotFoundException
  • java.lang.IllegalAccessException to and from acdk::lang::IllegalAccessException
  • java.lang.NullPointerException to and from acdk::lang::NullPointerException
  • java.lang.IndexOutOfBoundsException to and from acdk::lang::IndexOutOfBoundsException
  • java.lang.RuntimeException to and from acdk::lang::RuntimeException
  • java.lang.Exception to and from acdk::lang::Exception
  • java.lang.Throwable to and from acdk::lang::Throwable
Not only the exact types of the exceptions will mapped, but also derived classes to the the best fitting known exception type.

 Enhanced DMI functions


 Overloading

ACDK and Java supports overloading in the DMI interface.

Default values for parameters AcdkObject supports default values for parameters.
JavaObject not tested yet.

 Named Parameters

Not supported in acdk.java.AcdkObject and acdk::java::JavaObject.

 OUT/BYVAL

There is no type mapping for enhanced Parameter attributes.
The package acdk_java_serialization can be used to serialize ACDK object to Java compatible binary stream.
See:  acdk_java_serialization.
 
Last modified 2005-05-08 22:30 by SYSTEM By Artefaktur, Ing. Bureau Kommer