All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mockrunner.struts.MapMessageResourcesFactory Maven / Gradle / Ivy

There is a newer version: 2.0.7
Show newest version
package com.mockrunner.struts;

import java.util.Map;

import org.apache.struts.util.MessageResources;
import org.apache.struts.util.MessageResourcesFactory;

/**
 * Factory for {@link MapMessageResources}.
 * If you want this factory to be the default
 * factory used in your actions in the tests,
 * you should call
 * MessageResourcesFactory.setFactoryClass("com.mockrunner.struts.MapMessageResourcesFactory")
 */
public class MapMessageResourcesFactory extends MessageResourcesFactory
{
    private static Map theMessages;
    
    /**
     * Sets the messages Map for returned
     * {@link MapMessageResources} objects.
     * @param messages the message Map
     */
    public static void setMessageMap(Map messages)
    {
        theMessages = messages;
    }
    
    public MessageResources createResources(String config)
    {
        return new MapMessageResources(theMessages, this, config, this.returnNull);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy