org.loom.mapping
Class ParsedAction

java.lang.Object
  extended by org.loom.mapping.ParsedAction

public class ParsedAction
extends java.lang.Object

The current action and event object, as parsed from the URL


Constructor Summary
ParsedAction(ActionMapping actionMapping, Action action, Event event, Messages messages, LoomServletRequest request, LoomServletResponse response)
           
 
Method Summary
 void afterCreate()
           
 void beforeExecute()
           
 void beforePopulate()
           
 void beforeResolution(Resolution resolution)
           
 void beforeValidate()
           
 void doFinally(java.lang.Exception e)
           
 Action getAction()
           
 ActionMapping getActionMapping()
           
 Event getEvent()
           
 java.lang.Object getEventParameterValue(java.lang.String name)
           
 java.util.Map<java.lang.String,java.lang.Object> getEventParameterValues()
           
 Messages getMessages()
           
 java.lang.Object getPropertyAsObject(java.lang.String propertyPath)
           
 java.lang.String getPropertyAsString(java.lang.String propertyPath)
           
 LoomServletRequest getRequest()
           
 LoomServletResponse getResponse()
           
 boolean hasAnyError()
           
 boolean hasAnyError(java.lang.String name)
           
 Resolution invokeEvent()
          Invokes an event inside an action
 boolean matches(ActionMapping candidateAction, java.lang.String candidateEvent)
          A ParsedAction matches the provided params if it has the same action and event that are passed as parameters
 boolean matches(java.lang.String candidateAction, java.lang.String candidateEvent)
           
 boolean matches(UrlBuilder urlBuilder)
          A ParsedAction matches a UrlBuilder if it has the same action and event and all the parameters included in the UrlBuilder have the same value.
 void onError()
           
 void populate(ServletRequestParameters parameters)
          Injects the request values into the action.
 void setAction(Action action)
           
 void setEvent(Event event)
           
 void setEventParameterValues(java.util.Map<java.lang.String,java.lang.Object> eventParameterValues)
           
 void setMessages(Messages messages)
           
 void setPropertyAsObject(java.lang.String propertyPath, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsedAction

public ParsedAction(ActionMapping actionMapping,
                    Action action,
                    Event event,
                    Messages messages,
                    LoomServletRequest request,
                    LoomServletResponse response)
Method Detail

populate

public void populate(ServletRequestParameters parameters)
Injects the request values into the action. Will skip any parameter that has been marked as already processed (by a prior phase)

Parameters:
parameters - the list of processed values from the LoomServletRequest

getPropertyAsString

public java.lang.String getPropertyAsString(java.lang.String propertyPath)
Returns:
the required property value in the current parsed action

getPropertyAsObject

public java.lang.Object getPropertyAsObject(java.lang.String propertyPath)
Returns:
the required property value in the current parsed action

setPropertyAsObject

public void setPropertyAsObject(java.lang.String propertyPath,
                                java.lang.Object value)

afterCreate

public void afterCreate()
                 throws WorkflowInterruption
Throws:
WorkflowInterruption

beforePopulate

public void beforePopulate()
                    throws WorkflowInterruption
Throws:
WorkflowInterruption

beforeValidate

public void beforeValidate()
                    throws WorkflowInterruption
Throws:
WorkflowInterruption

beforeExecute

public void beforeExecute()
                   throws WorkflowInterruption
Throws:
WorkflowInterruption

beforeResolution

public void beforeResolution(Resolution resolution)

onError

public void onError()
             throws WorkflowInterruption
Throws:
WorkflowInterruption

doFinally

public void doFinally(java.lang.Exception e)

getAction

public Action getAction()

getEvent

public Event getEvent()

setAction

public void setAction(Action action)

setEvent

public void setEvent(Event event)

getMessages

public Messages getMessages()

setMessages

public void setMessages(Messages messages)

getActionMapping

public ActionMapping getActionMapping()

hasAnyError

public boolean hasAnyError(java.lang.String name)
Parameters:
name - the name of the input tag (the property path)
Returns:
true if the component has any associated error

hasAnyError

public boolean hasAnyError()
Returns:
true if exists any error

getRequest

public LoomServletRequest getRequest()
Returns:
true if the target action class is the same or a subclass of this one. / public boolean isAssignableFrom(TargetAction targetAction) { Class targetActionClass = targetAction.getActionMapping().getActionClass(); return action.getClass().isAssignableFrom(targetActionClass); }

invokeEvent

public Resolution invokeEvent()
Invokes an event inside an action


getResponse

public LoomServletResponse getResponse()

matches

public boolean matches(UrlBuilder urlBuilder)
A ParsedAction matches a UrlBuilder if it has the same action and event and all the parameters included in the UrlBuilder have the same value. Note that the ParsedAction can have MORE parameters than the ones included in the UrlBuilder, and still return true.

Returns:
true if this action matches the provided UrlBuilder.

matches

public boolean matches(ActionMapping candidateAction,
                       java.lang.String candidateEvent)
A ParsedAction matches the provided params if it has the same action and event that are passed as parameters

Returns:
true if action and event match

getEventParameterValues

public java.util.Map<java.lang.String,java.lang.Object> getEventParameterValues()

setEventParameterValues

public void setEventParameterValues(java.util.Map<java.lang.String,java.lang.Object> eventParameterValues)

getEventParameterValue

public java.lang.Object getEventParameterValue(java.lang.String name)

matches

public boolean matches(java.lang.String candidateAction,
                       java.lang.String candidateEvent)