Package com.google.inject.servlet
Class UriPatternType.ServletStyleUriPatternMatcher
- java.lang.Object
-
- com.google.inject.servlet.UriPatternType.ServletStyleUriPatternMatcher
-
- All Implemented Interfaces:
UriPatternMatcher
- Enclosing class:
- UriPatternType
private static class UriPatternType.ServletStyleUriPatternMatcher extends java.lang.Object implements UriPatternMatcher
Matches URIs using the pattern grammar of the Servlet API and web.xml.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
UriPatternType.ServletStyleUriPatternMatcher.Kind
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
literal
private java.lang.String
originalPattern
private UriPatternType.ServletStyleUriPatternMatcher.Kind
patternKind
-
Constructor Summary
Constructors Constructor Description ServletStyleUriPatternMatcher(java.lang.String pattern)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
extractPath(java.lang.String path)
java.lang.String
getOriginalPattern()
Returns the original pattern that was registered.UriPatternType
getPatternType()
Returns the type of pattern this is.boolean
matches(java.lang.String uri)
-
-
-
Field Detail
-
literal
private final java.lang.String literal
-
originalPattern
private final java.lang.String originalPattern
-
patternKind
private final UriPatternType.ServletStyleUriPatternMatcher.Kind patternKind
-
-
Method Detail
-
matches
public boolean matches(java.lang.String uri)
- Specified by:
matches
in interfaceUriPatternMatcher
- Parameters:
uri
- A "contextual" (i.e. relative) and "normalized" Request URI, *not* a complete one.- Returns:
- Returns true if the uri matches the pattern.
-
extractPath
public java.lang.String extractPath(java.lang.String path)
- Specified by:
extractPath
in interfaceUriPatternMatcher
- Parameters:
path
- The Path that this service pattern can match against.- Returns:
- Returns a canonical servlet path from this pattern. For instance, if the pattern is
/home/*
then the path extracted will be/home
. Each pattern matcher implementation must decide and publish what a canonical path represents.NOTE(dhanji): This method returns null for the regex pattern matcher.
-
getPatternType
public UriPatternType getPatternType()
Description copied from interface:UriPatternMatcher
Returns the type of pattern this is.- Specified by:
getPatternType
in interfaceUriPatternMatcher
-
getOriginalPattern
public java.lang.String getOriginalPattern()
Description copied from interface:UriPatternMatcher
Returns the original pattern that was registered.- Specified by:
getOriginalPattern
in interfaceUriPatternMatcher
-
-