| java.lang.Object com.flexive.faces.URIRoute
All known Subclasses: com.flexive.faces.ContentURIRoute,
URIRoute | abstract public class URIRoute (Code) | | A base implementation of an URI route. This class allows to define static mappers
for URI. External URIs can be parsed using
URIRoute.getMatcher(String) and created
with
URIRoute.getMappedUri(java.util.Map) . This implementation provides simple string-based,
named parameters that can be specified in the URI using "${parameter}", e.g.
"/myUri/${myParam}.xhtml". Subclasses like the
ContentURIRoute provide more
specialized parameters.
Although this class provides a complete implementation, it is declared abstract since
any usable URI mapper must define at least one static parameter.
author: Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at) version: $Rev: 1 $ |
getFormat | public String getFormat()(Code) | | Return the URI format of this mapper.
the URI format of this mapper. |
getMappedUri | public String getMappedUri(Map<String, String> parameters)(Code) | | Replaces the given parameters in this mapper's URI format and returns the created URI.
Note that the given parameters must include all parameters set in the format,
although not all parameters specified have to be included in the format.
Parameters: parameters - the parameter values to be replaced a formatted URI |
getMatcher | public URIMatcher getMatcher(String uri)(Code) | | Return a matcher for the given URI. The matcher allows to extract parameters
set in the URI.
Parameters: uri - the URI (matching this mapper's URI format) to be parsed a matcher for the given URI |
getParameterRegexp | protected String getParameterRegexp(String name)(Code) | | Returns the regular expression of the given parameter, or throws a
FxRuntimeException if the parameter is not available in this mapper.
Parameters: name - the parameter name the regular expression of the given parameter |
getPosition | int getPosition(String parameterName)(Code) | | Return the position of the given parameter name in the format string. If the parameter
is not set in the format string, a FxRuntimeException is thrown.
Parameters: parameterName - the parameter name the 1-based position of the parameter in the format string |
getTarget | public String getTarget()(Code) | | Returns the target URI of this mapper.
the target URI of this mapper. |
hasParameter | boolean hasParameter(String parameterName)(Code) | | Returns true if the given parameter is set in this mapper's format string.
Parameters: parameterName - the parameter name to be checked true if the given parameter is set in this mapper's format string. |
replaceUriParameter | protected String replaceUriParameter(String format, String parameterName, String value)(Code) | | Replace the given parameter in the URI format string.
Parameters: format - the format string Parameters: parameterName - the parameter name Parameters: value - the value to be set for the parameter the replaced format string |
|
|