class ToStringVisitor extends java.lang.Object implements RouterFunctions.Visitor, RequestPredicates.Visitor
RouterFunctions.Visitor
that creates a formatted
string representation of router functions.Modifier and Type | Field and Description |
---|---|
private java.lang.StringBuilder |
builder |
private int |
indent |
Constructor and Description |
---|
ToStringVisitor() |
Modifier and Type | Method and Description |
---|---|
void |
and()
Receive "middle" notification of a logical AND predicate.
|
void |
endAnd()
Receive last notification of a logical AND predicate.
|
void |
endNegate()
Receive last notification of a negated predicate.
|
void |
endNested(RequestPredicate predicate)
Receive notification of the end of a nested router function.
|
void |
endOr()
Receive last notification of a logical OR predicate.
|
void |
header(java.lang.String name,
java.lang.String value)
Receive notification of a HTTP header predicate.
|
private void |
indent() |
void |
method(java.util.Set<HttpMethod> methods)
Receive notification of an HTTP method predicate.
|
void |
or()
Receive "middle" notification of a logical OR predicate.
|
void |
path(java.lang.String pattern)
Receive notification of an path predicate.
|
void |
pathExtension(java.lang.String extension)
Receive notification of an path extension predicate.
|
void |
queryParam(java.lang.String name,
java.lang.String value)
Receive notification of a query parameter predicate.
|
void |
resources(java.util.function.Function<ServerRequest,<any>> lookupFunction)
Receive notification of a resource router function.
|
void |
route(RequestPredicate predicate,
HandlerFunction<?> handlerFunction)
Receive notification of a standard predicated route to a handler function.
|
void |
startAnd()
Receive first notification of a logical AND predicate.
|
void |
startNegate()
Receive first notification of a negated predicate.
|
void |
startNested(RequestPredicate predicate)
Receive notification of the beginning of a nested router function.
|
void |
startOr()
Receive first notification of a logical OR predicate.
|
java.lang.String |
toString() |
void |
unknown(RequestPredicate predicate)
Receive first notification of an unknown predicate.
|
void |
unknown(RouterFunction<?> routerFunction)
Receive notification of an unknown router function.
|
public void startNested(RequestPredicate predicate)
RouterFunctions.Visitor
startNested
in interface RouterFunctions.Visitor
predicate
- the predicate that applies to the nested router functionsRouterFunctions.nest(RequestPredicate, RouterFunction)
public void endNested(RequestPredicate predicate)
RouterFunctions.Visitor
endNested
in interface RouterFunctions.Visitor
predicate
- the predicate that applies to the nested router functionsRouterFunctions.nest(RequestPredicate, RouterFunction)
public void route(RequestPredicate predicate, HandlerFunction<?> handlerFunction)
RouterFunctions.Visitor
route
in interface RouterFunctions.Visitor
predicate
- the predicate that applies to the handler functionhandlerFunction
- the handler function.RouterFunctions.route(RequestPredicate, HandlerFunction)
public void resources(java.util.function.Function<ServerRequest,<any>> lookupFunction)
RouterFunctions.Visitor
resources
in interface RouterFunctions.Visitor
lookupFunction
- the lookup function for the resourcesRouterFunctions.resources(Function)
public void unknown(RouterFunction<?> routerFunction)
RouterFunctions.Visitor
RouterFunctions
methods.unknown
in interface RouterFunctions.Visitor
routerFunction
- the router functionprivate void indent()
public void method(java.util.Set<HttpMethod> methods)
RequestPredicates.Visitor
method
in interface RequestPredicates.Visitor
methods
- the HTTP methods that make up the predicateRequestPredicates.method(HttpMethod)
public void path(java.lang.String pattern)
RequestPredicates.Visitor
path
in interface RequestPredicates.Visitor
pattern
- the path pattern that makes up the predicateRequestPredicates.path(String)
public void pathExtension(java.lang.String extension)
RequestPredicates.Visitor
pathExtension
in interface RequestPredicates.Visitor
extension
- the path extension that makes up the predicateRequestPredicates.pathExtension(String)
public void header(java.lang.String name, java.lang.String value)
RequestPredicates.Visitor
header
in interface RequestPredicates.Visitor
name
- the name of the HTTP header to checkvalue
- the desired value of the HTTP headerRequestPredicates.headers(Predicate)
,
RequestPredicates.contentType(MediaType...)
,
RequestPredicates.accept(MediaType...)
public void queryParam(java.lang.String name, java.lang.String value)
RequestPredicates.Visitor
queryParam
in interface RequestPredicates.Visitor
name
- the name of the query parametervalue
- the desired value of the parameterRequestPredicates.queryParam(String, String)
public void startAnd()
RequestPredicates.Visitor
RequestPredicates.Visitor.and()
, followed by the right-hand side, followed by RequestPredicates.Visitor.endAnd()
.startAnd
in interface RequestPredicates.Visitor
RequestPredicate.and(RequestPredicate)
public void and()
RequestPredicates.Visitor
RequestPredicates.Visitor.endAnd()
.and
in interface RequestPredicates.Visitor
RequestPredicate.and(RequestPredicate)
public void endAnd()
RequestPredicates.Visitor
endAnd
in interface RequestPredicates.Visitor
RequestPredicate.and(RequestPredicate)
public void startOr()
RequestPredicates.Visitor
RequestPredicates.Visitor.endOr()
.startOr
in interface RequestPredicates.Visitor
RequestPredicate.or(RequestPredicate)
public void or()
RequestPredicates.Visitor
RequestPredicates.Visitor.endOr()
.or
in interface RequestPredicates.Visitor
RequestPredicate.or(RequestPredicate)
public void endOr()
RequestPredicates.Visitor
endOr
in interface RequestPredicates.Visitor
RequestPredicate.or(RequestPredicate)
public void startNegate()
RequestPredicates.Visitor
RequestPredicates.Visitor.endNegate()
.startNegate
in interface RequestPredicates.Visitor
RequestPredicate.negate()
public void endNegate()
RequestPredicates.Visitor
endNegate
in interface RequestPredicates.Visitor
RequestPredicate.negate()
public void unknown(RequestPredicate predicate)
RequestPredicates.Visitor
unknown
in interface RequestPredicates.Visitor
public java.lang.String toString()
toString
in class java.lang.Object