Sorry, you (DD) are right.
Then I don“t know any. So you (David) have to write it for yourself :-)
A little introspection, instantiation, ...
It would be simpler if you have the sources. Then use XDoclet to find the
right classes (*.java), and use a mapper to generate your result (*.class).
Jan
> -----Original Message-----
> From: Dominique Devienne [mailto:DDevienne@lgc.com]
> Sent: Wednesday, March 17, 2004 4:39 PM
> To: 'Ant Users List'
> Subject: RE: Java implementation selector
>
>
> > From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de]
> >
> > Never used but sounds that XDoclet [1] has on build-in :-)
>
> Unless I'm mistaken, XDoclet works off .java files, not .class files.
>
> > > -----Original Message-----
> > > From: David Corbin [mailto:dcorbin@machturtle.com]
> > >
> > > Is there a selector available that will select files (.class
> > > files) base on
> > > Java inheritance? That is, I'd like to find all the .class
> > > files that
> > > implement another specified class.
> > >
> > > Is a selector the right way for this to be implemented?
>
> Yes, a selector is the right way, depending on the type of inheritance
> you want to detect.
>
> A Selector is stateless, i.e. it only knows about the current file
> you are processing. By using BCEL or ASM, you can easily learn a lot
> about that class file itself, but it does not contain all the type
> information about that class, AFAIK. For example, to know all the
> super classes of a class, you'd have to load other .class files to
> following the inheritance tree. This requires a mechanism to locate
> other classes, using a classpath.
>
> I guess you could have a selector taking a classpath, and loading all
> the dependent classes of every class you visit, but usually (and
> preferably to me), selectors should be able to decide selection of a
> given file based on the file itself only.
>
> I hope this helps. --DD
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
|