|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.loom.mapping.Event
public class Event
This class holds the internal data associated to an event.
Events are public methods in Action classes that return Resolution
and receive no arguments.
Constructor Summary | |
---|---|
Event(ActionMapping mapping,
java.lang.reflect.Method method)
|
Method Summary | ||
---|---|---|
void |
addEventParameter(EventParameter parameter)
|
|
void |
addInterceptor(Interceptor interceptor)
|
|
void |
addMethod(HttpMethod method)
Add an allowed http method to this event. |
|
void |
addValidator(PropertyValidator validator)
Adds a new parameter or attribute Validator. |
|
void |
assertNoOverlapping(Event other)
|
|
void |
decorate(Button button)
Modify button attributes based on the interceptors bound to this event. |
|
void |
decorate(Form form)
Modify form attributes based on the interceptors bound to this event. |
|
void |
decorate(Link link)
Modify link attributes based on the interceptors bound to this event. |
|
ActionMapping |
getActionMapping()
|
|
Converter |
getConverter(java.lang.String normalizedPropertyPath)
|
|
java.util.List<EventParameter> |
getEventParameters()
|
|
java.util.Set<HttpMethod> |
getHttpMethods()
|
|
InterceptorProxy |
getInterceptors()
|
|
java.lang.reflect.Method |
getJavaMethod()
|
|
java.lang.String |
getName()
|
|
java.lang.String |
getPrintName()
|
|
java.lang.Class<?> |
getPropertyClass(java.lang.String normalizedPropertyPath)
Return the property class of a normalized property path. |
|
java.util.Set<java.lang.String> |
getUriParameterNames()
|
|
UriParser |
getUriParser()
|
|
java.util.Collection<PropertyValidator> |
getValidators()
Deprecated. this method will be removed with no replacement |
|
java.util.Set<PropertyValidator> |
getValidatorsFor(java.lang.String propertyPath)
|
|
boolean |
isDefault()
|
|
|
matches(T annotation)
Return true if this event matches the "on", "except" clauses of the provided annotation instance |
|
java.util.Map<java.lang.String,java.lang.String> |
parse(java.lang.String uri,
LoomServletRequest request)
If this event is a match, return the list of parameter values extracted from the uri. |
|
void |
setInterceptorList(InterceptorProxy interceptorList)
|
|
void |
setUriParser(UriParser uriParser)
|
|
boolean |
supports(HttpMethod httpMethod)
|
|
java.lang.String |
toString()
|
|
java.lang.StringBuilder |
toUrl(com.google.common.collect.ListMultimap<java.lang.String,java.lang.String> params)
Prepare the string representatuion of this method with the provided params. |
|
void |
validate(ParsedAction action)
Applies all the configured validations to this object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Event(ActionMapping mapping, java.lang.reflect.Method method)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Class<?> getPropertyClass(java.lang.String normalizedPropertyPath)
normalizedPropertyPath
- the entire property pathpublic Converter getConverter(java.lang.String normalizedPropertyPath)
public java.util.Map<java.lang.String,java.lang.String> parse(java.lang.String uri, LoomServletRequest request)
uri
- the URI to be parsed, without the action handle.request
- the request object
public java.lang.String getName()
public java.lang.String getPrintName()
public void addValidator(PropertyValidator validator)
validator
- public void validate(ParsedAction action) throws MalformedPropertyPathException
action
- the action and list of error messages
MalformedPropertyPathException
public void assertNoOverlapping(Event other)
ConfigException
- if this Event is mapped to a URL that overlaps with another event for the same HTTP methodpublic java.lang.StringBuilder toUrl(com.google.common.collect.ListMultimap<java.lang.String,java.lang.String> params)
params
- the list of parameters to include in the URL.
public java.util.Set<java.lang.String> getUriParameterNames()
public void addInterceptor(Interceptor interceptor)
public java.lang.reflect.Method getJavaMethod()
public InterceptorProxy getInterceptors()
public void setInterceptorList(InterceptorProxy interceptorList)
public java.util.Collection<PropertyValidator> getValidators()
public java.util.Set<PropertyValidator> getValidatorsFor(java.lang.String propertyPath)
propertyPath
- the property path to retrieve validators
public ActionMapping getActionMapping()
public boolean isDefault()
public void decorate(Link link)
decorate
in interface LinkDecorator
public void decorate(Form form)
decorate
in interface FormDecorator
public void decorate(Button button)
decorate
in interface ButtonDecorator
public boolean supports(HttpMethod httpMethod)
public void addMethod(HttpMethod method)
method
- the method that should be allowedpublic UriParser getUriParser()
public void setUriParser(UriParser uriParser)
public java.util.Set<HttpMethod> getHttpMethods()
public java.util.List<EventParameter> getEventParameters()
public void addEventParameter(EventParameter parameter)
public <T extends java.lang.annotation.Annotation> boolean matches(T annotation)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |