Class ResponseCodeUrlMapping

  • All Implemented Interfaces:
    UrlCreator, UrlMapping, java.lang.Comparable

    public class ResponseCodeUrlMapping
    extends AbstractUrlMapping
    A Url mapping for http response codes.
    Since:
    1.0-RC1
    • Constructor Summary

      Constructors 
      Constructor Description
      ResponseCodeUrlMapping​(UrlMappingData urlData, 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)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(java.lang.Object o)  
      java.lang.String createRelativeURL​(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.util.Map values, java.lang.String encoding)
      Creates a URL for the given parameters values, controller and action names without the context path information
      java.lang.String createRelativeURL​(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.util.Map values, java.lang.String encoding, java.lang.String fragment)
      Creates a URL for the given parameters values, controller and action names without the context path information
      java.lang.String createRelativeURL​(java.lang.String controller, java.lang.String action, java.lang.String pluginName, java.util.Map values, java.lang.String encoding)
      Creates a URL for the given parameters values, controller and action names without the context path information
      java.lang.String createRelativeURL​(java.lang.String controller, java.lang.String action, java.util.Map values, java.lang.String encoding)
      Creates a URL for the given parameters values, controller and action names without the context path information
      java.lang.String createRelativeURL​(java.lang.String controller, java.lang.String action, java.util.Map values, java.lang.String encoding, java.lang.String fragment)
      Creates a URL for the given parameters values, controller and action names without the context path information
      java.lang.String createURL​(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.util.Map values, java.lang.String encoding)
      Creates a URL for the given parameters values, controller and action names
      java.lang.String createURL​(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.util.Map values, java.lang.String encoding, java.lang.String fragment)
      Creates a URL for the given parameters values, controller and action names
      java.lang.String createURL​(java.lang.String controller, java.lang.String action, java.lang.String pluginName, java.util.Map values, java.lang.String encoding)
      Creates a URL for the given parameters values, controller and action names
      java.lang.String createURL​(java.lang.String controller, java.lang.String action, java.util.Map values, java.lang.String encoding)
      Creates a URL for the given parameters values, controller and action names
      java.lang.String createURL​(java.lang.String controller, java.lang.String action, java.util.Map values, java.lang.String encoding, java.lang.String fragment)
      Creates a URL for the given parameters values, controller and action names
      java.lang.String createURL​(java.util.Map values, java.lang.String encoding)
      Creates a URL for the given parameter values
      java.lang.String createURL​(java.util.Map values, java.lang.String encoding, java.lang.String fragment)
      Creates a URL for the given parameter values
      java.lang.Object getActionName()
      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
      grails.gorm.validation.ConstrainedProperty[] getConstraints()
      The constraints the apply to this UrlMapping.
      java.lang.Object getControllerName()
      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
      java.lang.Class<?> getExceptionType()  
      UrlMappingData getUrlData()
      Retrieves the UrlMappingData instance that describes this UrlMapping
      java.lang.Object getViewName()
      Returns the name of the view to map to
      UrlMappingInfo match​(int responseCode)  
      UrlMappingInfo match​(java.lang.String uri)
      Matches the given URI and returns an instance of the UrlMappingInfo interface or null if a match couldn't be established
      void setExceptionType​(java.lang.Class<?> exClass)  
      void setParameterValues​(java.util.Map parameterValues)
      Sets any parameter values that should be populated into the request
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ResponseCodeUrlMapping

        public ResponseCodeUrlMapping​(UrlMappingData urlData,
                                      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)
    • Method Detail

      • match

        public UrlMappingInfo match​(java.lang.String uri)
        Description copied from interface: UrlMapping
        Matches the given URI and returns an instance of the UrlMappingInfo interface or null if a match couldn't be established
        Parameters:
        uri - The URI to match
        Returns:
        An instance of UrlMappingInfo or null if the URI doesn't match
      • getUrlData

        public UrlMappingData getUrlData()
        Description copied from interface: UrlMapping
        Retrieves the UrlMappingData instance that describes this UrlMapping
        Returns:
        The UrlMappingData instance
      • getConstraints

        public grails.gorm.validation.ConstrainedProperty[] 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
        Overrides:
        getConstraints in class AbstractUrlMapping
        Returns:
        An array containing the ConstrainedProperty objects of this URLMapping
        See Also:
        UrlMapping.getConstraints()
      • 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
        Overrides:
        getActionName in class AbstractUrlMapping
        Returns:
        The action name as a Closure or String
        See Also:
        UrlMapping.getActionName()
      • 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
        Overrides:
        setParameterValues in class AbstractUrlMapping
        Parameters:
        parameterValues - The parameter values to set
      • compareTo

        public int compareTo​(java.lang.Object o)
      • createURL

        public java.lang.String createURL​(java.util.Map values,
                                          java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameter values
        Parameters:
        values - The parameter values
        encoding - The encoding to use for parameters
        Returns:
        Returns the created URL for the given parameter values
      • createURL

        public java.lang.String createURL​(java.util.Map values,
                                          java.lang.String encoding,
                                          java.lang.String fragment)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameter values
        Parameters:
        values - The parameter values
        encoding - The encoding to use for parameters
        fragment - The URL fragment to be appended to the URL following a #
        Returns:
        Returns the created URL for the given parameter values
      • createURL

        public java.lang.String createURL​(java.lang.String controller,
                                          java.lang.String action,
                                          java.util.Map values,
                                          java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names
        Parameters:
        controller - The controller name
        action - The action name
        values - The parameter values
        encoding - The encoding to use for parameters
        Returns:
        The created URL for the given arguments
      • createURL

        public java.lang.String createURL​(java.lang.String controller,
                                          java.lang.String action,
                                          java.lang.String pluginName,
                                          java.util.Map values,
                                          java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names
        Parameters:
        controller - The controller name
        action - The action name
        pluginName - The name of the plugin which provides the controller
        values - The parameter values
        encoding - The encoding to use for parameters
        Returns:
        The created URL for the given arguments
      • createURL

        public java.lang.String createURL​(java.lang.String controller,
                                          java.lang.String action,
                                          java.lang.String namespace,
                                          java.lang.String pluginName,
                                          java.util.Map values,
                                          java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names
        Parameters:
        controller - The controller name
        action - The action name
        namespace - The controller namespace
        pluginName - The name of the plugin which provides the controller
        values - The parameter values
        encoding - The encoding to use for parameters
        Returns:
        The created URL for the given arguments
      • createRelativeURL

        public java.lang.String createRelativeURL​(java.lang.String controller,
                                                  java.lang.String action,
                                                  java.util.Map values,
                                                  java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names without the context path information
        Parameters:
        controller - The controller name
        action - The action name
        values - The parameter values
        encoding - The encoding to use for parameters
        Returns:
        The created URL for the given arguments
      • createRelativeURL

        public java.lang.String createRelativeURL​(java.lang.String controller,
                                                  java.lang.String action,
                                                  java.lang.String pluginName,
                                                  java.util.Map values,
                                                  java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names without the context path information
        Parameters:
        controller - The controller name
        action - The action name
        pluginName - The name of the plugin which provides the controller
        values - The parameter values
        encoding - The encoding to use for parameters
        Returns:
        The created URL for the given arguments
      • createRelativeURL

        public java.lang.String createRelativeURL​(java.lang.String controller,
                                                  java.lang.String action,
                                                  java.lang.String namespace,
                                                  java.lang.String pluginName,
                                                  java.util.Map values,
                                                  java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names without the context path information
        Parameters:
        controller - The controller name
        action - The action name
        namespace - The controller namespace
        pluginName - The name of the plugin which provides the controller
        values - The parameter values
        encoding - The encoding to use for parameters
        Returns:
        The created URL for the given arguments
      • createRelativeURL

        public java.lang.String createRelativeURL​(java.lang.String controller,
                                                  java.lang.String action,
                                                  java.util.Map values,
                                                  java.lang.String encoding,
                                                  java.lang.String fragment)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names without the context path information
        Parameters:
        controller - The controller name
        action - The action name
        values - The parameter values
        encoding - The encoding to use for parameters
        fragment - The fragment to append to the end
        Returns:
        The created URL for the given arguments
      • createRelativeURL

        public java.lang.String createRelativeURL​(java.lang.String controller,
                                                  java.lang.String action,
                                                  java.lang.String namespace,
                                                  java.lang.String pluginName,
                                                  java.util.Map values,
                                                  java.lang.String encoding,
                                                  java.lang.String fragment)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names without the context path information
        Parameters:
        controller - The controller name
        action - The action name
        namespace - The controller namespace
        pluginName - The name of the plugin which provides the controller
        values - The parameter values
        encoding - The encoding to use for parameters
        fragment - The fragment to append to the end
        Returns:
        The created URL for the given arguments
      • createURL

        public java.lang.String createURL​(java.lang.String controller,
                                          java.lang.String action,
                                          java.util.Map values,
                                          java.lang.String encoding,
                                          java.lang.String fragment)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names
        Parameters:
        controller - The controller name
        action - The action name
        values - The parameter values
        encoding - The encoding to use for parameters
        fragment - The URL fragment to be appended to the URL following a #
        Returns:
        The created URL for the given arguments
      • createURL

        public java.lang.String createURL​(java.lang.String controller,
                                          java.lang.String action,
                                          java.lang.String namespace,
                                          java.lang.String pluginName,
                                          java.util.Map values,
                                          java.lang.String encoding,
                                          java.lang.String fragment)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names
        Parameters:
        controller - The controller name
        action - The action name
        namespace - The controller namespace
        pluginName - The name of the plugin which provides the controller
        values - The parameter values
        encoding - The encoding to use for parameters
        fragment - The URL fragment to be appended to the URL following a #
        Returns:
        The created URL for the given arguments
      • setExceptionType

        public void setExceptionType​(java.lang.Class<?> exClass)
      • getExceptionType

        public java.lang.Class<?> getExceptionType()