org.apache.struts.util

Class MessageResourcesFactory

Implemented Interfaces:
Serializable
Known Direct Subclasses:
PropertyMessageResourcesFactory

public abstract class MessageResourcesFactory
extends java.lang.Object
implements Serializable

Factory for MessageResources instances. The general usage pattern for this class is:
Version:
$Rev: 264684 $ $Date: 2005-08-30 04:08:01 +0100 (Tue, 30 Aug 2005) $

Field Summary

private static Log
LOG
Commons Logging instance.
protected static Class
clazz
The Java class to be used for MessageResourcesFactory instances.
protected MessageResourcesConfig
config
Configuration information for Message Resources.
protected static String
factoryClass
The fully qualified class name to be used for MessageResourcesFactory instances.
protected boolean
returnNull
The "return null" property value to which newly created MessageResourcess should be initialized.

Method Summary

static MessageResourcesFactory
createFactory()
Create and return a MessageResourcesFactory instance of the appropriate class, which can be used to create customized MessageResources instances.
abstract MessageResources
createResources(String config)
Create and return a newly instansiated MessageResources.
MessageResourcesConfig
getConfig()
Set the configuration information for Message Resources.
static String
getFactoryClass()
The fully qualified class name that is used for MessageResourcesFactory instances.
boolean
getReturnNull()
Get default value of the "returnNull" property used to initialize newly created MessageResourcess.
void
setConfig(MessageResourcesConfig config)
Return the configuration information for Message Resources.
static void
setFactoryClass(String factoryClass)
Set the fully qualified class name that is used for MessageResourcesFactory instances.
void
setReturnNull(boolean returnNull)
Set the default value of the "returnNull" property newly created MessageResourcess are initialized to.

Field Details

LOG

private static Log LOG
Commons Logging instance.

clazz

protected static Class clazz
The Java class to be used for MessageResourcesFactory instances.

config

protected MessageResourcesConfig config
Configuration information for Message Resources.

factoryClass

protected static String factoryClass
The fully qualified class name to be used for MessageResourcesFactory instances.

returnNull

protected boolean returnNull
The "return null" property value to which newly created MessageResourcess should be initialized.

Method Details

createFactory

public static MessageResourcesFactory createFactory()
Create and return a MessageResourcesFactory instance of the appropriate class, which can be used to create customized MessageResources instances. If no such factory can be created, return null instead.

createResources

public abstract MessageResources createResources(String config)
Create and return a newly instansiated MessageResources. This method must be implemented by concrete subclasses.
Parameters:
config - Configuration parameter(s) for the requested bundle

getConfig

public MessageResourcesConfig getConfig()
Set the configuration information for Message Resources.
Since:
Struts 1.2.8

getFactoryClass

public static String getFactoryClass()
The fully qualified class name that is used for MessageResourcesFactory instances.
Returns:
class name that is used for MessageResourcesFactory instances

getReturnNull

public boolean getReturnNull()
Get default value of the "returnNull" property used to initialize newly created MessageResourcess.
Returns:
default value of the "returnNull" property newly created MessageResourcess are initialized to.

setConfig

public void setConfig(MessageResourcesConfig config)
Return the configuration information for Message Resources.
Since:
Struts 1.2.8

setFactoryClass

public static void setFactoryClass(String factoryClass)
Set the fully qualified class name that is used for MessageResourcesFactory instances.
Parameters:
factoryClass - name that is used for MessageResourcesFactory instances

setReturnNull

public void setReturnNull(boolean returnNull)
Set the default value of the "returnNull" property newly created MessageResourcess are initialized to.
Parameters:
returnNull - default value of the "returnNull" MessageResourcess are initialized to.

Copyright B) 2000-2007 - The Apache Software Foundation