|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.flat502.rox.http.MethodCallURI
public class MethodCallURI
A simple wrapper for URI
for
decomposing a URI into the components we expect
when mapping a GET request onto an XML-RPC method
call handler.
A URI is decomposed into three parts:
mount point
method name
parameter
map
Constructor Summary | |
---|---|
MethodCallURI(java.lang.String uri)
|
|
MethodCallURI(java.net.URI uri)
|
Method Summary | |
---|---|
java.lang.String |
getMethodName()
The method name for a URI is derived by extracting the path component from the URI and retaining the last path element. |
java.lang.String |
getMountPoint()
The mount point for a URI is derived by extracting the path component from the URI and removing the last path element. |
java.lang.String[] |
getParameterNames()
The parameter names for a URI are derived by extracting the query component from the URI and constructing an array from it. |
java.util.Map |
getParameters()
The parameters for a URI are derived by extracting the query component from the URI and constructing a Map from it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MethodCallURI(java.lang.String uri) throws java.net.URISyntaxException
java.net.URISyntaxException
public MethodCallURI(java.net.URI uri)
Method Detail |
---|
public java.lang.String getMountPoint()
Logically this acts as though the path were split on the path
separator (/
) and all but the last element of the
resulting list were joined using the same separator.
A null
or empty path component results in
the mount point being set to a single path separator ("/"
).
URI
wrapped by this
instance.public java.lang.String getMethodName()
Logically this acts as though the path were split on the path
separator (/
) and only the last element of the
resulting list was retained.
A null
or empty path component results in the method name
being set to an empty String.
URI
wrapped by this
instance.public java.util.Map getParameters()
Map
from it.
This Map
is never null
and is always an instance
of LinkedHashMap
. Key insertion order matches the order in
which query keys are specified in the URI.
The value for a given key in the returned Map
is one of
three values:
null
value if the key was defined without a value in the URI (...&foo&...
).String
value if the key was defined once, and with a value, in the URI (...&foo&...
).List
instance if a key appears multiple times (...&foo=1&...&foo=2&...
).
The List
contents will reflect the values assigned to the key in the order in which they appear in the URI.
If a key appears multiple times and at least once occurrence appears with a value (...&foo=1&...&foo&...
),
then any occurrences without a value will be reflected by a null
value within the List
instance.
Map
instance representing the parameters specified in the
query component of the URI. If the query portion is null
an empty Map
is returned.public java.lang.String[] getParameterNames()
This method provides additional information that may be lost in
the translation from a query string to a Map
. Specifically,
if the same key is specified multiple times as part of the URI then
even an ordered Map
provides no means to determine exact parameter
ordering.
null
or empty a zero-length array is returned.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |