org.apache.shale.clay.component.chain
Class AbstractCommand

java.lang.Object
  extended by org.apache.shale.clay.component.chain.AbstractCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
AssignActionListenersCommand, AssignChildrenCommand, AssignConverterCommand, AssignPropertiesCommand, AssignValidatorsCommand, AssignValueChangeListenersCommand, AssignViewRootCommand, CreateActionListenerCommand, CreateComponentCommand, CreateConverterCommand, CreateValidatorCommand, CreateValueChangeListenerCommand, PropertyActionCommand, PropertyActionListenerCommand, PropertyConverterCommand, PropertyValidatorCommand, PropertyValueChangeListenerCommand, PropertyValueCommand

public abstract class AbstractCommand
extends Object
implements Command

The base class for the commands that create the component tree.


Field Summary
 
Fields inherited from interface org.apache.commons.chain.Command
CONTINUE_PROCESSING, PROCESSING_COMPLETE
 
Constructor Summary
AbstractCommand()
           
 
Method Summary
abstract  boolean execute(Context context)
           This method comes from the Command interfaces.
protected  Catalog getCatalog()
           Returns the Catalog with a name of Globals.CLAY_CATALOG_NAME in the Globals.CLAY_RESOURCE_NAME configuration file.
protected  Catalog getCustomizationCatalog()
           Returns the Catalog with a name identified by the constant Globals.CLAY_CUSTOMIZATION_CATALOG_NAME.
protected static org.apache.shale.util.Messages getMessages()
           
protected  org.apache.shale.util.Tags getTagUtils()
           
protected  boolean isValueReference(String value)
          Return true if the specified string contains an EL expression.
static void realizeSymbols(ClayContext context)
          Evaluates nested symbols.
static String replaceMnemonic(ClayContext context)
           This call is used to substitue an attribute binding expression containing the symbols with the target property value in the ClayContext.
static String replaceMnemonic(ClayContext context, String symbolToken)
           This call is used to substitue an attribute binding expression containing the symbols within the sybmolToken.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCommand

public AbstractCommand()
Method Detail

getMessages

protected static org.apache.shale.util.Messages getMessages()
Returns:
message resources

getTagUtils

protected org.apache.shale.util.Tags getTagUtils()
Returns:
Shale tag helper class that contains utility methods for setting component binding and method properties.

getCatalog

protected Catalog getCatalog()
                      throws Exception

Returns the Catalog with a name of Globals.CLAY_CATALOG_NAME in the Globals.CLAY_RESOURCE_NAME configuration file.

Returns:
commons chains catalog
Throws:
Exception - finding catalog

getCustomizationCatalog

protected Catalog getCustomizationCatalog()
                                   throws Exception

Returns the Catalog with a name identified by the constant Globals.CLAY_CUSTOMIZATION_CATALOG_NAME.

Returns:
commons chains customizations catalog
Throws:
Exception - finding customizations catalog

replaceMnemonic

public static String replaceMnemonic(ClayContext context)

This call is used to substitue an attribute binding expression containing the symbols with the target property value in the ClayContext. The current attribute within the context is assumed.

Parameters:
context - holding the symbols and the target attribute
Returns:
string with the symbols replaces

realizeSymbols

public static void realizeSymbols(ClayContext context)

Evaluates nested symbols. These are symbols that have references to other symbols as their values. The nested symbols evaluation is sensitive to dependencies. The current scoped symbol table is found in the ClayContext.

Parameters:
context - holding the symbols

replaceMnemonic

public static String replaceMnemonic(ClayContext context,
                                     String symbolToken)

This call is used to substitue an attribute binding expression containing the symbols within the sybmolToken.

Parameters:
context - commons chains holding the substitution symbols
symbolToken - target token having nested symbols
Returns:
value with the symbols replaced

execute

public abstract boolean execute(Context context)
                         throws Exception

This method comes from the Command interfaces. This method is invoked while executing the Chain.

Specified by:
execute in interface Command
Parameters:
context - commons chains
Returns:
true if the chain is done
Throws:
Exception - checked

isValueReference

protected boolean isValueReference(String value)

Return true if the specified string contains an EL expression.

This is taken almost verbatim from UIComponentTag in order to remove JSP dependencies from the renderers.

Parameters:
value - String to be checked for being an expression
Returns:
true if the value is a binding expression


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.