public class WrappingLookupCommand extends Object implements org.apache.commons.chain.Filter
Variant on chain LookupCommand which can optionally wrap the context it passes to the looked up command in an alternative class.
Constructor and Description |
---|
WrappingLookupCommand()
Zero-argument constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
execute(org.apache.commons.chain.Context context)
Invoke the Command for a Context, returning TRUE if processing
should halt.
|
String |
getCatalogName()
Return CatalogName property.
|
protected org.apache.commons.chain.Command |
getCommand(org.apache.commons.chain.Context context)
Return the Command to process for this Context.
|
protected org.apache.commons.chain.Context |
getContext(org.apache.commons.chain.Context context)
If the wrapperClassName property is not null, return a Context of
the type specified by wrapperClassName, instantiated using a single-arg
constructor which takes the context passed as an argument to this
method.
|
String |
getName()
Retrieve Name property.
|
String |
getNameKey()
Return NameKey property.
|
String |
getWrapperClassName()
Return the WrapperClass property.
|
boolean |
isOptional()
Test Optional property.
|
boolean |
postprocess(org.apache.commons.chain.Context context,
Exception exception)
Process the Exception for any Command that is a filter.
|
void |
setCatalogName(String catalogName)
Set CatalogName property.
|
void |
setName(String name)
Set Name property.
|
void |
setNameKey(String nameKey)
Set NameKey property.
|
void |
setOptional(boolean optional)
Set Optional property.
|
void |
setWrapperClassName(String wrapperClassName)
Set WrappClassName property.
|
public String getCatalogName()
Return CatalogName property.
public void setCatalogName(String catalogName)
Set CatalogName property.
catalogName
- New value for CatalogNamepublic String getName()
Retrieve Name property.
public void setName(String name)
Set Name property.
name
- New value for Namepublic String getNameKey()
Return NameKey property.
public void setNameKey(String nameKey)
Set NameKey property.
nameKey
- New value for NameKeypublic boolean isOptional()
Test Optional property.
public void setOptional(boolean optional)
Set Optional property.
optional
- New value for Optionalpublic String getWrapperClassName()
Return the WrapperClass property.
public void setWrapperClassName(String wrapperClassName)
Set WrappClassName property.
wrapperClassName
- The name of a WrapperClasspublic boolean execute(org.apache.commons.chain.Context context) throws Exception
Invoke the Command for a Context, returning TRUE if processing should halt.
execute
in interface org.apache.commons.chain.Command
context
- Our ActionContextException
- On any errorpublic boolean postprocess(org.apache.commons.chain.Context context, Exception exception)
Process the Exception for any Command that is a filter.
postprocess
in interface org.apache.commons.chain.Filter
context
- Our ActionContextexception
- The Exception thrown by another Comamnd in a Chainprotected org.apache.commons.chain.Command getCommand(org.apache.commons.chain.Context context)
Return the Command to process for this Context.
context
- The Context we are processingprotected org.apache.commons.chain.Context getContext(org.apache.commons.chain.Context context) throws ClassNotFoundException, InstantiationException, InvocationTargetException, IllegalAccessException, NoSuchMethodException
If the wrapperClassName property is not null, return a Context of the type specified by wrapperClassName, instantiated using a single-arg constructor which takes the context passed as an argument to this method.
This method throws an exception if the wrapperClass cannot be found, or if there are any errors instantiating the wrapping context.
context
- Context we are processingClassNotFoundException
- On failed instantiationInstantiationException
- On failed instantiationInvocationTargetException
- On failed instantiationIllegalAccessException
- On failed instantiationNoSuchMethodException
- On failed instantiationCopyright © 2000–2017 Apache Software Foundation. All rights reserved.