You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Ross Bamford <ro...@roscopec0.f9.co.uk> on 2005/04/11 16:58:17 UTC
instanceof
Hi all,
Does anyone know of a way to do instanceof checks from VTL? At the
moment I'm providing a simple isA method on objects, but I am thinking
there must be another way...
The isA method works, but (at the moment) only checks the actual
classname (not superclasses). Before I go about working this out, I just
wondered if I had missed something crucial ... ?
Cheers,
Ross
--
[Ross A. Bamford] [ross@roscopec0.f9.co.uk]
Roscopeco Open Tech ++ Open Source + Java + Apache + CMF
http://www.roscopec0.f9.co.uk/ + info@roscopec0.f9.co.uk
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: instanceof
Posted by Shinobu Kawai <sh...@gmail.com>.
Hi Ross,
> Does anyone know of a way to do instanceof checks from VTL? At the
> moment I'm providing a simple isA method on objects, but I am thinking
> there must be another way...
>
> The isA method works, but (at the moment) only checks the actual
> classname (not superclasses). Before I go about working this out, I just
> wondered if I had missed something crucial ... ?
None in Velocity, but I'll bet you can make a tool that does that. ;)
Best regards,
-- Shinobu
--
Shinobu Kawai <sh...@gmail.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: instanceof
Posted by Ross Bamford <ro...@synergix-systems.co.uk>.
Hi,
Fortunately the project provides a fully working Velocity framework, so
i will extend the existing isA way, which is kind of like an object-
scope tool. I just wondered if I was going the right way. Thanks to both
who answered. :)
> OTOH, some folks would consider it breaking MVC philosofy to use
> such code in templates.
>
> :) Christoph Reck
:) To be truthful I've never been an MVC 'true-believer', and this
project is based around a 'loose interpretation' of MVC. ;)
Thanks again,
Ross
> On Mon, 2005-04-11 at 18:52 +0200, Christoph Reck wrote:
> Ross Bamford wrote:
> > Hi all,
> >
> > Does anyone know of a way to do instanceof checks from VTL? At the
> > moment I'm providing a simple isA method on objects, but I am thinking
> > there must be another way...
>
> You can use a tool... maybe the tool can take advantage of the
> velocity internal introspector code.
>
> OTOH, some folks would consider it breaking MVC philosofy to use
> such code in templates.
>
> :) Christoph Reck
>
>
> >
> > The isA method works, but (at the moment) only checks the actual
> > classname (not superclasses). Before I go about working this out, I just
> > wondered if I had missed something crucial ... ?
> >
> > Cheers,
> > Ross
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: instanceof
Posted by Christoph Reck <ap...@recks.org>.
Ross Bamford wrote:
> Hi all,
>
> Does anyone know of a way to do instanceof checks from VTL? At the
> moment I'm providing a simple isA method on objects, but I am thinking
> there must be another way...
You can use a tool... maybe the tool can take advantage of the
velocity internal introspector code.
OTOH, some folks would consider it breaking MVC philosofy to use
such code in templates.
:) Christoph Reck
>
> The isA method works, but (at the moment) only checks the actual
> classname (not superclasses). Before I go about working this out, I just
> wondered if I had missed something crucial ... ?
>
> Cheers,
> Ross
>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org