Class 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 Detail

      • 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
    • Constructor Detail

      • DefaultUrlMappingEvaluator

        public DefaultUrlMappingEvaluator​(org.springframework.context.ApplicationContext applicationContext)
    • Method Detail

      • evaluateMappings

        public java.util.List evaluateMappings​(org.springframework.core.io.Resource resource)
        Description copied from interface: UrlMappingEvaluator
        Evaluates URL mapping from the give Spring Resource
        Specified by:
        evaluateMappings in interface UrlMappingEvaluator
        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: UrlMappingEvaluator
        Evaluates mapping from the given class if possible
        Specified by:
        evaluateMappings in interface UrlMappingEvaluator
        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: UrlMappingEvaluator
        Evaluates mapping from the given closure if possible
        Specified by:
        evaluateMappings in interface UrlMappingEvaluator
        Parameters:
        closure - The closure to evaluate mapping from
        Returns:
        A list of UrlMapping instances
      • setClassLoader

        public void setClassLoader​(java.lang.ClassLoader classLoader)
        Specified by:
        setClassLoader in interface grails.core.support.ClassLoaderAware
      • setPluginManager

        public void setPluginManager​(grails.plugins.GrailsPluginManager pluginManager)
        Specified by:
        setPluginManager in interface grails.plugins.PluginManagerAware