Re: Deprecation in data model

Ista Pouss <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
2009/12/31 Daniel Dekany <[email protected]>:
> Wednesday, December 30, 2009, 3:57:36 PM, Ista Pouss wrote:
>
> As far as FreeMarker is concerned, yes, but it's always a question if
> the framework your are using gives sufficiently low-level access to
> FreeMarker... Anyway, if it does, since "term" is a top-level data,
> you could use a custom TemplateHashModel implementation that does
> this. (If are using a java.util.Map as the data-model root, you could
> wrap it into your TemplateHashModel implementation just before passing
> to the template.process call)
>

Yes my root data model is a Map, so You say I do something like

template.process(new CustomTemplateHashModel(map), output);

and, in my Custom...

TemplateModel get(String key)
{
 if (deprecated(key))
   System.out.println("Damned! Deprecated!");
 return super.get(key);
}

Is it OK ?

But what's append if the deprecated term is, from root, thing in
"foo.bar.thing" ?

Thanks.

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.