use of jodd.madvoc.interceptor.ActionInterceptor in project jodd by oblac.
the class ActionMethodParser method parse.
/**
* Parses java action method annotation and returns its action configuration.
*
* @param actionClass action class
* @param actionMethod action method
* @param actionDef optional action def, usually <code>null</code> so to be parsed
*/
public ActionConfig parse(final Class<?> actionClass, final Method actionMethod, ActionDef actionDef) {
// interceptors
ActionInterceptor[] actionInterceptors = parseActionInterceptors(actionClass, actionMethod);
// filters
ActionFilter[] actionFilters = parseActionFilters(actionClass, actionMethod);
// build action definition when not provided
if (actionDef == null) {
actionDef = parseActionDef(actionClass, actionMethod);
}
ActionAnnotationData annotationData = detectActionAnnotationData(actionMethod);
detectAndRegisterAlias(annotationData, actionDef);
final boolean async = parseMethodAsyncFlag(annotationData);
final Class<? extends ActionResult> actionResult = parseActionResult(annotationData);
return createActionConfig(actionClass, actionMethod, actionResult, actionFilters, actionInterceptors, actionDef, async);
}
use of jodd.madvoc.interceptor.ActionInterceptor in project jodd by oblac.
the class ActionMethodParser method readActionInterceptors.
// ---------------------------------------------------------------- interceptors
/**
* Reads class or method annotation for action interceptors.
*/
protected Class<? extends ActionInterceptor>[] readActionInterceptors(AnnotatedElement actionClassOrMethod) {
Class<? extends ActionInterceptor>[] result = null;
InterceptedBy interceptedBy = actionClassOrMethod.getAnnotation(InterceptedBy.class);
if (interceptedBy != null) {
result = interceptedBy.value();
if (result.length == 0) {
result = null;
}
}
return result;
}
Aggregations