org.shept.org.springframework.web.servlet.mvc.delegation
Class ComponentUtils

java.lang.Object
  extended by org.shept.org.springframework.web.servlet.mvc.delegation.ComponentUtils

public abstract class ComponentUtils
extends Object

Version:
$$Id: ComponentUtils.java 119 2011-02-21 17:28:18Z aha $$
Author:
Andi

Field Summary
static String DEFAULT_SELECTOR
           
protected static org.apache.commons.logging.Log logger
          Logger that is available to subclasses
 
Constructor Summary
ComponentUtils()
           
 
Method Summary
static int addComponent(ComponentToken token, CommandWrapper wrapper)
          Add the Component wrapper after the position specified by token
static int addComponent(ComponentToken token, CommandWrapper wrapper, Integer index)
          Add the Component wrapper after the position specified by token If theres a valid index argument then add the compoent after the index
static void applyConfiguration(CommandWrapper wrapper, org.springframework.context.ApplicationContext ctx)
           
static TargetConfiguration getChainConfiguration(org.springframework.context.ApplicationContext ctx, ComponentToken token)
           
private static TargetConfiguration getChainConfiguration(org.springframework.context.ApplicationContext ctx, String linkName, String sourceName)
           
static TargetConfiguration getChainConfiguration(javax.servlet.http.HttpServletRequest request, ComponentToken token)
           
static String getChainConfigurationErrorMessage(org.springframework.context.ApplicationContext ctx, ComponentToken token)
           
static String getChainConfigurationErrorMessage(javax.servlet.http.HttpServletRequest request, ComponentToken token)
           
protected static List<TargetConfiguration> getChainConfigurations(org.springframework.context.ApplicationContext ctx, String sourceName)
           
static SubCommandProvider getCommand(org.springframework.web.servlet.ModelAndView modelAndView)
           
static Object getComponent(org.springframework.web.servlet.ModelAndView modelAndView, String pathName)
           
static Object getComponent(Object target, String pathName)
           
static String getComponentInfo(javax.servlet.http.HttpServletRequest request, InfoItem item, Object model)
           
static String getComponentInfo(javax.servlet.http.HttpServletRequest request, TargetConfiguration cc, Object model)
           
static Map<String,CommandWrapper> getComponentPathMap(SubCommandProvider command)
          Return a map contaning bind path as key and CommandWrapper as value
static SegmentConfiguration getConfiguration(org.springframework.context.ApplicationContext ctx, CommandWrapper wrapper)
           
static SegmentConfiguration getConfiguration(org.springframework.context.ApplicationContext ctx, ComponentToken token)
           
static SegmentConfiguration getConfiguration(org.springframework.context.ApplicationContext ctx, String tagName)
           
static SegmentConfiguration getConfiguration(javax.servlet.http.HttpServletRequest request, CommandWrapper wrapper)
           
static SegmentConfiguration getConfiguration(javax.servlet.http.HttpServletRequest request, ComponentToken token)
           
static Object getModel(ComponentToken token)
           
static Object getModelFromList(ComponentToken token)
           
static List<?> getModelsSelected(ComponentToken token)
           
static String getPropertyPathPrefix(String pathName)
           
static int lookupComponentIndex(ComponentToken token)
          Looking up the token's component index in the command list
static String lookupComponentPath(ComponentToken token)
          Looking up the token's component path
static CommandWrapper lookupComponentWrapper(ComponentToken token)
          Looking up the token's component wrapper
static CommandWrapper lookupComponentWrapper(ComponentToken token, int offset)
          Looking up the token's component wrapper
static int removeComponentsAfterIndex(ComponentToken token, Integer index)
          Remove all components after the specified index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.commons.logging.Log logger
Logger that is available to subclasses


DEFAULT_SELECTOR

public static String DEFAULT_SELECTOR
Constructor Detail

ComponentUtils

public ComponentUtils()
Method Detail

getModel

public static Object getModel(ComponentToken token)
Parameters:
-
token -
Returns:

getModelFromList

public static Object getModelFromList(ComponentToken token)
Parameters:
-
token -
Returns:

getModelsSelected

public static List<?> getModelsSelected(ComponentToken token)
Parameters:
-
token -
Returns:

lookupComponentIndex

public static int lookupComponentIndex(ComponentToken token)
Looking up the token's component index in the command list

Parameters:
token -
Returns:

lookupComponentPath

public static String lookupComponentPath(ComponentToken token)
Looking up the token's component path

Parameters:
token -
Returns:

getComponentPathMap

public static Map<String,CommandWrapper> getComponentPathMap(SubCommandProvider command)
Return a map contaning bind path as key and CommandWrapper as value

Parameters:
token -
Returns:

lookupComponentWrapper

public static CommandWrapper lookupComponentWrapper(ComponentToken token)
Looking up the token's component wrapper

Parameters:
token -
Returns:

lookupComponentWrapper

public static CommandWrapper lookupComponentWrapper(ComponentToken token,
                                                    int offset)
Looking up the token's component wrapper

Parameters:
token -
Returns:

removeComponentsAfterIndex

public static int removeComponentsAfterIndex(ComponentToken token,
                                             Integer index)
Remove all components after the specified index. If no index is specified then the passed component is taken as the last component

Parameters:
token -
index -
Returns:

addComponent

public static int addComponent(ComponentToken token,
                               CommandWrapper wrapper)
Add the Component wrapper after the position specified by token

Parameters:
token -
wrapper -
index -

addComponent

public static int addComponent(ComponentToken token,
                               CommandWrapper wrapper,
                               Integer index)
Add the Component wrapper after the position specified by token If theres a valid index argument then add the compoent after the index

Parameters:
token -
wrapper -
index -

getConfiguration

public static SegmentConfiguration getConfiguration(org.springframework.context.ApplicationContext ctx,
                                                    String tagName)
Parameters:
-
ctx -
tagName -
Returns:

applyConfiguration

public static void applyConfiguration(CommandWrapper wrapper,
                                      org.springframework.context.ApplicationContext ctx)
Parameters:
-
ctx -
wrapper -

getComponentInfo

public static String getComponentInfo(javax.servlet.http.HttpServletRequest request,
                                      InfoItem item,
                                      Object model)
Parameters:
-
wrapper -
ctx -
model -
selector -
Returns:

getComponentInfo

public static String getComponentInfo(javax.servlet.http.HttpServletRequest request,
                                      TargetConfiguration cc,
                                      Object model)
Parameters:
request -
cc -
model -
Returns:

getConfiguration

public static SegmentConfiguration getConfiguration(org.springframework.context.ApplicationContext ctx,
                                                    CommandWrapper wrapper)

getConfiguration

public static SegmentConfiguration getConfiguration(org.springframework.context.ApplicationContext ctx,
                                                    ComponentToken token)

getConfiguration

public static SegmentConfiguration getConfiguration(javax.servlet.http.HttpServletRequest request,
                                                    CommandWrapper wrapper)

getConfiguration

public static SegmentConfiguration getConfiguration(javax.servlet.http.HttpServletRequest request,
                                                    ComponentToken token)

getChainConfiguration

public static TargetConfiguration getChainConfiguration(javax.servlet.http.HttpServletRequest request,
                                                        ComponentToken token)

getChainConfiguration

public static TargetConfiguration getChainConfiguration(org.springframework.context.ApplicationContext ctx,
                                                        ComponentToken token)

getChainConfiguration

private static TargetConfiguration getChainConfiguration(org.springframework.context.ApplicationContext ctx,
                                                         String linkName,
                                                         String sourceName)
Parameters:
ctx -
linkName -
sourceName -
Returns:

getChainConfigurations

protected static List<TargetConfiguration> getChainConfigurations(org.springframework.context.ApplicationContext ctx,
                                                                  String sourceName)
Parameters:
ctx -
sourceName -
Returns:

getChainConfigurationErrorMessage

public static String getChainConfigurationErrorMessage(javax.servlet.http.HttpServletRequest request,
                                                       ComponentToken token)

getChainConfigurationErrorMessage

public static String getChainConfigurationErrorMessage(org.springframework.context.ApplicationContext ctx,
                                                       ComponentToken token)

getPropertyPathPrefix

public static String getPropertyPathPrefix(String pathName)
Parameters:
-
path -
Returns:
the prefixed path name and append always the NESTED_PROPERTY_SEPARATOR to the end

getComponent

public static Object getComponent(Object target,
                                  String pathName)
Parameters:
-
target -
pathName -
Returns:

getCommand

public static SubCommandProvider getCommand(org.springframework.web.servlet.ModelAndView modelAndView)
Parameters:
-
modelAndView -
Returns:

getComponent

public static Object getComponent(org.springframework.web.servlet.ModelAndView modelAndView,
                                  String pathName)
Parameters:
-
modelAndView -
pathName -
Returns:


Copyright © 2011. All Rights Reserved.