Package org.grails.web.mapping
Class DefaultUrlMappingEvaluator
- java.lang.Object
-
- org.grails.web.mapping.DefaultUrlMappingEvaluator
-
- All Implemented Interfaces:
grails.core.support.ClassLoaderAware,grails.plugins.PluginManagerAware,UrlMappingEvaluator,org.springframework.beans.factory.Aware
public class DefaultUrlMappingEvaluator extends java.lang.Object implements UrlMappingEvaluator, grails.core.support.ClassLoaderAware, grails.plugins.PluginManagerAware
A UrlMapping evaluator that evaluates Groovy scripts that are in the form:
mappings { /$post/$year?/$month?/$day?" { controller = "blog" action = "show" constraints { year(matches:/\d{4}/) month(matches:/\d{2}/) } } }- Since:
- 0.5
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringACTION_CREATEstatic java.lang.StringACTION_DELETEstatic java.lang.StringACTION_EDITstatic java.lang.StringACTION_INDEXstatic java.lang.StringACTION_PATCHstatic java.lang.StringACTION_SAVEstatic java.lang.StringACTION_SHOWstatic java.lang.StringACTION_UPDATEstatic java.util.List<java.lang.String>DEFAULT_RESOURCE_INCLUDESstatic java.util.List<java.lang.String>DEFAULT_RESOURCES_INCLUDES
-
Constructor Summary
Constructors Constructor Description DefaultUrlMappingEvaluator(org.springframework.context.ApplicationContext applicationContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<UrlMapping>evaluateMappings(groovy.lang.Closure closure)Evaluates mapping from the given closure if possiblejava.util.List<UrlMapping>evaluateMappings(java.lang.Class theClass)Evaluates mapping from the given class if possiblejava.util.ListevaluateMappings(org.springframework.core.io.Resource resource)Evaluates URL mapping from the give Spring ResourcevoidsetClassLoader(java.lang.ClassLoader classLoader)voidsetPluginManager(grails.plugins.GrailsPluginManager pluginManager)
-
-
-
Field Detail
-
ACTION_CREATE
public static final java.lang.String ACTION_CREATE
- See Also:
- Constant Field Values
-
ACTION_INDEX
public static final java.lang.String ACTION_INDEX
- See Also:
- Constant Field Values
-
ACTION_SHOW
public static final java.lang.String ACTION_SHOW
- See Also:
- Constant Field Values
-
ACTION_EDIT
public static final java.lang.String ACTION_EDIT
- See Also:
- Constant Field Values
-
ACTION_UPDATE
public static final java.lang.String ACTION_UPDATE
- See Also:
- Constant Field Values
-
ACTION_PATCH
public static final java.lang.String ACTION_PATCH
- See Also:
- Constant Field Values
-
ACTION_DELETE
public static final java.lang.String ACTION_DELETE
- See Also:
- Constant Field Values
-
ACTION_SAVE
public static final java.lang.String ACTION_SAVE
- See Also:
- Constant Field Values
-
DEFAULT_RESOURCES_INCLUDES
public static final java.util.List<java.lang.String> DEFAULT_RESOURCES_INCLUDES
-
DEFAULT_RESOURCE_INCLUDES
public static final java.util.List<java.lang.String> DEFAULT_RESOURCE_INCLUDES
-
-
Method Detail
-
evaluateMappings
public java.util.List evaluateMappings(org.springframework.core.io.Resource resource)
Description copied from interface:UrlMappingEvaluatorEvaluates URL mapping from the give Spring Resource- Specified by:
evaluateMappingsin interfaceUrlMappingEvaluator- Parameters:
resource- The Spring Resource to evaluate mapping from- Returns:
- A list of UrlMapping instances
-
evaluateMappings
public java.util.List<UrlMapping> evaluateMappings(java.lang.Class theClass)
Description copied from interface:UrlMappingEvaluatorEvaluates mapping from the given class if possible- Specified by:
evaluateMappingsin interfaceUrlMappingEvaluator- Parameters:
theClass- The class to evaluate mapping from- Returns:
- A list of UrlMapping instances
-
evaluateMappings
public java.util.List<UrlMapping> evaluateMappings(groovy.lang.Closure closure)
Description copied from interface:UrlMappingEvaluatorEvaluates mapping from the given closure if possible- Specified by:
evaluateMappingsin interfaceUrlMappingEvaluator- Parameters:
closure- The closure to evaluate mapping from- Returns:
- A list of UrlMapping instances
-
setClassLoader
public void setClassLoader(java.lang.ClassLoader classLoader)
- Specified by:
setClassLoaderin interfacegrails.core.support.ClassLoaderAware
-
setPluginManager
public void setPluginManager(grails.plugins.GrailsPluginManager pluginManager)
- Specified by:
setPluginManagerin interfacegrails.plugins.PluginManagerAware
-
-