title: Creating a factory method in Java that doesn't rely on if-else
body: <p>Currently I have a method that acts as a factory based on a given String. 
  For example:</p>
  
  <pre><code>public Animal createAnimal(String action)
  {
      if (action.equals("Meow"))
      {
          return new Cat();
      }
      else if (action.equals("Woof"))
      {
          return new Dog();
      }
  
      ...
      etc.
  }
  </code></pre>
  
  <p>What I want to do is avoid the entire if-else issue when the list of classes grows. 
  I figure I need to have two methods, one that registers Strings to classes and another that returns the class based on the String of the action. </p>
  
  <p>What's a nice way to do this in Java?</p>