mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/asset/AssetCommandViewImpl.java
private void addComplexObject(final CommandNodeModel nodeObject)
    {
        final String exceptionTitle = "Error Adding Field:";
        final String exceptionMsg = "An exception has occurred while trying to add an object of type: %s. See the " 
                + "server log for further details.";
        
        final Object containingObject = nodeObject.getContainingObject();
        final Field field = ReflectionsUtil.retrieveField(nodeObject.getName(), containingObject);
        if (field == null)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, String.format(exceptionMsg,
                    nodeObject.getName()), null, true);
            return;
        }

        
        final Object innerObject;
        try
        {
            innerObject = ReflectionsUtil.retrieveInnerObject(containingObject, field.getName(), 
                    nodeObject.getType());
        }
        catch (final ReflectionsUtilException exception)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, 
                    String.format(exceptionMsg, nodeObject.getType()), exception, true);
            return;
        }
        try
        {
            if (innerObject == null)
            {
                ReflectionsUtil.setInnerObject(containingObject, field.getName(), field.getType().newInstance());
            }
        }
        catch (final IllegalAccessException | InstantiationException | ReflectionsUtilException exception)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, 
                    String.format(exceptionMsg, nodeObject.getType()), exception, true);
        }
    }
/**
     * Method that creates and sets a reference object within the command object.
     * 
     * @param nodeObject
     *          {@link CommandNodeModel} that represents the reference object to be instantiated.
     */
Method that creates and sets a reference object within the command object.

@param nodeObject
CommandNodeModel that represents the reference object to be instantiated.
Method that creates and sets a reference object within the command object . @param nodeObject CommandNodeModel that represents the reference object to be instantiated .
private void addComplexObject(final CommandNodeModel nodeObject)
    {
        final String exceptionTitle = "Error Adding Field:";
        final String exceptionMsg = "An exception has occurred while trying to add an object of type: %s. See the " 
                + "server log for further details.";
        final Object containingObject = nodeObject.getContainingObject();
        final Field field = ReflectionsUtil.retrieveField(nodeObject.getName(), containingObject);
        if (field == null)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, String.format(exceptionMsg,
                    nodeObject.getName()), null, true);
            return;
        }
        final Object innerObject;
        try
        {
            innerObject = ReflectionsUtil.retrieveInnerObject(containingObject, field.getName(), 
                    nodeObject.getType());
        }
        catch (final ReflectionsUtilException exception)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, 
                    String.format(exceptionMsg, nodeObject.getType()), exception, true);
            return;
        }
        try
        {
            if (innerObject == null)
            {
                ReflectionsUtil.setInnerObject(containingObject, field.getName(), field.getType().newInstance());
            }
        }
        catch (final IllegalAccessException | InstantiationException | ReflectionsUtilException exception)
        {
            m_GrowlUtil.createLocalFacesMessage(FacesMessage.SEVERITY_ERROR, exceptionTitle, 
                    String.format(exceptionMsg, nodeObject.getType()), exception, true);
        }
    }
private void addComplexObject ( final CommandNodeModel nodeObject ) { final String exceptionTitle = "Error Adding Field:" ; final String exceptionMsg = "An exception has occurred while trying to add an object of type: %s. See the " + "server log for further details." ; final Object containingObject = nodeObject . getContainingObject ( ) ; final Field field = ReflectionsUtil . retrieveField ( nodeObject . getName ( ) , containingObject ) ; if ( field == null ) { m_GrowlUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , exceptionTitle , String . format ( exceptionMsg , nodeObject . getName ( ) ) , null , true ) ; return ; } final Object innerObject ; try { innerObject = ReflectionsUtil . retrieveInnerObject ( containingObject , field . getName ( ) , nodeObject . getType ( ) ) ; } catch ( final ReflectionsUtilException exception ) { m_GrowlUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , exceptionTitle , String . format ( exceptionMsg , nodeObject . getType ( ) ) , exception , true ) ; return ; } try { if ( innerObject == null ) { ReflectionsUtil . setInnerObject ( containingObject , field . getName ( ) , field . getType ( ) . newInstance ( ) ) ; } } catch ( final IllegalAccessException | InstantiationException | ReflectionsUtilException exception ) { m_GrowlUtil . createLocalFacesMessage ( FacesMessage . SEVERITY_ERROR , exceptionTitle , String . format ( exceptionMsg , nodeObject . getType ( ) ) , exception , true ) ; } }
Method that creates and sets a reference object within the command object.
Method that creates and sets a reference object within the command object .