Class AbstractUrlMapping

    • Field Detail

      • constraints

        protected final grails.gorm.validation.ConstrainedProperty[] constraints
      • controllerName

        protected java.lang.Object controllerName
      • actionName

        protected java.lang.Object actionName
      • namespace

        protected java.lang.Object namespace
      • pluginName

        protected java.lang.Object pluginName
      • viewName

        protected java.lang.Object viewName
      • forwardURI

        protected java.lang.Object forwardURI
      • redirectInfo

        protected java.lang.Object redirectInfo
      • servletContext

        protected javax.servlet.ServletContext servletContext
      • grailsApplication

        protected grails.core.GrailsApplication grailsApplication
      • parameterValues

        protected java.util.Map parameterValues
      • parseRequest

        protected boolean parseRequest
      • mappingName

        protected java.lang.String mappingName
      • httpMethod

        protected java.lang.String httpMethod
      • version

        protected java.lang.String version
      • pluginIndex

        protected java.lang.Integer pluginIndex
    • Constructor Detail

      • AbstractUrlMapping

        public AbstractUrlMapping​(java.lang.Object redirectInfo,
                                  java.lang.Object controllerName,
                                  java.lang.Object actionName,
                                  java.lang.Object namespace,
                                  java.lang.Object pluginName,
                                  java.lang.Object viewName,
                                  grails.gorm.validation.ConstrainedProperty[] constraints,
                                  grails.core.GrailsApplication grailsApplication)
        Base constructor required to construct a UrlMapping instance
        Parameters:
        controllerName - The name of the controller
        actionName - The name of the action
        constraints - Any constraints that apply to the mapping
        grailsApplication - The GrailsApplication instance
      • AbstractUrlMapping

        protected AbstractUrlMapping​(java.lang.Object viewName,
                                     grails.gorm.validation.ConstrainedProperty[] constraints,
                                     grails.core.GrailsApplication grailsApplication)
      • AbstractUrlMapping

        protected AbstractUrlMapping​(java.net.URI uri,
                                     grails.gorm.validation.ConstrainedProperty[] constraints,
                                     grails.core.GrailsApplication grailsApplication)
    • Method Detail

      • getHttpMethod

        public java.lang.String getHttpMethod()
        Description copied from interface: UrlMapping
        The HTTP method this URL mapping applies to. Will be null for all HTTP methods
        Specified by:
        getHttpMethod in interface UrlMapping
        Returns:
        The HTTP method
      • getVersion

        public java.lang.String getVersion()
        Specified by:
        getVersion in interface UrlMapping
        Returns:
        The version of the URL mapping. Used for versioning of REST services
      • getConstraints

        public grails.gorm.validation.Constrained[] getConstraints()
        Description copied from interface: UrlMapping

        The constraints the apply to this UrlMapping. Each constraint maps to a GString token in a URL mapping in order. For example consider the URL:

         
             /blog/$author/$title/$year?/$month?/$day?
         

        This results in 5 ConstrainedProperty instances called author, title, year, month and day

        Specified by:
        getConstraints in interface UrlMapping
        Returns:
        An array containing the ConstrainedProperty objects of this URLMapping
        See Also:
        UrlMapping.getConstraints()
      • getControllerName

        public java.lang.Object getControllerName()
        Description copied from interface: UrlMapping
        Retrieves the controller name which is either a groovy.lang.Closure that evaluates the controller name at runtime or a java.lang.String that represents the controller name
        Specified by:
        getControllerName in interface UrlMapping
        Returns:
        The controller name as a Closure or String
        See Also:
        UrlMapping.getControllerName()
      • getActionName

        public java.lang.Object getActionName()
        Description copied from interface: UrlMapping
        Retrieves the action name which is either a groovy.lang.Closure that evaluates the action name at runtime or a java.lang.String that represents the action name
        Specified by:
        getActionName in interface UrlMapping
        Returns:
        The action name as a Closure or String
        See Also:
        UrlMapping.getActionName()
      • getPluginName

        public java.lang.Object getPluginName()
        Description copied from interface: UrlMapping
        The name of the plugin this URL mapping relates to, if any
        Specified by:
        getPluginName in interface UrlMapping
        Returns:
        The plugin name
      • getNamespace

        public java.lang.Object getNamespace()
        Specified by:
        getNamespace in interface UrlMapping
        Returns:
        the name of the controller namespace
      • setParameterValues

        public void setParameterValues​(java.util.Map parameterValues)
        Description copied from interface: UrlMapping
        Sets any parameter values that should be populated into the request
        Specified by:
        setParameterValues in interface UrlMapping
        Parameters:
        parameterValues - The parameter values to set
      • setParseRequest

        public void setParseRequest​(boolean shouldParse)
        Description copied from interface: UrlMapping
        Sets whether this UrlMapping should parse the request
        Specified by:
        setParseRequest in interface UrlMapping
        Parameters:
        shouldParse - True if it should
      • getMappingName

        public java.lang.String getMappingName()
        Description copied from interface: UrlMapping
        The name of the mapping in case of named URL mapping
        Specified by:
        getMappingName in interface UrlMapping
        Returns:
        The mapping name
      • setMappingName

        public void setMappingName​(java.lang.String name)
        Description copied from interface: UrlMapping
        Sets the name of the URL mapping
        Specified by:
        setMappingName in interface UrlMapping
        Parameters:
        name - The name of the URL mapping
      • hasRuntimeVariable

        public boolean hasRuntimeVariable​(java.lang.String name)
        Description copied from interface: UrlMapping
        Whether the mapping has a runtime variable with the given name such as "/$foo"
        Specified by:
        hasRuntimeVariable in interface UrlMapping
        Parameters:
        name - The name of the variable
        Returns:
        true if the mapping has the variable
      • getRedirectInfo

        public java.lang.Object getRedirectInfo()
        Description copied from interface: UrlMapping
        The redirect information should be a String or a Map. If it is a String that string is the URI to redirect to. If it is a Map, that Map may contain any entries supported as arguments to the dynamic redirect(Map) method on a controller.
        Specified by:
        getRedirectInfo in interface UrlMapping
        Returns:
        redirect information for this url mapping
      • setPluginIndex

        public void setPluginIndex​(int pluginIndex)
        Description copied from interface: UrlMapping
        Sets whether or not the mapping is defined in a plugin.
        Specified by:
        setPluginIndex in interface UrlMapping
        Parameters:
        pluginIndex - The index of the plugin that defines this mapping
      • getPluginIndex

        public java.lang.Integer getPluginIndex()
        Specified by:
        getPluginIndex in interface UrlMapping
        Returns:
        The plugin index or null
      • isDefinedInPlugin

        public boolean isDefinedInPlugin()
        Specified by:
        isDefinedInPlugin in interface UrlMapping
        Returns:
        True if the URL mapping comes from a plugin