use of jodd.madvoc.ActionNames in project jodd by oblac.
the class ActionMethodParser method parseActionDef.
/**
* Parses action class and method and creates {@link jodd.madvoc.ActionDef parsed action definition}.
*/
public ActionDef parseActionDef(final Class<?> actionClass, final Method actionMethod) {
ActionAnnotationData annotationData = detectActionAnnotationData(actionMethod);
// collector for all action names
final ActionNames actionNames = new ActionNames();
readPackageActionPath(actionNames, actionClass);
readClassActionPath(actionNames, actionClass);
readMethodActionPath(actionNames, actionMethod.getName(), annotationData);
readMethodExtension(actionNames, annotationData);
readMethodHttpMethod(actionNames, annotationData);
final Class<? extends ActionNamingStrategy> actionPathNamingStrategy = parseMethodNamingStrategy(annotationData);
ActionNamingStrategy namingStrategy;
try {
namingStrategy = actionPathNamingStrategy.newInstance();
contextInjectorComponent.injectContext(new Target(namingStrategy));
} catch (Exception ex) {
throw new MadvocException(ex);
}
return namingStrategy.buildActionDef(actionClass, actionMethod, actionNames);
}
Aggregations