alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Friki example source code file (RemoteWikiLink.java)

This example Friki source code file (RemoteWikiLink.java) 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.

Java - Friki tags/keywords

abstractstringfetcher, abstractstringfetcher, initialisable, initialisable, object, object, remotewikilink, remotewikilink, stringfetcher

The Friki RemoteWikiLink.java 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");
		}
	}
}

Other Friki examples (source code examples)

Here is a short list of links related to this Friki RemoteWikiLink.java source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.