Class UriTemplate

java.lang.Object
dev.tachyonmcp.api.server.domain.UriTemplate

public final class UriTemplate extends Object
Reverse parser for RFC 6570 URI templates with scalar and unambiguous exploded list values.
  • Method Details

    • create

      public static UriTemplate create(String uriTemplate)
      Creates a reverse parser for an RFC 6570 URI template.
      Parameters:
      uriTemplate - the URI template to compile
      Returns:
      a parser that extracts decoded values from matching URIs
      Throws:
      NullPointerException - if uriTemplate is null
      IllegalArgumentException - if the template is too long or malformed
    • parse

      public Map<String,UriTemplateValue> parse(String rawUri)
      Parses a raw URI according to this template and extracts decoded variable values.
      Parameters:
      rawUri - the URI to parse
      Returns:
      an unmodifiable map of variable names to decoded scalar or sequence values
      Throws:
      IllegalArgumentException - if the URI is invalid, exceeds the supported length, does not match the template, or contains undecodable values