tomj74 / chunk-templates

Chunk Templates, a template engine for Java
http://www.x5software.com/chunk/
MIT License
77 stars 10 forks source link

No way to access tag that filter is being applied to within filter execution context. #7

Closed ebrandell-2 closed 9 years ago

ebrandell-2 commented 9 years ago

Hey Tom, I have to say first I love the framework, but the one thing that irks me is that there's no way to access, within a custom filter, the tag (including the name of the tag) that the filter is being applied to. I can attempt making the necessary changes to allow this unless there's something already planned for this?

Ideally, I'd love something like this:

public class ArgsFilter extends BasicFilter implements ChunkFilter
    @Override
    public String transformText(Chunk chunk, SnippetTag tag, String text, FilterArgs args) {    
        ...
    }

Without knowing the tag name that I'm applying the filter to, it makes it very difficult to work with our use case.

Any input would be greatly appreciated.

Thanks!

ebrandell-2 commented 9 years ago

Managed to work around it using an ObjectFilter, but this would still be very nice to have if possible. :)