[stringtemplate-interest] StringTemplate + Doclet
Sam Harwell
sharwell at pixelminegames.com
Wed Dec 22 11:39:04 PST 2010
My implementation of TypeRegistry<T> in the C# port of StringTemplate uses
IsAssignableFrom with caching that is nearly as fast as using
a.GetType()==b.GetType(). Per my email on 12/14, I was hoping this would get
ported to the Java version. I'm using this proxy implementation for a major
task in a project I'm working, and I'm quite happy with the way it turned
out. That said, using IsAssignableFrom was absolutely essential for it to
work properly.
Sam
-----Original Message-----
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Rafael
Chaves
Sent: Wednesday, December 22, 2010 12:48 PM
To: stringtemplate-interest at antlr.org
Subject: Re: [stringtemplate-interest] StringTemplate + Doclet
For any interface based API (which is a common practice), getClass() is a
show stopper. A client of the API does not know the actual classes involved
(they are not API).
I was not suggesting actually using the instanceof operator (I am not sure
you really meant that, as it is not really possible), but
Class.isInstanceOf(object). A similar thing would be
Class.isAssignableFrom(object.getClass()).
Cheers,
Rafael
More information about the stringtemplate-interest
mailing list