Event.buildLink() Question

Is it possible to modify how urls are generated using buildLink() on a per-request basis?
e.g., I would like to change a handler used in buildLink urls during a specific request if isAjax() returns true.

You have a few options I can think of:

+ Overwrite the buildLink function with your own logic using a
requestContextDecorator.
+ Add logic to each call to buildLink to pass in a dynamic linkTo
string depending on isAjax.
+ Intercept preEvent and inspect the request to detect if it was
ajax. Switch the handler here. All your buildLink urls will be the
same you'd just switch over to the Ajax handler if the request was
ajax. (I think this would work best if I understand what you are
trying to do)

.brett