mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/general/CapabilitiesTree.java
private void handleThAttr(final Field field, final Object fieldObj, final TreeNode node)
    {
        //If its a list, then iterate over that list, showing each object.
        //This won't cover other types that are list fields.  Leveraging the fact that
        //their toString() is sufficient.
        if (fieldObj instanceof List<?>)
        {
            final List<?> listFieldObj = (List<?>)fieldObj;
            final Iterator<?> iter = listFieldObj.iterator();
            final ParameterizedType type = (ParameterizedType) field.getGenericType();
            final Class<?> clazz = (Class<?>)type.getActualTypeArguments()[0];
            while (iter.hasNext())
            {
                final Object listObj = iter.next();
                final CapabilityModel cm2 = new CapabilityModel();
                
                cm2.setName("Item: " + clazz.getSimpleName());
                
                if (listObj.getClass().isEnum())
                {
                    cm2.setValue(listObj.toString());
                    new DefaultTreeNode(cm2, node);
                }
                else
                {
                    cm2.setValue("");
                    final TreeNode node2 = new DefaultTreeNode(cm2, node);
                    
                    addChildren(listObj.getClass(), node2, listObj);
                                    
                    if (node2.getChildCount() > 0)
                    {
                        node2.setExpanded(true);
                    }
                }
            }
        }
        else if (!fieldObj.getClass().isEnum())
        {
            addChildren(fieldObj.getClass(), node, fieldObj);
        }
    }
/**
     * Create the node for the Th object.
     * @param field the field.
     * @param fieldObj the value of the field for a object.
     * @param node the parent tree node.
     */
Create the node for the Th object.
@param field the field.
@param fieldObj the value of the field for a object.
@param node the parent tree node.
Create the node for the Th object . @param field the field . @param fieldObj the value of the field for a object . @param node the parent tree node .
private void handleThAttr(final Field field, final Object fieldObj, final TreeNode node)
    {
        if (fieldObj instanceof List<?>)
        {
            final List<?> listFieldObj = (List<?>)fieldObj;
            final Iterator<?> iter = listFieldObj.iterator();
            final ParameterizedType type = (ParameterizedType) field.getGenericType();
            final Class<?> clazz = (Class<?>)type.getActualTypeArguments()[0];
            while (iter.hasNext())
            {
                final Object listObj = iter.next();
                final CapabilityModel cm2 = new CapabilityModel();
                cm2.setName("Item: " + clazz.getSimpleName());
                if (listObj.getClass().isEnum())
                {
                    cm2.setValue(listObj.toString());
                    new DefaultTreeNode(cm2, node);
                }
                else
                {
                    cm2.setValue("");
                    final TreeNode node2 = new DefaultTreeNode(cm2, node);
                    addChildren(listObj.getClass(), node2, listObj);
                    if (node2.getChildCount() > 0)
                    {
                        node2.setExpanded(true);
                    }
                }
            }
        }
        else if (!fieldObj.getClass().isEnum())
        {
            addChildren(fieldObj.getClass(), node, fieldObj);
        }
    }
private void handleThAttr ( final Field field , final Object fieldObj , final TreeNode node ) { if ( fieldObj instanceof List < ? > ) { final List < ? > listFieldObj = ( List < ? > ) fieldObj ; final Iterator < ? > iter = listFieldObj . iterator ( ) ; final ParameterizedType type = ( ParameterizedType ) field . getGenericType ( ) ; final Class < ? > clazz = ( Class < ? > ) type . getActualTypeArguments ( ) [ 0 ] ; while ( iter . hasNext ( ) ) { final Object listObj = iter . next ( ) ; final CapabilityModel cm2 = new CapabilityModel ( ) ; cm2 . setName ( "Item: " + clazz . getSimpleName ( ) ) ; if ( listObj . getClass ( ) . isEnum ( ) ) { cm2 . setValue ( listObj . toString ( ) ) ; new DefaultTreeNode ( cm2 , node ) ; } else { cm2 . setValue ( "" ) ; final TreeNode node2 = new DefaultTreeNode ( cm2 , node ) ; addChildren ( listObj . getClass ( ) , node2 , listObj ) ; if ( node2 . getChildCount ( ) > 0 ) { node2 . setExpanded ( true ) ; } } } } else if ( ! fieldObj . getClass ( ) . isEnum ( ) ) { addChildren ( fieldObj . getClass ( ) , node , fieldObj ) ; } }
Create the node for the Th object.
Create the node for the Th object .
//If its a list, then iterate over that list, showing each object. //This won't cover other types that are list fields.  Leveraging the fact that //their toString() is sufficient.