| Package: MachII.framework.commands |
| Inherits from: framework.EventCommand |
| An EventCommand for putting an event arg into the current event. |
| Method Summary | |
|---|---|
| public void | init(string argName, [string argValue=""], [string argVariable=""]) |
| public boolean | execute(Event event, EventContext eventContext) |
| private string | getArgName() |
| private string | getArgValue() |
| private string | getArgVariable() |
| private any | getArgVariableValue() |
| private boolean | isArgValueDefined() |
| private boolean | isArgVariableDefined() |
| private void | setArgName(string argName) |
| private void | setArgValue(string argValue) |
| private void | setArgVariable(string argVariable) |
| Methods inherited from framework.EventCommand: setParameter , getParameter , setParameters |
|---|
| Method Detail |
|---|
| execute |
|---|
public boolean execute( Event event, EventContext eventContext )
Parameters:
| Event event |
| EventContext eventContext |
Code:
<cffunction name="execute" access="public" returntype="boolean"> <cfargument name="event" type="MachII.framework.Event" required="true" /> <cfargument name="eventContext" type="MachII.framework.EventContext" required="true" /> <cfset var value = "" /> <cfif isArgVariableDefined()> <cfset value = getArgVariableValue() /> <cfelseif isArgValueDefined()> <cfset value = getArgValue() /> <cfelse> <cfset value = "" /> </cfif> <cfset arguments.event.setArg(getArgName(), value) /> <cfreturn true /> </cffunction>
| getArgName |
|---|
private string getArgName( )
Parameters:
Code:
<cffunction name="getArgName" access="private" returntype="string" output="false"> <cfreturn variables.argName /> </cffunction>
| getArgValue |
|---|
private string getArgValue( )
Parameters:
Code:
<cffunction name="getArgValue" access="private" returntype="string" output="false"> <cfreturn variables.argValue /> </cffunction>
| getArgVariable |
|---|
private string getArgVariable( )
Parameters:
Code:
<cffunction name="getArgVariable" access="private" returntype="string" output="false"> <cfreturn variables.argVariable /> </cffunction>
| getArgVariableValue |
|---|
private any getArgVariableValue( )
Parameters:
Code:
<cffunction name="getArgVariableValue" access="private" returntype="any" output="false"> <cfset var value = "" /> <cfif IsDefined(getArgVariable())> <cfset value = Evaluate(getArgVariable()) /> </cfif> <cfreturn value /> </cffunction>
| init |
|---|
public void init( string argName, [string argValue=""], [string argVariable=""] )
Parameters:
| string argName |
| [string argValue=""] |
| [string argVariable=""] |
Code:
<cffunction name="init" access="public" returntype="void" output="false"> <cfargument name="argName" type="string" required="true" /> <cfargument name="argValue" type="string" required="false" default="" /> <cfargument name="argVariable" type="string" required="false" default="" /> <cfset setArgName(arguments.argName) /> <cfset setArgValue(arguments.argValue) /> <cfset setArgVariable(arguments.argVariable) /> </cffunction>
| isArgValueDefined |
|---|
private boolean isArgValueDefined( )
Parameters:
Code:
<cffunction name="isArgValueDefined" access="private" returntype="boolean" output="false"> <cfreturn NOT getArgValue() EQ '' /> </cffunction>
| isArgVariableDefined |
|---|
private boolean isArgVariableDefined( )
Parameters:
Code:
<cffunction name="isArgVariableDefined" access="private" returntype="boolean" output="false"> <cfreturn NOT getArgVariable() EQ '' /> </cffunction>
| setArgName |
|---|
private void setArgName( string argName )
Parameters:
| string argName |
Code:
<cffunction name="setArgName" access="private" returntype="void" output="false"> <cfargument name="argName" type="string" required="true" /> <cfset variables.argName = arguments.argName /> </cffunction>
| setArgValue |
|---|
private void setArgValue( string argValue )
Parameters:
| string argValue |
Code:
<cffunction name="setArgValue" access="private" returntype="void" output="false"> <cfargument name="argValue" type="string" required="true" /> <cfset variables.argValue = arguments.argValue /> </cffunction>
| setArgVariable |
|---|
private void setArgVariable( string argVariable )
Parameters:
| string argVariable |
Code:
<cffunction name="setArgVariable" access="private" returntype="void" output="false"> <cfargument name="argVariable" type="string" required="true" /> <cfset variables.argVariable = arguments.argVariable /> </cffunction>