Package groovy.text.markup

# Class MarkupTemplateEngine.TemplateResource

java.lang.Object
groovy.text.markup.MarkupTemplateEngine.TemplateResource

Enclosing class:
  MarkupTemplateEngine

public static class MarkupTemplateEngine.TemplateResource extends Object
Describes a template resource name split into base name, optional locale suffix, and extension.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `hasLocale()`
  Indicates whether this descriptor carries an explicit locale suffix.
  `static MarkupTemplateEngine.TemplateResource`
  `parse(String fullPath)`
  Parses a template path into its base name, optional locale suffix, and extension.
  `String`
  `toString()`
  Returns the resource path represented by this descriptor.
  `MarkupTemplateEngine.TemplateResource`
  `withLocale(String locale)`
  Returns a copy of this resource descriptor with the supplied locale suffix.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### parse

    public static MarkupTemplateEngine.TemplateResource parse(String fullPath)
    Parses a template path into its base name, optional locale suffix, and extension.
    Parameters:
      `fullPath` - template path to parse
    Returns:
      a parsed template resource descriptor

  - ### withLocale

    public MarkupTemplateEngine.TemplateResource withLocale(String locale)
    Returns a copy of this resource descriptor with the supplied locale suffix.
    Parameters:
      `locale` - locale suffix to apply, or `null` to remove it
    Returns:
      a new resource descriptor with the requested locale

  - ### toString

    public String toString()
    Returns the resource path represented by this descriptor.
    Overrides:
      `toString` in class `Object`
    Returns:
      the resource path with optional locale suffix

  - ### hasLocale

    public boolean hasLocale()
    Indicates whether this descriptor carries an explicit locale suffix.
    Returns:
      `true` if a locale suffix is present