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 wiki;

import org.stringtree.factory.AbstractStringFetcher;
import org.stringtree.factory.Fetcher;
import org.stringtree.factory.StringFetcher;
import org.stringtree.juicer.Initialisable;

public class RemoteWikiLink 
	extends AbstractStringFetcher
	implements Initialisable
{
	private StringFetcher remoteNames;
	
	public RemoteWikiLink(StringFetcher remoteNames)
	{
		this.remoteNames = remoteNames;
	}
	
	public RemoteWikiLink()
	{
		this(null);
	}
	
	public Object getObject(String key)
	{
		Object ret = (remoteNames == null) 
			? null 
			: remoteNames.getObject(key);

		if (ret != null)
		{
			ret = "\nremote{" + ret + "}";
		}
		else
		{
			ret = "\nunknown{" + ret + "}";
		}

		return ret;
	}

	public void init(Fetcher context)
	{
		if (context != null)
		{
			remoteNames = (StringFetcher)context.getObject("wiki.remoteNames");
		}
	}
}




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