You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bcel-user@jakarta.apache.org by Andreas Schlapbach <sc...@iam.unibe.ch> on 2002/02/25 20:10:50 UTC

Reflection && BCEL - Types

<div class="moz-text-flowed" style="font-family: -moz-fixed">Hi List

I'm using BCEL to subclass existing classes and interfaces on the fly.
So I use java reflection to gain insight on the to be subclassed
classes. But I'm not sure how to effectly map the java types to BCEL.

For example:

class A {
     void b(int a);
}

returns a Class of type 'void' as return type and a Class 'int' as it's
argument type. (This part of JAVA is, let's say, strange :))

If I want to subclass from A and overwrite b I need to generate a class
B and a method b with exactly this signature.

But the MethodGen classes uses it's own Type system.

Now, is there an easy way to map this java types on to the BCEL types?
  From looking at the API and the source I couldn't find a smooth way.

Something like
|*
MethodGen <ci...@iam.unibe.ch>*(int access_flags,
     Class return_type,
     Class[] arg_types,
     java.lang.String[] arg_names,
     java.lang.String method_name,
     java.lang.String class_name,
     InstructionList <ci...@iam.unibe.ch> il,
     ConstantPoolGen <ci...@iam.unibe.ch>  cp)|

would be nice.

Or is there a better approach?

Andreas

--
I think, so IAM.

Andreas Schlapbach            schlpbch@kde.org
http://www.iam.unibe.ch/~schlpbch






</div>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>