public <E extends Enum<E> & FieldType> E nextField(Class<E> clazz, UserFieldDataType type)
   {
      for (String name : m_names[type.ordinal()])
      {
         int i = NumberHelper.getInt(m_counters.get(name)) + 1;
         try
         {
            E e = Enum.valueOf(clazz, name + i);
            m_counters.put(name, Integer.valueOf(i));
            return e;
         }
         catch (IllegalArgumentException ex)
         {
            // try the next name
         }
      }

      // no more fields available
      throw new IllegalArgumentException("No fields for type " + type + " available");
   }
public < E extends Enum < E > & FieldType > E nextField ( Class < E > clazz , UserFieldDataType type ) { for ( String name : m_names [ type . ordinal ( ) ] ) { int i = NumberHelper . getInt ( m_counters . get ( name ) ) + 1 ; try { E e = Enum . valueOf ( clazz , name + i ) ; m_counters . put ( name , Integer . valueOf ( i ) ) ; return e ; } catch ( IllegalArgumentException ex ) { } } throw new IllegalArgumentException ( "No fields for type " + type + " available" ) ; }
Generate the next available field for a user defined field.

@param <E> field type class
@param clazz class of the desired field enum
@param type user defined field type.
@return field of specified type