public class DestinationPatternsMessageCondition extends org.springframework.messaging.handler.AbstractMessageCondition<DestinationPatternsMessageCondition>
MessageCondition for matching the destination of a Message against one or
more destination patterns using a PathMatcher.| Constructor and Description |
|---|
DestinationPatternsMessageCondition(String[] patterns,
org.springframework.util.PathMatcher pathMatcher)
Alternative constructor accepting a custom PathMatcher.
|
| Modifier and Type | Method and Description |
|---|---|
DestinationPatternsMessageCondition |
combine(DestinationPatternsMessageCondition other)
Returns a new instance with URL patterns from the current instance ("this") and the
"other" instance as follows:
If there are patterns in both instances, combine the patterns in "this" with
the patterns in "other" using
PathMatcher.combine(String, String). |
int |
compareTo(DestinationPatternsMessageCondition other,
org.springframework.messaging.Message<?> message)
Compare the two conditions based on the destination patterns they contain.
|
protected Collection<String> |
getContent() |
DestinationPatternsMessageCondition |
getMatchingCondition(org.springframework.messaging.Message<?> message)
Check if any of the patterns match the given Message destination and return an
instance that is guaranteed to contain matching patterns, sorted via
PathMatcher.getPatternComparator(String). |
Set<String> |
getPatterns() |
protected String |
getToStringInfix() |
public DestinationPatternsMessageCondition(String[] patterns, org.springframework.util.PathMatcher pathMatcher)
patterns - the URL patterns to use; if 0, the condition will match to every
request.pathMatcher - the PathMatcher to useprotected Collection<String> getContent()
getContent in class org.springframework.messaging.handler.AbstractMessageCondition<DestinationPatternsMessageCondition>protected String getToStringInfix()
getToStringInfix in class org.springframework.messaging.handler.AbstractMessageCondition<DestinationPatternsMessageCondition>public DestinationPatternsMessageCondition combine(DestinationPatternsMessageCondition other)
PathMatcher.combine(String, String).
public DestinationPatternsMessageCondition getMatchingCondition(org.springframework.messaging.Message<?> message)
PathMatcher.getPatternComparator(String).message - the message to match tonull either if a destination can not be
extracted or there is no matchpublic int compareTo(DestinationPatternsMessageCondition other, org.springframework.messaging.Message<?> message)
PathMatcher.getPatternComparator(String). If all
compared patterns match equally, but one instance has more patterns, it is
considered a closer match.
It is assumed that both instances have been obtained via
getMatchingCondition(Message) to ensure they contain only patterns that
match the request and are sorted with the best matches on top.
Copyright © 2014–2017. All rights reserved.