public class URLPatternParser extends Object
| Constructor and Description |
|---|
URLPatternParser(String pattern)
Set the pattern for which this parser will match.
|
| Modifier and Type | Method and Description |
|---|---|
URL |
getMappedURL(Object... params)
URL encoding/decoding is not a concern of this method.
|
int |
getParameterCount()
Get the number of URL parameters that this parser expects to find in any given input string
|
List<PathParameter> |
getPathParameters()
Return the list of parameters specified by this pattern.
|
Object |
getPattern() |
boolean |
isElPattern() |
boolean |
matches(String target)
Deprecated.
|
boolean |
matches(URL target)
Return true if this parser matches the given URL, otherwise, return false.
|
List<PathParameter> |
parse(URL url)
Builds a list of PathParameters for this UrlPattern, extracted from the provided URL (assuming a match is found).
|
public URLPatternParser(String pattern)
pattern - Pattern to use as a parse templatepublic boolean matches(URL target)
@Deprecated public boolean matches(String target)
public List<PathParameter> getPathParameters()
public List<PathParameter> parse(URL url)
public URL getMappedURL(Object... params)
params - Array of Object parameters, in order, to be substituted for mapping pattern values or el
expressions. This method will call the toString() method on each object provided.
If only one param is specified and it is an instance of List, the list items will be used as parameters instead. An empty list or a single null parameter are both treated as if no parameters were specified.
E.g: getMappedUrl(12,55,"foo","bar") for a pattern of /#{el.one}/#{el.two}/#{el.three}/#{el.four}/ will return the String: "/12/55/foo/bar/"public int getParameterCount()
public Object getPattern()
public boolean isElPattern()
Copyright © 2014 OCPsoft. All Rights Reserved.