Class MessageResourcesFactory

java.lang.Object
org.apache.struts.util.MessageResourcesFactory
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
PropertyMessageResourcesFactory

public abstract class MessageResourcesFactory extends Object implements Serializable
Factory for MessageResources instances. The general usage pattern for this class is:
  • Call MessageResourcesFactory().createFactory() to retrieve a MessageResourcesFactory instance.
  • Set properties as required to configure this factory instance to create MessageResources instances with desired characteristics.
  • Call the createResources() method of the factory to retrieve a newly instantiated MessageResources instance.
Version:
$Rev$ $Date: 2005-08-29 23:57:50 -0400 (Mon, 29 Aug 2005) $
See Also:
  • Field Details

    • clazz

      protected static transient Class<? extends MessageResourcesFactory> clazz
      The Java class to be used for MessageResourcesFactory instances.
    • factoryClass

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

      protected MessageResourcesConfig config
      Configuration information for Message Resources.
    • returnNull

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

    • MessageResourcesFactory

      public MessageResourcesFactory()
  • Method Details

    • getConfig

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

      public void setConfig(MessageResourcesConfig config)
      Return the configuration information for Message Resources.
      Since:
      Struts 1.2.8
    • 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.
    • 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.
    • 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
    • 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
    • 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
    • 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.