jodd.madvoc.component
Class ActionMethodParser

java.lang.Object
  extended by jodd.madvoc.component.ActionMethodParser

public class ActionMethodParser
extends java.lang.Object

Creates action configurations from action java method. Reads all annotations and builds action path (i.e. configuration).

Invoked only during registration, therefore performance is not most important.

See Also:
ActionPathMapper

Field Summary
protected  MadvocConfig madvocConfig
           
protected static java.lang.String REPL_CLASS
           
protected static java.lang.String REPL_EXTENSION
           
protected static java.lang.String REPL_METHOD
           
protected static java.lang.String REPL_PACKAGE
           
 
Constructor Summary
ActionMethodParser()
           
 
Method Summary
protected  java.lang.String buildActionPath(java.lang.String packageActionPath, java.lang.String classActionPath, java.lang.String methodActionPath, java.lang.String extension)
          Builds action path.
protected  ActionConfig createActionConfig(java.lang.Class actionClass, java.lang.reflect.Method actionClassMethod, java.lang.Class<? extends ActionInterceptor>[] interceptorClasses, java.lang.String actionPath, java.lang.String actionMethod, java.lang.String actionPathExtension)
          Creates new instance of action configuration.
 ActionConfig parse(java.lang.Class<?> actionClass, java.lang.reflect.Method actionMethod)
           
 ActionConfig parse(java.lang.Class<?> actionClass, java.lang.reflect.Method actionMethod, java.lang.String actionPath)
          Parses java action method annotations and returns its action configuration.
protected  java.lang.String readClassActionPath(java.lang.Class actionClass)
          Reads action path from class.
protected  java.lang.Class<? extends ActionInterceptor>[] readClassInterceptors(java.lang.Class actionClass)
          Reads class interceptors when method interceptors are not available.
protected  java.lang.String readMethodActionPath(java.lang.String methodName, ActionAnnotationData annotationData)
          Reads action method.
protected  java.lang.String readMethodAlias(ActionAnnotationData annotationData)
          Reads method's alias value.
protected  java.lang.String readMethodExtension(ActionAnnotationData annotationData)
          Reads method's extension.
protected  java.lang.Class<? extends ActionInterceptor>[] readMethodInterceptors(java.lang.reflect.Method actionMethod)
          Reads method interceptors.
protected  java.lang.String readPackageActionPath(java.lang.Class actionClass)
          Reads action path for package.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

REPL_PACKAGE

protected static final java.lang.String REPL_PACKAGE
See Also:
Constant Field Values

REPL_CLASS

protected static final java.lang.String REPL_CLASS
See Also:
Constant Field Values

REPL_METHOD

protected static final java.lang.String REPL_METHOD
See Also:
Constant Field Values

REPL_EXTENSION

protected static final java.lang.String REPL_EXTENSION
See Also:
Constant Field Values

madvocConfig

@PetiteInject
protected MadvocConfig madvocConfig
Constructor Detail

ActionMethodParser

public ActionMethodParser()
Method Detail

parse

public ActionConfig parse(java.lang.Class<?> actionClass,
                          java.lang.reflect.Method actionMethod)

parse

public ActionConfig parse(java.lang.Class<?> actionClass,
                          java.lang.reflect.Method actionMethod,
                          java.lang.String actionPath)
Parses java action method annotations and returns its action configuration. Returns null if method is not a madvoc action.


buildActionPath

protected java.lang.String buildActionPath(java.lang.String packageActionPath,
                                           java.lang.String classActionPath,
                                           java.lang.String methodActionPath,
                                           java.lang.String extension)
Builds action path. Method action path and extension may be null.

Parameters:
packageActionPath - action path from package (optional)
classActionPath - action path from class
methodActionPath - action path from method (optional)
extension - extension (optional)

readClassInterceptors

protected java.lang.Class<? extends ActionInterceptor>[] readClassInterceptors(java.lang.Class actionClass)
Reads class interceptors when method interceptors are not available.


readMethodInterceptors

protected java.lang.Class<? extends ActionInterceptor>[] readMethodInterceptors(java.lang.reflect.Method actionMethod)
Reads method interceptors.


readPackageActionPath

protected java.lang.String readPackageActionPath(java.lang.Class actionClass)
Reads action path for package. It can be used only if root package is set in madvoc configuration. If annotation is not set on package-level, class package will be used for package action path part.


readClassActionPath

protected java.lang.String readClassActionPath(java.lang.Class actionClass)
Reads action path from class. If the class is annotated with MadvocAction annotation, class action path will be read from annotation value. Otherwise, action class path will be built from the class name. This is done by removing the package name and the last contained word (if there is more then one) from the class name. Such name is finally uncapitalized.

If this method returns null class will be ignored.


readMethodActionPath

protected java.lang.String readMethodActionPath(java.lang.String methodName,
                                                ActionAnnotationData annotationData)
Reads action method.


readMethodExtension

protected java.lang.String readMethodExtension(ActionAnnotationData annotationData)
Reads method's extension.


readMethodAlias

protected java.lang.String readMethodAlias(ActionAnnotationData annotationData)
Reads method's alias value.


createActionConfig

protected ActionConfig createActionConfig(java.lang.Class actionClass,
                                          java.lang.reflect.Method actionClassMethod,
                                          java.lang.Class<? extends ActionInterceptor>[] interceptorClasses,
                                          java.lang.String actionPath,
                                          java.lang.String actionMethod,
                                          java.lang.String actionPathExtension)
Creates new instance of action configuration.



Copyright © 2003-2011 Jodd Team