public class RequestPathMatch extends TreeMap<String,String>
Provides access to the matched path variables and path match remainder.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Method and Description |
---|---|
<T> T |
get(HttpPartParser parser,
String name,
Class<T> type)
Same as
get(String, Class) but allows you to override the part parser. |
<T> T |
get(HttpPartParser parser,
String name,
Type type,
Type... args)
Same as
get(String, Type, Type...) but allows you to override the part parser. |
<T> T |
get(String name,
Class<T> type)
Returns the specified path parameter value converted to a POJO using the
HttpPartParser registered with the resource. |
<T> T |
get(String name,
Type type,
Type... args)
Returns the specified query parameter value converted to a POJO using the
HttpPartParser registered with the resource. |
boolean |
getBoolean(String name)
Returns the specified path parameter converted to a boolean.
|
int |
getInt(String name)
Returns the specified path parameter converted to an integer.
|
String |
getPattern()
Returns the path pattern that matched this request.
|
String |
getRemainder()
Returns the decoded remainder of the URL following any path pattern matches.
|
String |
getRemainderUndecoded()
Same as
getRemainder() but doesn't decode characters. |
String |
getString(String name)
Returns the specified path parameter converted to a String.
|
void |
put(String name,
Object value)
Sets a request query parameter value.
|
ceilingEntry, ceilingKey, clear, clone, comparator, containsKey, containsValue, descendingKeySet, descendingMap, entrySet, firstEntry, firstKey, floorEntry, floorKey, forEach, get, headMap, headMap, higherEntry, higherKey, keySet, lastEntry, lastKey, lowerEntry, lowerKey, navigableKeySet, pollFirstEntry, pollLastEntry, put, putAll, remove, replace, replace, replaceAll, size, subMap, subMap, tailMap, tailMap, values
equals, hashCode, isEmpty, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove
public void put(String name, Object value)
name
- The parameter name.value
- The parameter value.public String getString(String name) throws ParseException
name
- The path variable name.ParseException
public int getInt(String name) throws ParseException
name
- The path variable name.ParseException
public boolean getBoolean(String name) throws ParseException
name
- The path variable name.ParseException
public <T> T get(String name, Class<T> type) throws ParseException
HttpPartParser
registered with the resource.
T
- The class type to convert the attribute value to.name
- The attribute name.type
- The class type to convert the attribute value to.ParseException
public <T> T get(HttpPartParser parser, String name, Class<T> type) throws ParseException
get(String, Class)
but allows you to override the part parser.T
- The class type to convert the attribute value to.parser
- The parser to use for parsing the string value.
name
- The attribute name.type
- The class type to convert the attribute value to.ParseException
public <T> T get(String name, Type type, Type... args) throws ParseException
HttpPartParser
registered with the resource.
Similar to get(String,Class)
but allows for complex collections of POJOs to be created.
Use this method if you want to parse into a parameterized Map
/Collection
object.
Collections
must be followed by zero or one parameter representing the value type.
Maps
must be followed by zero or two parameters representing the key and value types.
T
- The class type to convert the attribute value to.name
- The attribute name.type
- The type of object to create.
ClassMeta
, Class
, ParameterizedType
, GenericArrayType
args
- The type arguments of the class if it's a collection or map.
ClassMeta
, Class
, ParameterizedType
, GenericArrayType
ParseException
public <T> T get(HttpPartParser parser, String name, Type type, Type... args) throws ParseException
get(String, Type, Type...)
but allows you to override the part parser.T
- The class type to convert the attribute value to.parser
- The parser to use for parsing the string value.
name
- The attribute name.type
- The type of object to create.
ClassMeta
, Class
, ParameterizedType
, GenericArrayType
args
- The type arguments of the class if it's a collection or map.
ClassMeta
, Class
, ParameterizedType
, GenericArrayType
ParseException
public String getRemainder()
The behavior of path remainder is shown below given the path pattern "/foo/*":
URL | Path Remainder |
---|---|
/foo |
|
/foo/ |
|
/foo// |
|
/foo/// |
|
/foo/a/b |
|
/foo//a/b/ |
|
/foo/a%2Fb |
public String getRemainderUndecoded()
getRemainder()
but doesn't decode characters.public String getPattern()
Copyright © 2018 Apache. All rights reserved.