Re: Container types with interfaces
Attila Szegedi <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
On 2009.02.10., at 13:28, Alex Rau wrote:
> Ok, so according to your reply I consider the generics interface
> inside
> the container actually should not be (a known) problem.
No. I'm admittedly not using FreeMarker much myself with generic
types, but I heard of users who do, and they don't have problems with
it (there was one reported problem this summer that I fixed then).
FreeMarker relies on JavaBeans library, which is in turns reflection
based, and thanks to Java generics implementation, which erases
generic types at runtime, they can't really interfere with anything at
runtime :-)
> Thanks for your help.
You're welcome.
Attila.
> Regards Alex
>
>
> -------------------
>
>
> If getNextedProp() returns null, then foo.nestedProp?exists will
> indeed return false.
>
> Attila.
>
> On 2009.02.10., at 0:59, Alex Rau wrote:
>
>> Hi all,
>>
>> I've a question regarding supported types in freemarker. Is it
>> possible
>> to access a container on a class Foo as defined below in a freemarker
>> template ?
>>
>> public class Foo {
>>
>> private Map<String, IType<?>> nestedProp;
>>
>> public .. getNestedProp() {..}
>>
>> public setNestedProp(..) {..}
>>
>> }
>>
>> public interface IType<T> {
>>
>> public String getIdentifier();
>>
>> public String getDescription();
>>
>> public T getValues();
>>
>> }
>>
>> public class EnumType implements IType<Set<String>> {..}
>>
>> public class IntegerType implements IType<Set<Integer>> {..}
>>
>>
>>
>> When I try to access the property in a template by checking with
>> foo.nestedProp?exists the latter always returns false.
>>
>> I had a look on the docs and especially the beanwrapper description
>> but
>> could not find more infos about my specific question.
>>
>> Thanks and Regards,
>>
>> Alex
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com