From: <Web...@St...> - 2004-04-05 22:05:38
|
On Mon, 5 Apr 2004, Eric Ridge wrote: | On Apr 5, 2004, at 1:41 PM, Endre St=F8lsvik wrote: | > | > This is getting clearer - but why is "evaluate" there in the first | > place, | > then? Macro is an iface, right? Why are there two methods, | | Because WM can also be used to only affect the Context. You can do | this: | WebMacro wm =3D new WM(); | Context ctx =3D wm.getContext(); | Template t =3D wm.getTemplate("foobar.wm"); | t.evaluate(ctx); | Object foo =3D ctx.get("Foo"); | | And .write() was never called. Not by you, and not by the innards of | WM. Aha .. The evaluate() or write() is kinda "recursive"..? It would be marvelous if this was documented, -preferrably- right in the JavaDoc, include the little 5-liner within <core> tags as an example. Thanks, Endre |