org.zkoss.zest.sys.impl
Class ActionDefinitionImpl

java.lang.Object
  extended by org.zkoss.zest.sys.impl.ActionDefinitionImpl
All Implemented Interfaces:
ActionDefinition

public class ActionDefinitionImpl
extends java.lang.Object
implements ActionDefinition

The default implementation of ActionDefinition, used by ParserImpl.

Author:
tomyeh

Constructor Summary
ActionDefinitionImpl(java.lang.String path, java.lang.Class<?> klass, java.lang.String method, java.util.Map<java.lang.String,ViewInfoProxy> results)
           
ActionDefinitionImpl(java.lang.String path, java.lang.String clsnm, java.lang.String method, java.util.Map<java.lang.String,ViewInfoProxy> results)
           
 
Method Summary
 java.lang.String execute(ActionContext ac, java.lang.Object action)
          Invokes the action.
 java.lang.Object getAction(ActionContext ac)
          Returns the action if the specified request matches this action definition, or null if not matched.
 ViewInfo getViewInfo(ActionContext ac, java.lang.String result)
          Returns the URI for the given result, or null if not matched.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionDefinitionImpl

public ActionDefinitionImpl(java.lang.String path,
                            java.lang.Class<?> klass,
                            java.lang.String method,
                            java.util.Map<java.lang.String,ViewInfoProxy> results)
                     throws java.lang.ClassNotFoundException
Parameters:
klass - the class of the action
results - a map of result to the view's URI
Throws:
java.lang.ClassNotFoundException

ActionDefinitionImpl

public ActionDefinitionImpl(java.lang.String path,
                            java.lang.String clsnm,
                            java.lang.String method,
                            java.util.Map<java.lang.String,ViewInfoProxy> results)
                     throws java.lang.ClassNotFoundException
Parameters:
clsnm - the class's name. EL is allowed.
Throws:
java.lang.ClassNotFoundException
Method Detail

getAction

public java.lang.Object getAction(ActionContext ac)
                           throws java.lang.Exception
Description copied from interface: ActionDefinition
Returns the action if the specified request matches this action definition, or null if not matched. An action could be an instance of any object.

Specified by:
getAction in interface ActionDefinition
Throws:
java.lang.Exception

execute

public java.lang.String execute(ActionContext ac,
                                java.lang.Object action)
                         throws java.lang.Exception
Description copied from interface: ActionDefinition
Invokes the action.

Specified by:
execute in interface ActionDefinition
action - the action (never null) to invoke. It is the returned value of ActionDefinition.getAction(org.zkoss.zest.ActionContext).
Throws:
java.lang.Exception

getViewInfo

public ViewInfo getViewInfo(ActionContext ac,
                            java.lang.String result)
                     throws java.lang.Exception
Description copied from interface: ActionDefinition
Returns the URI for the given result, or null if not matched.

Specified by:
getViewInfo in interface ActionDefinition
result - the result of the execution of an action. It is the returned value of ActionDefinition.execute(org.zkoss.zest.ActionContext, java.lang.Object).
Throws:
java.lang.Exception


Copyright © 2005-2010 Potix Corporation. All Rights Reserved.