Java

I Heart Filters

I was taking a look through the Wiki in a Jar source code when I took a look at the text file parser (the thing that takes the raw Wiki text and turns it into a HTML file). This code is one of the key elements of any Wiki implementation and I have to say that this one is the best I have seen yet.

The idea is simple: a collection of interface objects that are iterated over in order an execute on the String one at a time. Obviously you could revamp it with a StringBuffer and so on and so forth but the basic idea is so elegant and simple.

It's everything the Interceptor implementation should have been and really wasn't. I can't wait to give it a go on some "real world" code.

Standard

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s