title: Get List of all dependency names(even multi-level inheritance) from the template string in FreeMarker
body: <p>I was trying to use the FreeMarker template engine in a personal maven project.</p>
  <p>I wished to ask if FreeMarker has a public method, which, given the template body as a string can return the list of all the dependency template names (that use #import and #include directives).</p>
  <p>If so, can you please point me to the right part of the codebase related to this?
  Even if there's no such public method, can you please point me to the private method that accomplishes this?</p>
  <p>I'm not sure if there is a way to change name of a directive in any way in FreeMarker(like aliases in bash? Or the &quot;using&quot; declarations in C++, or perhaps any user defined directive in FreeMarker).
  If there is, writing such a simple parser could have bugs because if it does not find <code>&lt;#import&gt;</code> or <code>&lt;#include&gt;</code> directives, we will get no dependency template names, as the alias or user-defined directive.</p>
  <p>So are there any such things that I need to pay specific attention to? Or can I write a simple parser of my own using <code>String.indexOf()</code> and <code>String.substring()</code> methods?</p>
  <p>Thanks!</p>