Class UriTemplate


  • public class UriTemplate
    extends java.lang.Object
    Extracts path parameters from URIs used to create web socket connections using the URI template defined for the associated Endpoint.
    • Constructor Summary

      Constructors 
      Constructor Description
      UriTemplate​(java.lang.String path)
      Creates a new UriTemplate from the given path.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getNormalizedPath()
      Returns the normalized path with numeric parameter indices.
      int getSegmentCount()
      Returns the number of path segments.
      boolean hasParameters()
      Returns whether this template contains path parameters.
      java.util.Map<java.lang.String,​java.lang.String> match​(UriTemplate candidate)
      Matches this template against a candidate URI path.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UriTemplate

        public UriTemplate​(java.lang.String path)
                    throws DeploymentException
        Creates a new UriTemplate from the given path.
        Parameters:
        path - the URI template path
        Throws:
        DeploymentException - if the path is invalid
    • Method Detail

      • match

        public java.util.Map<java.lang.String,​java.lang.String> match​(UriTemplate candidate)
        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

        public java.lang.String getNormalizedPath()
        Returns the normalized path with numeric parameter indices.
        Returns:
        the normalized path