org.loom.mapping
Class EventParameter

java.lang.Object
  extended by org.loom.mapping.EventParameter
All Implemented Interfaces:
AnnotationContainer

public class EventParameter
extends java.lang.Object
implements AnnotationContainer

Argument received by an Event


Constructor Summary
EventParameter()
           
 
Method Summary
 void addValidator(PropertyValidator validator)
           
<T extends java.lang.annotation.Annotation>
T
getAnnotation(java.lang.Class<T> annotationClass)
          If the parameter has the provided annotation, return it.
 java.lang.annotation.Annotation[] getAnnotations()
           
 Converter getConverter()
           
 java.lang.String getDisplayName()
           
 Event getEvent()
           
 int getIndex()
           
 ItemMetadata getItemMetadata(int index)
           
 int getItemMetadataSize()
           
 java.lang.String getName()
           
 java.lang.Class<?> getParameterType()
           
 java.lang.Object getPropertyAsObject(java.lang.Object container, java.lang.String propertyPath)
           
 java.lang.String getPropertyAsString(java.lang.Object container, java.lang.String propertyPath, MessagesRepository repository)
           
 PropertyBinder getPropertyBinder(java.lang.String normalizedPropertyPathWithPrefix)
           
 java.lang.Class getPropertyClass()
          this method exists only to comply with the implemented interface AnnotationContainer
 java.util.Set<PropertyValidator> getValidators(java.lang.String propertyPath)
           
 java.lang.Class<?> guessCollectionGenericType()
           
 java.lang.Class<?> guessMapGenericKeyType()
           
 java.lang.Class<?> guessMapGenericValueType()
           
 boolean isCollection()
           
 boolean isMap()
           
 boolean matches(java.lang.String propertyPath)
           
 java.lang.Object populate(java.lang.Object container, ServletRequestParameters parameters, MessagesRepository repository, Messages messages)
          Return the list of created parameter values for this request
 void setAnnotations(java.lang.annotation.Annotation[] annotations)
           
 void setConverter(Converter converter)
           
 void setEvent(Event event)
           
 void setIndex(int index)
           
 void setItemMetadata(ItemMetadata[] itemMetadata)
           
 void setName(java.lang.String name)
           
 void setParameterType(java.lang.Class<?> parameterType)
           
 void setPropertyAsObject(java.util.Map<java.lang.String,java.lang.Object> parameterValues, java.lang.String propertyPath, java.lang.Object value)
          Assigns value to some property nested inside this eventParameter
 void setPropertyBinderFactory(PropertyBinderFactory propertyBinderFactory)
           
 java.lang.String toString()
           
 void validate(java.lang.Object container, Messages messages)
          execute the validations configured for this event parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventParameter

public EventParameter()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

populate

public java.lang.Object populate(java.lang.Object container,
                                 ServletRequestParameters parameters,
                                 MessagesRepository repository,
                                 Messages messages)
Return the list of created parameter values for this request


validate

public void validate(java.lang.Object container,
                     Messages messages)
execute the validations configured for this event parameter

Parameters:
container - the event parameter value
messages - where validation errors will be added

getPropertyBinder

public PropertyBinder getPropertyBinder(java.lang.String normalizedPropertyPathWithPrefix)
Parameters:
normalizedPropertyPathWithPrefix - the property path including the parameter name

matches

public boolean matches(java.lang.String propertyPath)
Returns:
true if this EventParameter handles the proposed property path

getPropertyAsObject

public java.lang.Object getPropertyAsObject(java.lang.Object container,
                                            java.lang.String propertyPath)

getPropertyAsString

public java.lang.String getPropertyAsString(java.lang.Object container,
                                            java.lang.String propertyPath,
                                            MessagesRepository repository)

getName

public java.lang.String getName()
Specified by:
getName in interface AnnotationContainer
Returns:
the name of this method or property

setName

public void setName(java.lang.String name)

getParameterType

public java.lang.Class<?> getParameterType()

getPropertyClass

public java.lang.Class getPropertyClass()
this method exists only to comply with the implemented interface AnnotationContainer

Specified by:
getPropertyClass in interface AnnotationContainer
Returns:
the class of this property/parameter

setParameterType

public void setParameterType(java.lang.Class<?> parameterType)

getConverter

public Converter getConverter()

setConverter

public void setConverter(Converter converter)

setPropertyBinderFactory

public void setPropertyBinderFactory(PropertyBinderFactory propertyBinderFactory)

addValidator

public void addValidator(PropertyValidator validator)

getValidators

public java.util.Set<PropertyValidator> getValidators(java.lang.String propertyPath)

setAnnotations

public void setAnnotations(java.lang.annotation.Annotation[] annotations)

getAnnotations

public java.lang.annotation.Annotation[] getAnnotations()
Specified by:
getAnnotations in interface AnnotationContainer
Returns:
the list of annotations assigned to this container

getAnnotation

public <T extends java.lang.annotation.Annotation> T getAnnotation(java.lang.Class<T> annotationClass)
If the parameter has the provided annotation, return it. Else, return null.

Specified by:
getAnnotation in interface AnnotationContainer
Returns:
the instance of the provided annotation class, null if none is present.

getDisplayName

public java.lang.String getDisplayName()
Specified by:
getDisplayName in interface AnnotationContainer
Returns:
the name used to display error or informational messages

setPropertyAsObject

public void setPropertyAsObject(java.util.Map<java.lang.String,java.lang.Object> parameterValues,
                                java.lang.String propertyPath,
                                java.lang.Object value)
Assigns value to some property nested inside this eventParameter


getEvent

public Event getEvent()

setEvent

public void setEvent(Event event)

getIndex

public int getIndex()

setIndex

public void setIndex(int index)

guessCollectionGenericType

public java.lang.Class<?> guessCollectionGenericType()
Specified by:
guessCollectionGenericType in interface AnnotationContainer

guessMapGenericKeyType

public java.lang.Class<?> guessMapGenericKeyType()
Specified by:
guessMapGenericKeyType in interface AnnotationContainer

guessMapGenericValueType

public java.lang.Class<?> guessMapGenericValueType()
Specified by:
guessMapGenericValueType in interface AnnotationContainer

isCollection

public boolean isCollection()
Specified by:
isCollection in interface AnnotationContainer
Returns:
true if this property is a List, Set or Array

isMap

public boolean isMap()
Specified by:
isMap in interface AnnotationContainer
Returns:
true if this property is a Map

setItemMetadata

public void setItemMetadata(ItemMetadata[] itemMetadata)

getItemMetadata

public ItemMetadata getItemMetadata(int index)
Specified by:
getItemMetadata in interface AnnotationContainer

getItemMetadataSize

public int getItemMetadataSize()
Specified by:
getItemMetadataSize in interface AnnotationContainer