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, 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 from the Globals.CLAY_CATALOG_NAME in the Globals.CLAY_RESOURCE_NAME configuration file.
protected static org.apache.shale.util.Messages getMessages()
           
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

getCatalog

protected Catalog getCatalog()
                      throws Exception

Returns the Catalog from the Globals.CLAY_CATALOG_NAME in the Globals.CLAY_RESOURCE_NAME configuration file.

Returns:
commons chains catalog
Throws:
Exception - finding 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


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