Class AbstractSetLocaleCommand

  • All Implemented Interfaces:
    Command
    Direct Known Subclasses:
    PortletSetLocaleCommand, ServletSetLocaleCommand

    public abstract class AbstractSetLocaleCommand
    extends java.lang.Object
    implements Command

    Abstract base Command implementation for setting the response locale for this response to the Locale stored under the context attribute key returned by the localeKey property.

    Version:
    $Revision: 480477 $ $Date: 2006-11-29 08:34:52 +0000 (Wed, 29 Nov 2006) $
    Author:
    Craig R. McClanahan
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      boolean execute​(Context context)
      Retrieve the Locale stored under the specified context attribute key, and establish it on this response.
      java.lang.String getLocaleKey()
      Return the context attribute key under which we will retrieve the response Locale.
      protected abstract void setLocale​(Context context, java.util.Locale locale)
      Establish the specified Locale for this response.
      void setLocaleKey​(java.lang.String localeKey)
      Set the context attribute key under which we will retrieve the response Locale.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • localeKey

        private java.lang.String localeKey

        The context attribute key used to retrieve the Locale.

    • Constructor Detail

      • AbstractSetLocaleCommand

        public AbstractSetLocaleCommand()
    • Method Detail

      • getLocaleKey

        public java.lang.String getLocaleKey()

        Return the context attribute key under which we will retrieve the response Locale.

        Returns:
        The context attribute key of the request Locale.
      • setLocaleKey

        public void setLocaleKey​(java.lang.String localeKey)

        Set the context attribute key under which we will retrieve the response Locale.

        Parameters:
        localeKey - The new context attribute key
      • execute

        public boolean execute​(Context context)
                        throws java.lang.Exception

        Retrieve the Locale stored under the specified context attribute key, and establish it on this response.

        Specified by:
        execute in interface Command
        Parameters:
        context - The Context we are operating on
        Returns:
        false so that processng will continue
        Throws:
        java.lang.Exception - If an error occurs during execution.
      • setLocale

        protected abstract void setLocale​(Context context,
                                          java.util.Locale locale)

        Establish the specified Locale for this response.

        Parameters:
        context - The Context we are operating on.
        locale - The Locale for the request.