Re: Intercepting #set
Nathan Bubna <[email protected]> Fri, 6 Nov 2015 09:43:09 -0800
| Newsgroups | gmane.comp.jakarta.velocity.user |
|---|---|
| Message-ID | <CAFyaDjGiE96bhde+y_ws00jg6wHSyWUZgA42VRFbtZGL=SDWnQ@mail.gmail.com> |
That's an option. Or, since Velocity is open source, you could always hack on it. Whichever works best for you. :) Best luck with it! On Fri, Nov 6, 2015 at 4:16 AM, Paul Wellner Bou <[email protected]> wrote: > Thanks, Nathan, > > yes, thats useful, this way I get all variables used, at least. > Unfortunately I don't find a way to intercept something like > #set($var="whatever"). So I assume I will have to parse the vm file > manually searching for #set occurrences? > > Kind regards > Paul Wellner Bou > > On Thu, Nov 5, 2015 at 8:57 PM, Nathan Bubna <[email protected]> wrote: > > > You could configure a NullSetEventHandler to catch when the RHS is null. > > But i'm afraid the #set directive is deeply embedded, without a lot of > > hooks, much like #if. But perhaps one of the other available > EventHandler > > interfaces can help? > > > > > > > https://velocity.apache.org/engine/releases/velocity-1.7/apidocs/org/apache/velocity/app/event/EventHandler.html > > > > > http://velocity.apache.org/engine/devel/developer-guide.html#Configuring_Event_Handlers > > > > On Thu, Nov 5, 2015 at 2:27 AM, Paul Wellner Bou <[email protected]> > > wrote: > > > > > Hello, > > > > > > i am trying to write something analyzing our velocity file hell > > > automatically, showing direct (via #parse) or indirect (via declared > > > variables, #set) between vm files. > > > > > > I found a way to intercept the #parse directive ( > > > https://gist.github.com/paulwellnerbou/b0e53e7a045e8e90a840). Is this > > > possible with the #set directive as well? > > > > > > Thank you and best regards > > > Paul Wellner Bou > > > > > >