Andi Vajda <va...@apache.org> wrote:

> On Apr 3, 2010, at 11:38, Bill Janssen <jans...@parc.com> wrote:
> 
> > Does JCC support templated types yet?
> 
> Yes, Lucene Java moved to Java 5 and makes extensive use of generics
> in the 3.x release series.
> I added support for that in JCC 2.5.
> 
> > In particular, I'd like to be able to say,
> >
> >      --sequence List<com.parc.goodstuff.Stuff>
> >                 'size:()I'
> >                 'get:(I)Lcom/parc.goodstuff.Stuff;'
> 
> The first arg to --sequence is that of an existing class, and the
> following, the actual signatures of existing methods on it.

Let's see if I understand this.  I'm not sure I know what the "existing
classes" are.  In this case, the type is
java.util.List<com.parc.goodstuff.Stuff>.  java.util.List is an
interface rather than a class.  On the other hand,
java.util.List<com.parc.goodstuff.Stuff> is a parameterized type of some
sort.  A parameterized interface?  I see no .class file for it.

So I'm guessing I can't do what I want to do.

> If you define a class foo parameterized on type T and that type is the
> return type of a method, that type is used, at runtime, as the wrapper
> for the return value.

I'm sorry, but I don't think I understand what you're saying here.
Which type is the return type of a method, "foo" or "T"?

> JCC does not generate code for all known expansions of a generic class
> - that would lead to serious code explosion.

I assume this also includes generic interface types.

How about generating code for expansions that are specifically called
out in the args to JCC, as in the example above?

Bill

Reply via email to