mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/general/CapabilitiesTree.java
private CapabilityModel createCapabilityModel(final Field field, final Object fieldObj)
    {
        final boolean isList = fieldObj instanceof List;
        final CapabilityModel capModel = new CapabilityModel();
        final StringBuilder name = new StringBuilder(field.getName());
        if (isList)
        {
            name.append(" (List)");
        }
        capModel.setName(name.toString());
        
        final boolean isThType = field.getGenericType().toString().contains(TH_OBJ_IDENTIFIER);

        if (fieldObj == null)
        {
            return null;
        }
        else if (isThType)
        {
            //If this is an enum, then go ahead and set the value
            if (fieldObj.getClass().isEnum())
            {
                capModel.setValue(fieldObj.toString());
            }
            else
            {
                capModel.setValue("");
            }
        }
        else
        {
            if (isList)
            {
                final StringBuilder val = new StringBuilder();
                for (Object obj : (List<?>)fieldObj)
                {
                    val.append(obj.toString()).append("\n");
                }
                capModel.setValue(val.toString());
            }
            else
            {
                final String str = fieldObj.toString();
                capModel.setValue(str);
            }
        }
        
        return capModel;
    }
/**
     * Create a model object for the tree table.
     * @param field The field to use
     * @param fieldObj the instance of that field
     * @return a new CapabilityModel, or null if no value is set.
     */
Create a model object for the tree table.
@param field The field to use
@param fieldObj the instance of that field
@return a new CapabilityModel, or null if no value is set.
Create a model object for the tree table . @param field The field to use @param fieldObj the instance of that field @return a new CapabilityModel or null if no value is set .
private CapabilityModel createCapabilityModel(final Field field, final Object fieldObj)
    {
        final boolean isList = fieldObj instanceof List;
        final CapabilityModel capModel = new CapabilityModel();
        final StringBuilder name = new StringBuilder(field.getName());
        if (isList)
        {
            name.append(" (List)");
        }
        capModel.setName(name.toString());
        final boolean isThType = field.getGenericType().toString().contains(TH_OBJ_IDENTIFIER);
        if (fieldObj == null)
        {
            return null;
        }
        else if (isThType)
        {
            if (fieldObj.getClass().isEnum())
            {
                capModel.setValue(fieldObj.toString());
            }
            else
            {
                capModel.setValue("");
            }
        }
        else
        {
            if (isList)
            {
                final StringBuilder val = new StringBuilder();
                for (Object obj : (List<?>)fieldObj)
                {
                    val.append(obj.toString()).append("\n");
                }
                capModel.setValue(val.toString());
            }
            else
            {
                final String str = fieldObj.toString();
                capModel.setValue(str);
            }
        }
        return capModel;
    }
private CapabilityModel createCapabilityModel ( final Field field , final Object fieldObj ) { final boolean isList = fieldObj instanceof List ; final CapabilityModel capModel = new CapabilityModel ( ) ; final StringBuilder name = new StringBuilder ( field . getName ( ) ) ; if ( isList ) { name . append ( " (List)" ) ; } capModel . setName ( name . toString ( ) ) ; final boolean isThType = field . getGenericType ( ) . toString ( ) . contains ( TH_OBJ_IDENTIFIER ) ; if ( fieldObj == null ) { return null ; } else if ( isThType ) { if ( fieldObj . getClass ( ) . isEnum ( ) ) { capModel . setValue ( fieldObj . toString ( ) ) ; } else { capModel . setValue ( "" ) ; } } else { if ( isList ) { final StringBuilder val = new StringBuilder ( ) ; for ( Object obj : ( List < ? > ) fieldObj ) { val . append ( obj . toString ( ) ) . append ( "\n" ) ; } capModel . setValue ( val . toString ( ) ) ; } else { final String str = fieldObj . toString ( ) ; capModel . setValue ( str ) ; } } return capModel ; }
Create a model object for the tree table.
Create a model object for the tree table .
//If this is an enum, then go ahead and set the value