List of usage examples for org.springframework.web.util.pattern PathPatternParser parse
public PathPattern parse(String pathPattern) throws PatternParseException
From source file:org.springframework.web.reactive.function.server.RequestPredicates.java
/** * Return a function that creates new path-matching {@code RequestPredicates} from pattern * Strings using the given {@link PathPatternParser}. This method can be used to specify a * non-default, customized {@code PathPatternParser} when resolving path patterns. * @param patternParser the parser used to parse patterns given to the returned function * @return a function that resolves patterns Strings into path-matching * {@code RequestPredicate}s/*from ww w. j a va 2s .c o m*/ */ public static Function<String, RequestPredicate> pathPredicates(PathPatternParser patternParser) { Assert.notNull(patternParser, "'patternParser' must not be null"); return pattern -> new PathPatternPredicate(patternParser.parse(pattern)); }
From source file:org.springframework.web.servlet.function.RequestPredicates.java
/** * Return a function that creates new path-matching {@code RequestPredicates} * from pattern Strings using the given {@link PathPatternParser}. * <p>This method can be used to specify a non-default, customized * {@code PathPatternParser} when resolving path patterns. * @param patternParser the parser used to parse patterns given to the returned function * @return a function that resolves a pattern String into a path-matching * {@code RequestPredicates} instance/*from w w w. j a va 2 s. c o m*/ */ public static Function<String, RequestPredicate> pathPredicates(PathPatternParser patternParser) { Assert.notNull(patternParser, "PathPatternParser must not be null"); return pattern -> new PathPatternPredicate(patternParser.parse(pattern)); }