@Test public void shouldParseTimestampParameters() { UrlMatcher huge = new UrlPattern( "/name/{ORDER}/{NO_OF_RECORDS}/{SIFREF_ID}/{REQUEST_TIME_STAMP}/{KEY_MONIKER}/" + "{AUTHENTICATION_TOKEN}"); UrlMatch match = huge.match("/name/asc/4/2A3B4C5E6D/12345/foo/" + "560261e05f7c21533a3d7d09efff4b91eb7ca702f490e073e1d51614c2e33c1e" + "?contenttype=jsonp%26jsonp=_jqjsp%26_1287161495587"); assertNotNull(match); assertEquals("12345", match.get("REQUEST_TIME_STAMP")); match = huge.match("/name/asc/4/2A3B4C5E6D/2010-10-15T16:51:33Z/foo/" + "560261e05f7c21533a3d7d09efff4b91eb7ca702f490e073e1d51614c2e33c1e" + "?contenttype=jsonp&jsonp=_jqjsp&_1287161495587="); assertNotNull(match); assertEquals("2010-10-15T16:51:33Z", match.get("REQUEST_TIME_STAMP")); match = huge.match("/name/asc/4/2A3B4C5E6D/2010-10-15T16%253A51%253A33Z/foo/" + "560261e05f7c21533a3d7d09efff4b91eb7ca702f490e073e1d51614c2e33c1e" + "?contenttype=jsonp%26jsonp=_jqjsp%26_1287161495587"); assertNotNull(match); assertEquals("2010-10-15T16%253A51%253A33Z", match.get("REQUEST_TIME_STAMP")); }
@Override public UrlMatch match(String url) { Matcher matcher = compiledUrl.matcher(url); if (matcher.matches()) { return new UrlMatch(extractParameters(matcher)); } return null; }
UrlPattern implements UrlMatcher { @Override public UrlMatch match(String url) { Matcher matcher = compiledUrl.matcher(url); if (matcher.matches()) { return new UrlMatch(extractParameters(matcher)); } return null; } }
UrlPattern implements UrlMatcher { @Override public UrlMatch match(String url) { Matcher matcher = compiledUrl.matcher(url); if (matcher.matches()) { return new UrlMatch(extractParameters(matcher)); } return null; } UrlPattern(String path); }
UrlPattern implements UrlMatcher { @Override public UrlMatch match(String url) { Matcher matcher = compiledUrl.matcher(url); if (matcher.matches()) { return new UrlMatch(extractParameters(matcher)); } return null; } UrlPattern(String path); void compile(); @Override boolean matches(String url); @Override UrlMatch match(String url); String getPattern(); List<String> getParameterNames(); @Override String toRegexPattern(String url); }
UrlPattern implements UrlMatcher { @Override public UrlMatch match(String url) { Matcher matcher = compiledUrl.matcher(url); if (matcher.matches()) { return new UrlMatch(extractParameters(matcher)); } return null; } UrlPattern(String path); void compile(); @Override boolean matches(String url); @Override UrlMatch match(String url); String getPattern(); List<String> getParameterNames(); @Override String toRegexPattern(String url);  }