code: public Object getAsObject(FacesContext context, UIComponent component,
                                String value) {
  
          if (context == null || component == null) {
              throw new NullPointerException();
          }
  
          if (targetClass == null) {
              throw new ConverterException(
                   MessageFactory.getMessage(context,
                        ENUM_NO_CLASS_ID,
                        value,
                        MessageFactory.getLabel(context,
                             component)));
          }
  
          // If the specified value is null or zero-length, return null
          if (value == null) {
              return (null);
          }
          value = value.trim();
          if (value.length() < 1) {
              return (null);
          }
  
          try {
              return Enum.valueOf(targetClass, value);
          } catch (IllegalArgumentException iae) {
              throw new ConverterException(
                   MessageFactory.getMessage(context,
                        ENUM_ID,
                        value,
                        value,
                        MessageFactory.getLabel(context,
                             component)), iae);
          }
  
      }
docs: <p>Convert the <code>value</code> argument to one of the enum
  constants of the class provided in our constructor.  If no
  target class argument has been provided to the constructor of
  this instance, throw a <code>ConverterException</code>
  containing the {@link #ENUM_NO_CLASS_ID} message with proper
  parameters.  If the <code>value</code> argument is <code>null</code>
  or it  has a length of zero, return <code>null</code>.
  Otherwise, perform the equivalent of <code>Enum.valueOf</code> using
  target class and <code>value</code> and return the <code>Object</code>.
  If the conversion fails, throw a <code>ConverterException</code>
  containing the {@link #ENUM_ID} message with proper parameters.
  </p>
  
  @param context   the <code>FacesContext</code> for this request.
  @param component the <code>UIComponent</code> to which this value
  will be applied.
  @param value     the String <code>value</code> to be converted to
  <code>Object</code>.
  @throws ConverterException   {@inheritDoc}
  @throws NullPointerException {@inheritDoc}