/** * Returns the element type for the given string. If the string is * <code>null</code> or does not describe a valid element type, * then <code>null</code> is returned * * @param string The string * @return The element type */ public static ElementType forString(String string) { if (string == null) { return null; } if (!contains(string)) { return null; } return ElementType.valueOf(string); }