Package ratpack.core.path
Interface PathBinderBuilder
-
public interface PathBinderBuilder
A builder to generate aPathBinder
from a list of tokens and literals.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PathBinder
build(boolean exhaustive)
Generate aPathBinder
from the contents of the builder.PathBinderBuilder
literal(String literal)
Add a literal to the path.PathBinderBuilder
literalPattern(String pattern)
Add a regular expression parameterized literal element to the path.PathBinderBuilder
optionalToken(String token)
Add an optional token to the path.PathBinderBuilder
optionalTokenWithPattern(String token, String pattern)
Add a regular expression parameterized named optional token to the path.PathBinderBuilder
token(String token)
Add a token to the path.PathBinderBuilder
tokenWithPattern(String token, String pattern)
Add a regular expression parameterized named token to the path.
-
-
-
Method Detail
-
tokenWithPattern
PathBinderBuilder tokenWithPattern(String token, String pattern)
Add a regular expression parameterized named token to the path.- Parameters:
token
- the name of the tokenpattern
- the valid regex pattern- Returns:
- this
-
optionalTokenWithPattern
PathBinderBuilder optionalTokenWithPattern(String token, String pattern)
Add a regular expression parameterized named optional token to the path.- Parameters:
token
- the name of the optional tokenpattern
- the valid regex pattern- Returns:
- this
-
token
PathBinderBuilder token(String token)
Add a token to the path.- Parameters:
token
- the name of the token- Returns:
- this
-
optionalToken
PathBinderBuilder optionalToken(String token)
Add an optional token to the path.- Parameters:
token
- the name of the optional token- Returns:
- this
-
literalPattern
PathBinderBuilder literalPattern(String pattern)
Add a regular expression parameterized literal element to the path.- Parameters:
pattern
- the valid regex pattern- Returns:
- this
-
literal
PathBinderBuilder literal(String literal)
Add a literal to the path.- Parameters:
literal
- the literal path component- Returns:
- this
-
build
PathBinder build(boolean exhaustive)
Generate aPathBinder
from the contents of the builder.- Parameters:
exhaustive
- whether this path should be an exact match- Returns:
- a new
PathBinder
based on the state of this builder
-
-