Re: New Reflection/Beans API
Juozas Baliuka <[email protected]>
| Newsgroups | gmane.comp.jakarta.bcel.devel |
|---|---|
| Message-ID | <5.0.2.1.0.20020605131141.01fa1968@localhost> |
It can be useful to implement high level methods ( static ? )
MethodGen getMethodGen( ClassGen, java.lang.rerfect.Method );
Field .....
addReadMethod( ClassGen, java.lang.reflect.Field );
addWriteMethod( ClassGen, java.lang.reflect.Field );
addReadWriteMethods( ClassGen, java.lang.Class interface );
................................................................................................
Type getType(Class)
......................................
invoke( InstructionList, Mathod );
readField( InstructionList, java.lang.reflect.Field);
........................................
At 15:26 2002.06.05 +0200, Markus Dahm wrote:
>Stephen Colebourne wrote:
>
>>>>Yes this is what I was driving at. Is there an easy factory method to
>>create
>>
>>>>bytecodes equivalent to:
>>>>Class cl = Foo.class
>>>Currently the answer is no, but that's not to difficult, just call
>>>Class.forName("Foo");
>>What I mean is that if you decompile a Java class with this relatively
>>simple line, it has generated about 15 bytecodes plus a field - it lazily
>>instantiates the object. This will be a pain to code, but perfectly possible
>>(I'll just copy the decompiled code!)
>>
>>>>Also, is there a convenient method to create a Type object from a Class
>>>>object?
>>>new ObjectType(clazz.getName()); ?
>>But what about primitive types and array types. I'm guessing that quite a
>>few projects must run into the issue of converting Class to Type. Maybe a
>>new factory method on Type would be appropriate - Type.getType(Class) ?
>
>
>Yes,
>
>that would probably be a good idea. Maybe I'll have time to implement that.
>
>Cheers
> Markus
>
>
>
>--
>To unsubscribe, e-mail: <mailto:[email protected]>
>For additional commands, e-mail: <mailto:[email protected]>