package com.cube.storm.ui.lib.factory;

import com.cube.storm.ui.view.View;
import com.cube.storm.ui.view.holder.Holder;

/**
 * This is the factory class which is used by Storm to help with getting the correct view holder/controller
 * for a specific view class name.
 *
 * @author Callum Taylor
 * @project StormUI
 */
public abstract class ViewFactory
{
	/**
	 * Gets the view holder class for a specific view name
	 *
	 * @param viewName The name of the view to lookup
	 *
	 * @return The view holder class or null if one was not found.
	 */
	public Class<? extends Holder> getHolderForView(String viewName)
	{
		return View.valueOf(viewName).getHolderClass();
	}
}

@@ -608,16 +608,27 @@
 ame)%0A%09%7B%0A
+%09%09try%0A%09%09%7B%0A%09
 %09%09return
@@ -669,13 +669,102 @@
 lass();%0A
+%09%09%7D%0A%09%09catch (IllegalArgumentException e)%0A%09%09%7B%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%0A%09%09return null;%0A
 %09%7D%0A%7D%0A

Return null in view factory if the view enum was not found