grails.web.mapping.UrlMappingsFactory.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grails-web-url-mappings Show documentation
Show all versions of grails-web-url-mappings Show documentation
Grails Web Application Framework
The newest version!
package grails.web.mapping
import groovy.transform.CompileStatic
import org.grails.web.mapping.DefaultUrlMappingEvaluator
import org.grails.web.mapping.DefaultUrlMappingsHolder
import org.springframework.context.ApplicationContext
import org.springframework.context.ApplicationContextAware
/**
* Helper class for creating a {@link UrlMapping}. Useful for testing
*
* @author Graeme Rocher
* @since 3.1
*/
@CompileStatic
class UrlMappingsFactory implements ApplicationContextAware{
ApplicationContext applicationContext
UrlMappings create(Closure mappings) {
def evaluator = new DefaultUrlMappingEvaluator(applicationContext)
return new DefaultUrlMappingsHolder(evaluator.evaluateMappings(mappings))
}
UrlMappings create(Class mappings) {
def evaluator = new DefaultUrlMappingEvaluator(applicationContext)
return new DefaultUrlMappingsHolder(evaluator.evaluateMappings(mappings))
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy