TemplateNotFoundException (FreeMarker 2.3.35 API)
Description: declaration: package: freemarker.template, class: TemplateNotFoundException

Package freemarker.template

# Class TemplateNotFoundException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.io.IOException
java.io.FileNotFoundException
freemarker.template.TemplateNotFoundException

All Implemented Interfaces:
  `Serializable`

public final class TemplateNotFoundException extends FileNotFoundException
Thrown when `Configuration.getTemplate(String)` (or similar) doesn't find a template. This extends `FileNotFoundException` for backward compatibility, but in fact has nothing to do with files, as FreeMarker can load templates from many other sources.

Since:
  2.3.22
See Also:
  `MalformedTemplateNameException`, `Configuration.getTemplate(String)`, Serialized Form

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TemplateNotFoundException​(String templateName, Object customLookupCondition, String message)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Object`
  `getCustomLookupCondition()`
  The custom lookup condition with which the template was requested, or `null` if there's no such condition.
  `String`
  `getTemplateName()`
  The name (path) of the template that wasn't found.

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

  `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

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

- ## Constructor Details

  - ### TemplateNotFoundException

    public TemplateNotFoundException​(String templateName, Object customLookupCondition, String message)

- ## Method Details

  - ### getTemplateName

    public String getTemplateName()
    The name (path) of the template that wasn't found.

  - ### getCustomLookupCondition

    public Object getCustomLookupCondition()
    The custom lookup condition with which the template was requested, or `null` if there's no such condition. See the `customLookupCondition` parameter of `Configuration.getTemplate(String, java.util.Locale, Object, String, boolean, boolean)`.