org.apache.commons.chain.web
Class AbstractGetLocaleCommand

java.lang.Object
  extended by org.apache.commons.chain.web.AbstractGetLocaleCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
FacesGetLocaleCommand, PortletGetLocaleCommand, ServletGetLocaleCommand

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

Abstract base Command implementation for retrieving the requested Locale from our Context, and storing it under the context attribute key returned by the localeKey property.

Version:
$Revision: 1.5 $ $Date: 2004/02/25 00:01:06 $
Author:
Craig R. McClanahan

Field Summary
private  java.lang.String localeKey
          The context attribute key used to store the Locale.
 
Constructor Summary
AbstractGetLocaleCommand()
           
 
Method Summary
 boolean execute(Context context)
          Retrieve the Locale for this request, and store it under the specified context attribute.
protected abstract  java.util.Locale getLocale(Context context)
          Retrieve and return the Locale for this request.
 java.lang.String getLocaleKey()
          Return the context attribute key under which we will store the request Locale.
 void setLocaleKey(java.lang.String localeKey)
          Set the context attribute key under which we will store the request 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 store the Locale.

Constructor Detail

AbstractGetLocaleCommand

public AbstractGetLocaleCommand()
Method Detail

getLocaleKey

public java.lang.String getLocaleKey()

Return the context attribute key under which we will store the request Locale.


setLocaleKey

public void setLocaleKey(java.lang.String localeKey)

Set the context attribute key under which we will store the request Locale.

Parameters:
localeKey - The new context attribute key

execute

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

Retrieve the Locale for this request, and store it under the specified context attribute.

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 - general purpose exception return to indicate abnormal termination
java.lang.IllegalArgumentException - if context is null

getLocale

protected abstract java.util.Locale getLocale(Context context)

Retrieve and return the Locale for this request.