velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davide Mora <d_m...@yahoo.com>
Subject Re: how cast an object? [my fault :(]
Date Thu, 29 Mar 2001 14:25:32 GMT

Hi! Forget about this question, was my fault,
everything work ok!
Thank you! 

--- Davide Mora <d_mora@yahoo.com> wrote:
> 
> Hi!
> 
> I have the following problem, i already found a
> workaround but i'm curious of know if there is a
> better way for make it.
> 
> I have the following classes:
> 
> public class Type
> {
>   ...
>   public String getName()
>   {
>     ...
>   }
> }
> 
> public class Classifier extends Type
> {
>   ...
>   public Classifier getParent()
>   {
>     ...
>   }
> }
> 
> public class Attribute
> {
>   /* Type or Classifier */
>   public Type getType()
>   {
>     ...
>   }
> }
> 
> before run my template i bind a collection of
> Attributes as "attributes", and in my template i try
> to access to access Classifier#getParent:
> 
> #foreach( $attr in $attributes)
>  $attr.type.parent.name
> #endif
> 
> .. and doesnt work.
> Maybe i'm wrong, but seems like the the class type
> of
> $attr.type was takend from the signature of
> Attribute#getType instead of from the instance of
> the
> returned object. I hope make sense.
> 
> Any other ideas?
> Davide
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get email at your own domain with Yahoo! Mail. 
> http://personal.mail.yahoo.com/?.refer=text


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/?.refer=text

Mime
View raw message