java.lang.Object
io.aiven.commons.kafka.connector.common.templating.TemplateParser

public final class TemplateParser extends Object
A parser for a template
  • Method Details

    • validate

      public static void validate(String configurationName, String templatePattern, TemplateVariableRegistry registry)
      Validates that the template string is parsable.
      Parameters:
      configurationName - the name of the template string. Generally the name of the configuration option that provided the template. pattern.
      templatePattern - the template string.
      registry - the registry of permitted TemplateVariables
    • parse

      public static Template parse(String templatePattern, TemplateVariableRegistry registry)
      Parses the template.
      Parameters:
      templatePattern - the template string.
      registry - the template variable registry.
      Returns:
      The parsed template object.
    • isValidName

      public static boolean isValidName(String name)
      Determines if a template or parameter name is valid. Valid names may not be empty and must consist of letters, digits, _, -, and . only.
      Parameters:
      name - the name to check
      Returns:
      true if name comprises letters, digits, _, -, and . only.