devdaily home | apple | java | perl | unix | directory | blog

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

package com.efsol.friki;

import java.io.Reader;
import java.io.Writer;
import java.io.IOException;

import org.stringtree.factory.StringFetcher;
import org.stringtree.util.ReaderUtils;
import org.stringtree.util.StringUtils;

public abstract class TransformFilter 
	implements ContentFilter
{
	protected StringFetcher converter;
	
	public void filter(Reader reader, Writer out)
		throws IOException
	{
		String content = ReaderUtils.readReader(reader);
		content = converter.get(content);
		out.write(StringUtils.nullToEmpty(content));
	}

	public String makeLinkSource(String name)
	{
		return name;	
	}

	protected void setConverter(StringFetcher fetcher)
	{
		this.converter = fetcher;
	}
}




Copyright 1998-2008 Alvin Alexander
All Rights Reserved.
 
devdaily.com is based in louisville, kentucky, and this web site is hosted by godaddy.com