Re: New Reflection/Beans API

Markus Dahm <[email protected]>
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
Stephen Colebourne wrote:

>>>However I have a question about the Class class. This class appears to
>>>require quite a lot of setting up to create an instance. Is there any
>>>factory method that I've missed to create instances of a Class?
>>>
>>I'm a bit puzzled here, since you can not "create"
>>Class instances. You can only look them up, either
>>via getClass() or Class.forName(), (Class cl = Foo.class;
>>is just syntactic sugar).
>>
> 
> 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");



> Also, is there a convenient method to create a Type object from a Class
> object?


	new ObjectType(clazz.getName()); ?

Cheers
	Markus
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.