Class UriTemplate
java.lang.Object
org.apache.tomcat.websocket.server.UriTemplate
Extracts path parameters from URIs used to create web socket connections using the URI template defined for the
associated Endpoint.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the normalized path with numeric parameter indices.intReturns the number of path segments.booleanReturns whether this template contains path parameters.match(UriTemplate candidate) Matches this template against a candidate URI path.
-
Constructor Details
-
UriTemplate
Creates a new UriTemplate from the given path.- Parameters:
path- the URI template path- Throws:
DeploymentException- if the path is invalid
-
-
Method Details
-
match
Matches this template against a candidate URI path.- Parameters:
candidate- the candidate URI path- Returns:
- the path parameters if matched, or null
-
hasParameters
public boolean hasParameters()Returns whether this template contains path parameters.- Returns:
- true if there are parameters
-
getSegmentCount
public int getSegmentCount()Returns the number of path segments.- Returns:
- the segment count
-
getNormalizedPath
Returns the normalized path with numeric parameter indices.- Returns:
- the normalized path
-