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.

Author:
icoloma

Constructor Summary
ActionMapping()
           
 
Method Summary
 void addInterceptor(PathMatcher pathMatcher, Interceptor interceptor)
          Adds an interceptor to all events that match the interceptor event filter
 void addValidator(PathMatcher pathMatcher, PropertyValidator validator)
          Adds a validator to all events that match the validator event filter
 java.lang.Class<? extends Action> getActionClass()
           
 java.lang.String getBeanName()
           
 Converter getConverter(java.lang.String normalizedName)
           
 Event getDefaultEvent()
           
 Event getEvent(java.lang.String event)
           
 java.util.Map<java.lang.String,Event> getEvents()
           
 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 setBeanName(java.lang.String beanName)
           
 void setDefaultEvent(Event defaultEvent)
           
 void setEvents(java.util.Map<java.lang.String,Event> events)
           
 void setHandle(java.lang.String handle)
          This method revises the slash at the beginning and end of the handle before assigning the field.
 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. If there is no event specified and no default event, throw an exception.

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

addInterceptor

public void addInterceptor(PathMatcher pathMatcher,
                           Interceptor interceptor)
Adds an interceptor to all events that match the interceptor event filter

Parameters:
pathMatcher - indicates the events where this interceptor should be registered, null for all.
interceptor - the interceptor 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 normalizedName)
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
Throws:
java.lang.IllegalArgumentException - if the property was not found

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)

getBeanName

public java.lang.String getBeanName()

setBeanName

public void setBeanName(java.lang.String beanName)


The Loom Framework 1.6-SNAPSHOT.
Licensed under the Apache License, Version 2.0 by Extrema Sistemas de Informacion S.L.