| Package: MachII.framework |
| Base Command component. |
| Method Summary | |
|---|---|
| public Command |
init()
Used by the framework for initialization. |
| public boolean |
execute(Event event, EventContext eventContext)
Overridden by the command that extends this component. |
| public any | getParameter(string name) |
| public void | setParameter(string name, any value) |
| public void |
setParameters(struct parameters)
Sets a struct of parameters to this command. |
| Method Detail |
|---|
| execute |
|---|
public boolean execute( Event event, EventContext eventContext )
Overridden by the command that extends this component.
Parameters:
| Event event |
| EventContext eventContext |
Code:
<cffunction name="execute" access="public" returntype="boolean" output="true" hint="Overridden by the command that extends this component."> <cfargument name="event" type="MachII.framework.Event" required="true" /> <cfargument name="eventContext" type="MachII.framework.EventContext" required="true" /> <cfreturn true /> </cffunction>
| getParameter |
|---|
public any getParameter( string name )
Parameters:
| string name |
Code:
<cffunction name="getParameter" access="public" returntype="any" output="false"> <cfargument name="name" type="string" required="true" /> <cfreturn variables.parameters[arguments.name] /> </cffunction>
| init |
|---|
public Command init( )
Used by the framework for initialization.
Parameters:
Code:
<cffunction name="init" access="public" returntype="Command" output="false" hint="Used by the framework for initialization."> <cfreturn this /> </cffunction>
| setParameter |
|---|
public void setParameter( string name, any value )
Parameters:
| string name |
| any value |
Code:
<cffunction name="setParameter" access="public" returntype="void" output="false"> <cfargument name="name" type="string" required="true" /> <cfargument name="value" type="any" required="true" /> <cfset variables.parameters[arguments.name] = arguments.value /> </cffunction>
| setParameters |
|---|
public void setParameters( struct parameters )
Sets a struct of parameters to this command.
Parameters:
| struct parameters |
Code:
<cffunction name="setParameters" access="public" returntype="void" output="false" hint="Sets a struct of parameters to this command."> <cfargument name="parameters" type="struct" required="true" /> <cfset var key = "" /> <cfloop collection="#arguments.parameters#" item="key"> <cfset setParameter(key, parameters[key]) /> </cfloop> </cffunction>