Sorry, I guess I wasn't clear :-(.  I am actually fine with this solution if you think its fine.  I wasn't against taking an arbitrary class as a parameter (for people who defined their own patterns).  I just wanted to make sure we had convenience names for the common cases.  I.e. if the text matched the value in the Map you created, use that class.  Otherwise, assume a class name was provided.