org.loom.mapping
Class ActionMapping

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

public class ActionMapping
extends java.lang.Object

The mapping information about one Action class.


Constructor Summary
ActionMapping()
           
 
Method Summary
 void addValidator(PathMatcher pathMatcher, PropertyValidator validator)
          Adds a validator to all events that match the validator event filter
 Action createInstance()
           
 java.lang.Class<? extends Action> getActionClass()
           
 Converter getConverter(java.lang.String normalizedPropertyPath)
           
 Event getDefaultEvent()
           
 Event getEvent(java.lang.String event)
           
 java.util.Map<java.lang.String,Event> getEvents()
           
 java.lang.String getForwardFolder()
           
 java.lang.String getHandle()
           
 java.lang.String getLongName()
           
 PropertyBinder getPropertyBinder(java.lang.String normalizedPropertyPath)
           
 PropertyBinderMap getPropertyBinderMap()
           
 java.util.Set<java.lang.Class<?>> getReloadingClasses()
           
 java.lang.String getShortName()
           
 java.lang.Object getValueAsObject(Action action, java.lang.String propertyPath, MessagesRepository messagesRepository)
           
 java.lang.String getValueAsString(Action action, java.lang.String propertyPath, MessagesRepository repository)
           
 boolean isEvent(java.lang.String eventName)
           
 Event removeEvent(java.lang.String eventName)
          Remove an event from the list of available events
 void setActionClass(java.lang.Class<? extends Action> actionClass)
           
 void setDefaultEvent(Event defaultEvent)
           
 void setEvents(java.util.Map<java.lang.String,Event> events)
           
 void setForwardFolder(java.lang.String forwardFolder)
           
 void setHandle(java.lang.String handle)
          This method revises the slash at the beginning and end of the handle before assigning the field.
 void setPropertyAsObject(Action action, java.lang.String propertyPath, java.lang.Object value)
           
 void setPropertyBinderMap(PropertyBinderMap propertyBinderMap)
           
 void setReloadingClasses(java.util.Set<java.lang.Class<?>> reloadingClasses)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActionMapping

public ActionMapping()
Method Detail

getEvent

public Event getEvent(java.lang.String event)
Returns:
event metadata for the required event, the default event if none.
Throws:
EventNotFoundException - if the event is not found, or it has not been specified and no default event exists for this action.

getPropertyBinder

public PropertyBinder getPropertyBinder(java.lang.String normalizedPropertyPath)
Returns:
the propertyBinder bound to a normalized property path
Throws:
PropertyNotFoundException - if the property could not be found

addValidator

public void addValidator(PathMatcher pathMatcher,
                         PropertyValidator validator)
Adds a validator to all events that match the validator event filter

Parameters:
validator - the validator to be added

removeEvent

public Event removeEvent(java.lang.String eventName)
Remove an event from the list of available events

Parameters:
eventName - the name of the Event to be removed
Returns:
the removed Event, null if none

getConverter

public Converter getConverter(java.lang.String normalizedPropertyPath)
Returns:
the converter associated to the provided property, null if none. This method also returns null if the field is bound to an internal loom value

isEvent

public boolean isEvent(java.lang.String eventName)
Returns:
true if this ActionMapping contains one Event with the provided name

getShortName

public java.lang.String getShortName()
Returns:
the short name of this action, which is the action class name minus the optional suffix "Action"

getLongName

public java.lang.String getLongName()
Returns:
the long name of this action, which is the action class name

getActionClass

public java.lang.Class<? extends Action> getActionClass()

setActionClass

public void setActionClass(java.lang.Class<? extends Action> actionClass)

getValueAsString

public java.lang.String getValueAsString(Action action,
                                         java.lang.String propertyPath,
                                         MessagesRepository repository)
Returns:
the values of the specified property path inside this action instance

getValueAsObject

public java.lang.Object getValueAsObject(Action action,
                                         java.lang.String propertyPath,
                                         MessagesRepository messagesRepository)
Returns:
the values of the specified property path inside this action instance

setHandle

public void setHandle(java.lang.String handle)
This method revises the slash at the beginning and end of the handle before assigning the field.

Parameters:
handle -

getDefaultEvent

public Event getDefaultEvent()

setDefaultEvent

public void setDefaultEvent(Event defaultEvent)

getHandle

public java.lang.String getHandle()

getEvents

public java.util.Map<java.lang.String,Event> getEvents()

setPropertyBinderMap

public void setPropertyBinderMap(PropertyBinderMap propertyBinderMap)

getPropertyBinderMap

public PropertyBinderMap getPropertyBinderMap()

getReloadingClasses

public java.util.Set<java.lang.Class<?>> getReloadingClasses()

setEvents

public void setEvents(java.util.Map<java.lang.String,Event> events)

setReloadingClasses

public void setReloadingClasses(java.util.Set<java.lang.Class<?>> reloadingClasses)

setPropertyAsObject

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

getForwardFolder

public java.lang.String getForwardFolder()

setForwardFolder

public void setForwardFolder(java.lang.String forwardFolder)

createInstance

public Action createInstance()