title: Read Velocity Tokens/Tag from .vm file
body: <p>I have an application where in I am trying to create a  velocity template repository which will help me centralise all my email templates and will allow me to create a communication hub. All templates will be called at runtime and populates with data via services.</p>
  
  <p>My problem is that I need to provide users with optional and compulsory params list when they define the template inputs for the velocity template. </p>
  
  <p>Is there a way to read the tokens/tags from the velocity template file and extract them??</p>
  
  <p>Like I want a list of tokens $name.address.streetName to be available to me from .vm file. </p>
  
  <p>I do not want to go for Regex .</p>
  
  <p>I do not have to cache or reuse them , its just going to be a one time read and store the default,compulsory &amp; optional params in the database.</p>
  
  <p>I am following these patterns : <a href="http://kickjava.com/src/org/apache/velocity/test/view/TemplateNodeView.java.htm" rel="nofollow noreferrer">http://kickjava.com/src/org/apache/velocity/test/view/TemplateNodeView.java.htm</a></p>
  
  <p><a href="https://stackoverflow.com/questions/1432468/how-to-use-string-as-velocity-template">How to use String as Velocity Template?</a></p>
  
  <p>Please advice.</p>