Class RouteParameter
java.lang.Object
org.ninjax.core.RouteParameter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetIndex()Gets the index of where the token starts in the original uri.getName()The name of the parameter such as "id" in "{id: [0-9]+}"getRegex()The regex of the parameter such as "[0-9]+" in "{id: [0-9]+}"getToken()The exact string of the parameter such as "{id: [0-9]+}" in "{id: [0-9]+}"static Map<String, RouteParameter> Parse a path such as "/user/{id: [0-9]+}/email/{addr}" for the named parameters.
-
Constructor Details
-
RouteParameter
-
-
Method Details
-
getIndex
public int getIndex()Gets the index of where the token starts in the original uri.- Returns:
- An index of where the token is
-
getToken
The exact string of the parameter such as "{id: [0-9]+}" in "{id: [0-9]+}"- Returns:
- The parameter token
-
getName
The name of the parameter such as "id" in "{id: [0-9]+}"- Returns:
- The name of the parameter
-
getRegex
The regex of the parameter such as "[0-9]+" in "{id: [0-9]+}"- Returns:
- The regex of the parameter or null if no regex was included for the parameter.
-
parse
Parse a path such as "/user/{id: [0-9]+}/email/{addr}" for the named parameters.- Parameters:
path- The path to parse- Returns:
- A map containing the named parameters in the order they were parsed or null if no parameters were parsed.
-