Class DefaultUrlCreator

  • All Implemented Interfaces:
    UrlCreator

    public class DefaultUrlCreator
    extends java.lang.Object
    implements UrlCreator
    The default implementation of the UrlCreator interface that constructs URLs in Grails default pattern of /controllerName/actionName/id.
    Since:
    0.5.5
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String ARGUMENT_ID  
    • Constructor Summary

      Constructors 
      Constructor Description
      DefaultUrlCreator​(java.lang.String controller, java.lang.String action)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String createRelativeURL​(java.lang.String controller, java.lang.String action, java.lang.String namespace, java.lang.String pluginName, java.util.Map parameterValues, 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 parameterValues, 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 parameterValues, 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 parameterValues, 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 parameterValues, 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 parameterValues, 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 parameterValues, 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 parameterValues, 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 parameterValues, 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 parameterValues, 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 parameterValues, java.lang.String encoding)
      Creates a URL for the given parameter values
      java.lang.String createURL​(java.util.Map parameterValues, java.lang.String encoding, java.lang.String fragment)
      Creates a URL for the given parameter values
      • Methods inherited from class java.lang.Object

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

      • DefaultUrlCreator

        public DefaultUrlCreator​(java.lang.String controller,
                                 java.lang.String action)
    • Method Detail

      • createURL

        public java.lang.String createURL​(java.util.Map parameterValues,
                                          java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameter values
        Specified by:
        createURL in interface UrlCreator
        Parameters:
        parameterValues - 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 parameterValues,
                                          java.lang.String encoding,
                                          java.lang.String fragment)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameter values
        Specified by:
        createURL in interface UrlCreator
        Parameters:
        parameterValues - 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 parameterValues,
                                          java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names
        Specified by:
        createURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        parameterValues - 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 parameterValues,
                                          java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names
        Specified by:
        createURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        pluginName - The name of the plugin which provides the controller
        parameterValues - 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 parameterValues,
                                          java.lang.String encoding)
        Description copied from interface: UrlCreator
        Creates a URL for the given parameters values, controller and action names
        Specified by:
        createURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        namespace - The controller namespace
        pluginName - The name of the plugin which provides the controller
        parameterValues - 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 parameterValues,
                                                  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
        Specified by:
        createRelativeURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        parameterValues - 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 parameterValues,
                                                  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
        Specified by:
        createRelativeURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        pluginName - The name of the plugin which provides the controller
        parameterValues - 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 parameterValues,
                                                  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
        Specified by:
        createRelativeURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        namespace - The controller namespace
        pluginName - The name of the plugin which provides the controller
        parameterValues - 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 parameterValues,
                                                  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
        Specified by:
        createRelativeURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        parameterValues - 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 parameterValues,
                                                  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
        Specified by:
        createRelativeURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        namespace - The controller namespace
        pluginName - The name of the plugin which provides the controller
        parameterValues - 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 parameterValues,
                                          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
        Specified by:
        createURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        parameterValues - 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 parameterValues,
                                          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
        Specified by:
        createURL in interface UrlCreator
        Parameters:
        controller - The controller name
        action - The action name
        namespace - The controller namespace
        pluginName - The name of the plugin which provides the controller
        parameterValues - 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