I had trouble understanding the question... With the Reflection API, you could perhaps get out of this situation. You use the object Method (which is a "kind of pointer" and point to a true method of a class). Then use invoke to realize the call.
Code:
public class DcmData
{
public void DeleteAllElts(int a, Object b)
{
System.err.println("Erase the elements ?! "+a+" - "+b);
}
}
Code:
public class main
{
public static void main(String[] args) throws SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException, InvocationTargetException
{
DcmData p_dcmdata = new DcmData();
p_dcmdata.DeleteAllElts(0, "foo");
DcmData ptr_dcmdata = p_dcmdata;
Method method_pseudo_ptr = p_dcmdata.getClass().getMethod("DeleteAllElts", int.class, Object.class);
method_pseudo_ptr.invoke(p_dcmdata, 0, "FOO");
}
}
Bookmarks