Package org.grails.web.mapping
Class ResponseCodeMappingData
- java.lang.Object
-
- org.grails.web.mapping.ResponseCodeMappingData
-
- All Implemented Interfaces:
UrlMappingData
public class ResponseCodeMappingData extends java.lang.Object implements UrlMappingData
A mapping data for response codes (numbers)- Since:
- 1.0-RC1
-
-
Constructor Summary
Constructors Constructor Description ResponseCodeMappingData(java.lang.String responseCode)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description UrlMappingDatacreateRelative(java.lang.String path)Creates a new UrlMappingData instance relative to this one for the given pathjava.lang.String[]getLogicalUrls()Obtains the logical URLs for this URLintgetResponseCode()java.lang.String[]getTokens()Retrieves the tokens that make up a URL.java.lang.StringgetUrlPattern()Retrieves the URL pattern for this UrlMappingData instancebooleanhasOptionalExtension()booleanisOptional(int index)Returns whether the given token in the URL is optional.
-
-
-
Method Detail
-
getTokens
public java.lang.String[] getTokens()
Description copied from interface:UrlMappingDataRetrieves the tokens that make up a URL. For example the tokens for the URL /blog/2007/* would be "blog", "2007" and "*"
- Specified by:
getTokensin interfaceUrlMappingData- Returns:
- The tokens as a string array
-
getLogicalUrls
public java.lang.String[] getLogicalUrls()
Description copied from interface:UrlMappingDataObtains the logical URLs for this URL
- Specified by:
getLogicalUrlsin interfaceUrlMappingData- Returns:
- The logical URLs as a string array
-
getUrlPattern
public java.lang.String getUrlPattern()
Description copied from interface:UrlMappingDataRetrieves the URL pattern for this UrlMappingData instance- Specified by:
getUrlPatternin interfaceUrlMappingData- Returns:
- The URL pattern
-
isOptional
public boolean isOptional(int index)
Description copied from interface:UrlMappingDataReturns whether the given token in the URL is optional. The index takes into account matching groups so for example the URL /blog/(*)/(*) has two entries for the two (*) matching groups with the index 0 relating to the the first entry- Specified by:
isOptionalin interfaceUrlMappingData- Parameters:
index- The index of the matching token- Returns:
- True if it is optional
-
createRelative
public UrlMappingData createRelative(java.lang.String path)
Description copied from interface:UrlMappingDataCreates a new UrlMappingData instance relative to this one for the given path- Specified by:
createRelativein interfaceUrlMappingData- Parameters:
path- The path- Returns:
- The new instance
-
hasOptionalExtension
public boolean hasOptionalExtension()
- Specified by:
hasOptionalExtensionin interfaceUrlMappingData- Returns:
- Whether the pattern has an optional extension
-
getResponseCode
public int getResponseCode()
-
-