Example usage for org.springframework.web.util.pattern PathPatternParser parse

List of usage examples for org.springframework.web.util.pattern PathPatternParser parse

Introduction

In this page you can find the example usage for org.springframework.web.util.pattern PathPatternParser parse.

Prototype

public PathPattern parse(String pathPattern) throws PatternParseException 

Source Link

Document

Process the path pattern content, a character at a time, breaking it into path elements around separator boundaries and verifying the structure at each stage.

Usage

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));
}