Class UriTemplateParser

java.lang.Object
org.exoplatform.services.rest.uri.UriTemplateParser

public class UriTemplateParser extends Object
Version:
$Id: $
Author:
Andrey Parfonov
  • Field Details

    • URI_PARAMETERS_PATTERN

      public static final Pattern URI_PARAMETERS_PATTERN
      Pattern for process URI parameters, for example /a/b/{x}/c .
  • Constructor Details

    • UriTemplateParser

      public UriTemplateParser(String template)
      Parameters:
      template - source URI template
  • Method Details

    • getNumberOfLiteralCharacters

      public final int getNumberOfLiteralCharacters()
      Get the number of literal characters in the template.
      Returns:
      number of literal characters in the template
    • getParameterNames

      public final List<String> getParameterNames()
      Returns:
      list of names
    • getRegex

      public final String getRegex()
      Get the regular expression.
      Returns:
      the regular expression
    • getTemplate

      public final String getTemplate()
      Get the URI template.
      Returns:
      the URI template
    • getGroupIndexes

      public final int[] getGroupIndexes()
      Returns:
      indexes of regular expression capturing group
    • encodeLiteralCharacters

      protected String encodeLiteralCharacters(String literalCharacters)
      Encode set of literal characters. Characters must not e double encoded.
      Parameters:
      literalCharacters - source string
      Returns:
      encoded string