|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.handler.AbstractHandlerMapping
org.riotfamily.common.web.mapping.AbstractReverseHandlerMapping
public abstract class AbstractReverseHandlerMapping
Abstract base class for mappings that support reverse look-ups.
Field Summary |
---|
Fields inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
logger |
Fields inherited from interface org.riotfamily.common.web.mapping.ReverseHandlerMapping |
---|
TOP_LEVEL_HANDLER_NAME_ATTRIBUTE |
Fields inherited from interface org.springframework.web.servlet.HandlerMapping |
---|
PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE |
Fields inherited from interface org.springframework.core.Ordered |
---|
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE |
Constructor Summary | |
---|---|
AbstractReverseHandlerMapping()
|
Method Summary | |
---|---|
protected String |
addServletMappingIfNecessary(String path,
UrlResolverContext context)
|
protected void |
exposeHandlerName(String beanName,
HttpServletRequest request)
Exposes the name of the matched handler as request attribute, unless the attribute is already present. |
protected Map<String,?> |
getDefaults(UrlResolverContext context)
Returns a Map of default values that are used to build URLs. |
protected AttributePattern |
getPatternForHandler(String handlerName,
String prefix,
UrlResolverContext context)
Returns the pattern for the handler with the given name. |
protected AttributePattern |
getPatternForHandler(String handlerName,
String prefix,
UrlResolverContext context,
Map<String,Object> attributes,
Map<String,?> defaults,
int anonymousWildcards)
Returns the pattern for the handler with the given name that contains all the given wildcards. |
protected List<AttributePattern> |
getPatternsForHandler(String handlerName,
String prefix,
UrlResolverContext context)
Returns all patterns for the handler with the
specified name that start with the given prefix. |
protected abstract List<AttributePattern> |
getPatternsForHandler(String beanName,
UrlResolverContext context)
Subclasses must implement this method and return all patterns for the handler with the specified
name. |
protected String |
getUrlForHandler(String handlerName,
String prefix,
Object attributes,
Map<String,?> defaults,
UrlResolverContext context)
Returns the URL of a mapped handler. |
String |
getUrlForHandler(String handlerName,
String prefix,
Object attributes,
UrlResolverContext context)
Returns the URL of a mapped handler. |
static Map<String,Object> |
getWildcardAttributes(HttpServletRequest request)
|
Methods inherited from class org.springframework.web.servlet.handler.AbstractHandlerMapping |
---|
adaptInterceptor, extendInterceptors, getAdaptedInterceptors, getDefaultHandler, getHandler, getHandlerExecutionChain, getHandlerInternal, getOrder, initApplicationContext, initInterceptors, setDefaultHandler, setInterceptors, setOrder |
Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport |
---|
getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext |
Methods inherited from class org.springframework.context.support.ApplicationObjectSupport |
---|
getApplicationContext, getMessageSourceAccessor, requiredContextClass, setApplicationContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractReverseHandlerMapping()
Method Detail |
---|
public String getUrlForHandler(String handlerName, String prefix, Object attributes, UrlResolverContext context)
getUrlForHandler
in interface ReverseHandlerMapping
handlerName
- The name of the handlerprefix
- Optional prefix to sort out ambiguitiesattributes
- Optional attributes to fill out wildcards. Can either
be null
, a primitive wrapper, a Map or a bean.request
- The current requestprotected Map<String,?> getDefaults(UrlResolverContext context)
null
.
protected String getUrlForHandler(String handlerName, String prefix, Object attributes, Map<String,?> defaults, UrlResolverContext context)
handlerName
- The name of the handlerprefix
- Optional prefix to sort out ambiguitiesattributes
- Optional attributes to fill out wildcards. Can either
be null
, a primitive wrapper, a Map or a bean.defaults
- Optional Map of default values that are used when no
attribute value was provided for a certain wildcard.request
- The current requestprotected List<AttributePattern> getPatternsForHandler(String handlerName, String prefix, UrlResolverContext context)
patterns
for the handler with the
specified name that start with the given prefix.
handlerName
- Name of the handlerprefix
- Optional prefix to narrow the the resultrequest
- The current requestprotected abstract List<AttributePattern> getPatternsForHandler(String beanName, UrlResolverContext context)
patterns
for the handler with the specified
name.
protected String addServletMappingIfNecessary(String path, UrlResolverContext context)
protected AttributePattern getPatternForHandler(String handlerName, String prefix, UrlResolverContext context, Map<String,Object> attributes, Map<String,?> defaults, int anonymousWildcards)
IllegalArgumentException
- if more than one mapping is registeredprotected AttributePattern getPatternForHandler(String handlerName, String prefix, UrlResolverContext context)
IllegalArgumentException
- if more than one mapping is registeredprotected void exposeHandlerName(String beanName, HttpServletRequest request)
ReverseHandlerMapping.TOP_LEVEL_HANDLER_NAME_ATTRIBUTE
public static Map<String,Object> getWildcardAttributes(HttpServletRequest request)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |