|
aerogear-controller 1.0.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jboss.aerogear.controller.router.DefaultRoute
public class DefaultRoute
An immutable implementation of Route.
| Field Summary | |
|---|---|
private Set<String> |
consumes
|
private Set<RequestMethod> |
methods
|
private List<Parameter<?>> |
parameters
|
private String |
path
|
private Set<MediaType> |
produces
|
private Set<String> |
roles
|
private Class<?> |
targetClass
|
private Method |
targetMethod
|
private Set<Class<? extends Throwable>> |
throwables
|
| Constructor Summary | |
|---|---|
DefaultRoute(RouteDescriptor descriptor)
Constructs a Route with the specified RouteDescriptor configuration options. |
|
| Method Summary | |
|---|---|
private Set<String> |
asSet(List<String> strings,
String defaultValue)
|
private Set<MediaType> |
asSet(MediaType[] types)
|
private Set<RequestMethod> |
asSet(RequestMethod[] methods)
|
private Set<String> |
asSet(String[] strings)
|
boolean |
canHandle(Throwable throwable)
Determines if this Route can handle the throwable. |
Set<String> |
consumes()
Returns the media types that this Route is capable of consuming. |
private static MediaType[] |
defaultMediaTypes()
|
private static Set<Class<? extends Throwable>> |
emptyThrowableSet()
|
Set<RequestMethod> |
getMethods()
Gets the RequestMethods for this Route. |
List<Parameter<?>> |
getParameters()
Returns the Parameter's that this route accepts. |
String |
getPath()
Gets the path for this Route. |
Set<String> |
getRoles()
Gets this Routes associated roles. |
Class<?> |
getTargetClass()
Gets the target class for this Route |
Method |
getTargetMethod()
Gets the Method of the target class for this Route. |
boolean |
hasExceptionsRoutes()
Determines if this Route contains one or more exception routes. |
boolean |
isParameterized()
Determines if this Route's path is parameterized. |
private boolean |
isPathCompatible(String realPath)
|
boolean |
isSecured()
Determines if this Route has roles configured. |
boolean |
matches(RequestMethod method,
String path,
Set<String> acceptHeaders)
Determines if this Route can handle the RequestMethod and path combination. |
private boolean |
matchesProduces(Set<String> acceptHeaders)
|
Set<MediaType> |
produces()
Returns the media types that this Route is capable of serving. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private final String path
private final Class<?> targetClass
private final Method targetMethod
private final Set<RequestMethod> methods
private final Set<String> roles
private final Set<String> consumes
private final Set<MediaType> produces
private final Set<Class<? extends Throwable>> throwables
private final List<Parameter<?>> parameters
| Constructor Detail |
|---|
public DefaultRoute(RouteDescriptor descriptor)
RouteDescriptor configuration options.
descriptor - the RouteDescriptor with the configured values.| Method Detail |
|---|
public Set<RequestMethod> getMethods()
RouteRequestMethods for this Route.
getMethods in interface RouteRequestMethods, or an empty set.public String getPath()
Route
getPath in interface Routepublic Class<?> getTargetClass()
Route
getTargetClass in interface Route
public boolean matches(RequestMethod method,
String path,
Set<String> acceptHeaders)
RouteRequestMethod and path combination.
matches in interface Routemethod - the http request methods.path - the request path.acceptHeaders - the accept headers provided, or an empty set if none were provided.
true if this Route can handle the method and path passed in, false otherwise.private boolean matchesProduces(Set<String> acceptHeaders)
private boolean isPathCompatible(String realPath)
public Method getTargetMethod()
RouteMethod of the target class for this Route.
getTargetMethod in interface Routepublic boolean isParameterized()
Route
isParameterized in interface Routetrue if this Route's path parameterized, otherwise false.public boolean isSecured()
Route
isSecured in interface Routetrue if this Route has roles associated with its Route.public Set<String> getRoles()
Route
getRoles in interface Routepublic boolean hasExceptionsRoutes()
Route
hasExceptionsRoutes in interface Routetrue if this Route has one or more exception routes.public Set<MediaType> produces()
Route
produces in interface Routepublic List<Parameter<?>> getParameters()
Route
getParameters in interface RouteParameter's that this route accepts.public Set<String> consumes()
Route
consumes in interface Routepublic boolean canHandle(Throwable throwable)
Route
canHandle in interface Routetrue if this Route can handle the Throwable, otherwise false.public String toString()
toString in class Objectprivate Set<RequestMethod> asSet(RequestMethod[] methods)
private Set<String> asSet(String[] strings)
private Set<MediaType> asSet(MediaType[] types)
private Set<String> asSet(List<String> strings,
String defaultValue)
private static Set<Class<? extends Throwable>> emptyThrowableSet()
private static MediaType[] defaultMediaTypes()
|
aerogear-controller 1.0.2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||