code: public String getAsString(FacesContext context, UIComponent component,
                                Object 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, return null
          if (value == null) {
              // FIXSPEC even though the Javadoc states that we need to return 
              // null the master Converter contract states that a null value 
              // results in a zero-length string (see JAVASERVERFACES_SPEC_PUBLIC-1217)
              return "";
          }
  
          if (targetClass.isInstance(value)) {
              return ((Enum)value).name();
          }
  
          throw new ConverterException(
               MessageFactory.getMessage(context,
                    ENUM_ID,
                    value,
                    value,
                    MessageFactory.getLabel(context,
                         component)));
      }
docs: <p>Convert the enum constant given by the <code>value</code>
  argument into a String.  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>, return
  <code>null</code>.  If the value is an instance of the provided
  target class, return its string value by <span
  class="changed_added_2_0">casting it to a
  <code>java.lang.Enum</code> and returning the result of calling
  the <code>name()</code> method.</span> Otherwise, throw a {@link
  ConverterException} containing the {@link #ENUM_ID} message with
  proper parameters.</p>
  
  @throws ConverterException   {@inheritDoc}
  @throws NullPointerException {@inheritDoc}