Package org.grails.web.mapping
Class ResponseCodeUrlMapping
- java.lang.Object
-
- org.grails.web.mapping.AbstractUrlMapping
-
- org.grails.web.mapping.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
-
-
Field Summary
-
Fields inherited from class org.grails.web.mapping.AbstractUrlMapping
actionName, controllerName, forwardURI, grailsApplication, httpMethod, mappingName, namespace, parseRequest, pluginIndex, pluginName, redirectInfo, servletContext, version, viewName
-
Fields inherited from interface grails.web.mapping.UrlMapping
ACTION, AMPERSAND, ANY_HTTP_METHOD, ANY_VERSION, CAPTURED_DOUBLE_WILDCARD, CAPTURED_WILDCARD, CONTROLLER, DOUBLE_WILDCARD, EXCEPTION, EXCLUDES, HTTP_METHOD, INCLUDES, KEYWORDS, NAMESPACE, OPTIONAL_EXTENSION_WILDCARD, PERMANENT, PLUGIN, QUESTION_MARK, REDIRECT_INFO, RESOURCES, SLASH, URI, VERSION, VIEW, WILDCARD
-
-
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 intcompareTo(java.lang.Object o)java.lang.StringcreateRelativeURL(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 informationjava.lang.StringcreateRelativeURL(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 informationjava.lang.StringcreateRelativeURL(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 informationjava.lang.StringcreateRelativeURL(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 informationjava.lang.StringcreateRelativeURL(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 informationjava.lang.StringcreateURL(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 namesjava.lang.StringcreateURL(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 namesjava.lang.StringcreateURL(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 namesjava.lang.StringcreateURL(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 namesjava.lang.StringcreateURL(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 namesjava.lang.StringcreateURL(java.util.Map values, java.lang.String encoding)Creates a URL for the given parameter valuesjava.lang.StringcreateURL(java.util.Map values, java.lang.String encoding, java.lang.String fragment)Creates a URL for the given parameter valuesjava.lang.ObjectgetActionName()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 namegrails.gorm.validation.ConstrainedProperty[]getConstraints()The constraints the apply to this UrlMapping.java.lang.ObjectgetControllerName()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 namejava.lang.Class<?>getExceptionType()UrlMappingDatagetUrlData()Retrieves the UrlMappingData instance that describes this UrlMappingjava.lang.ObjectgetViewName()Returns the name of the view to map toUrlMappingInfomatch(int responseCode)UrlMappingInfomatch(java.lang.String uri)Matches the given URI and returns an instance of the UrlMappingInfo interface or null if a match couldn't be establishedvoidsetExceptionType(java.lang.Class<?> exClass)voidsetParameterValues(java.util.Map parameterValues)Sets any parameter values that should be populated into the request-
Methods inherited from class org.grails.web.mapping.AbstractUrlMapping
getHttpMethod, getMappingName, getNamespace, getPluginIndex, getPluginName, getRedirectInfo, getVersion, hasRuntimeVariable, isDefinedInPlugin, setMappingName, setParseRequest, setPluginIndex
-
-
-
-
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:UrlMappingMatches 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:UrlMappingRetrieves the UrlMappingData instance that describes this UrlMapping- Returns:
- The UrlMappingData instance
-
getConstraints
public grails.gorm.validation.ConstrainedProperty[] getConstraints()
Description copied from interface:UrlMappingThe 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:
getConstraintsin interfaceUrlMapping- Overrides:
getConstraintsin classAbstractUrlMapping- Returns:
- An array containing the ConstrainedProperty objects of this URLMapping
- See Also:
UrlMapping.getConstraints()
-
getControllerName
public java.lang.Object getControllerName()
Description copied from interface:UrlMappingRetrieves 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:
getControllerNamein interfaceUrlMapping- Overrides:
getControllerNamein classAbstractUrlMapping- Returns:
- The controller name as a
ClosureorString - See Also:
UrlMapping.getControllerName()
-
getActionName
public java.lang.Object getActionName()
Description copied from interface:UrlMappingRetrieves 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:
getActionNamein interfaceUrlMapping- Overrides:
getActionNamein classAbstractUrlMapping- Returns:
- The action name as a
ClosureorString - See Also:
UrlMapping.getActionName()
-
getViewName
public java.lang.Object getViewName()
Description copied from interface:UrlMappingReturns the name of the view to map to- Specified by:
getViewNamein interfaceUrlMapping- Overrides:
getViewNamein classAbstractUrlMapping- Returns:
- The view name
- See Also:
UrlMapping.getViewName()
-
setParameterValues
public void setParameterValues(java.util.Map parameterValues)
Description copied from interface:UrlMappingSets any parameter values that should be populated into the request- Specified by:
setParameterValuesin interfaceUrlMapping- Overrides:
setParameterValuesin classAbstractUrlMapping- 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:UrlCreatorCreates a URL for the given parameter values- Parameters:
values- The parameter valuesencoding- 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:UrlCreatorCreates a URL for the given parameter values- Parameters:
values- The parameter valuesencoding- The encoding to use for parametersfragment- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names- Parameters:
controller- The controller nameaction- The action namevalues- The parameter valuesencoding- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names- Parameters:
controller- The controller nameaction- The action namepluginName- The name of the plugin which provides the controllervalues- The parameter valuesencoding- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names- Parameters:
controller- The controller nameaction- The action namenamespace- The controller namespacepluginName- The name of the plugin which provides the controllervalues- The parameter valuesencoding- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names without the context path information- Parameters:
controller- The controller nameaction- The action namevalues- The parameter valuesencoding- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names without the context path information- Parameters:
controller- The controller nameaction- The action namepluginName- The name of the plugin which provides the controllervalues- The parameter valuesencoding- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names without the context path information- Parameters:
controller- The controller nameaction- The action namenamespace- The controller namespacepluginName- The name of the plugin which provides the controllervalues- The parameter valuesencoding- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names without the context path information- Parameters:
controller- The controller nameaction- The action namevalues- The parameter valuesencoding- The encoding to use for parametersfragment- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names without the context path information- Parameters:
controller- The controller nameaction- The action namenamespace- The controller namespacepluginName- The name of the plugin which provides the controllervalues- The parameter valuesencoding- The encoding to use for parametersfragment- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names- Parameters:
controller- The controller nameaction- The action namevalues- The parameter valuesencoding- The encoding to use for parametersfragment- 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:UrlCreatorCreates a URL for the given parameters values, controller and action names- Parameters:
controller- The controller nameaction- The action namenamespace- The controller namespacepluginName- The name of the plugin which provides the controllervalues- The parameter valuesencoding- The encoding to use for parametersfragment- The URL fragment to be appended to the URL following a #- Returns:
- The created URL for the given arguments
-
match
public UrlMappingInfo match(int responseCode)
-
setExceptionType
public void setExceptionType(java.lang.Class<?> exClass)
-
getExceptionType
public java.lang.Class<?> getExceptionType()
-
-