title: Java - The best way to store configs inside a program
body: <p>I have an XML file, which contains rules for code analyzer (to search vulnerabilities). So, it has very different rules like parameter, parameter count, any parameter type, const value and etc for method call (to detect specific calls), rules to detect some imports, inheritance and so on. But how to store this inside my program?
  I found two ways:</p>
  
  <ol>
  <li>Parse xml while scanning (to internal representation) </li>
  <li>Create classes for each element: parameter, parameter value, number of
  parameters</li>
  </ol>
  
  <p>Is there a real life example of implementing this thing? Or you may just say the best/common way to do this</p>