mil.dod.th.ose.gui.webapp/src/mil/dod/th/ose/gui/webapp/general/CapabilitiesTree.java
private void addChildren(final Class<?> clazz, final TreeNode parent, final Object obj)
    {        
        //Get any parent capabilities
        if (clazz.getSuperclass() != null)
        {
            addChildren(clazz.getSuperclass(), parent, obj);
        }
        
        for (Field f : clazz.getDeclaredFields())
        {
            f.setAccessible(true);
            
            //Test to see if this field has JAXB Annotations
            boolean hasAnnos = false;
            for (Annotation anno : f.getAnnotations())
            {
                if (anno.annotationType().getName().startsWith(XmlElement.class.getPackage().getName()))
                {
                    hasAnnos = true;
                    break;
                }
            }
            
            if (hasAnnos)
            {
                try 
                {
                    if (f.get(obj) != null)
                    {
                        processCapabilityElement(f, obj, parent);
                    }
                } 
                catch (final IllegalAccessException e) 
                {
                    Logging.log(LogService.LOG_ERROR, e, 
                            "Error Parsing Capabilities for Type %s", parent.getType());
                }        
            }            
        }
    }
/**
     * Recursively add children to tree node by going through Capabilities class.
     * If a value is deemed of a Terra Harvest type (using class package name)
     * then the attributes of that class are investigated until only non-JAXB attributes are found. 
     * Likewise, if the attribute
     * is a list, then each item is investigated.
     * Nodes are automatically expanded.
     * @param clazz the class
     * @param parent the parent tree node to add new objects
     * @param obj the object to be analyzed
     */
Recursively add children to tree node by going through Capabilities class.
If a value is deemed of a Terra Harvest type (using class package name)
then the attributes of that class are investigated until only non-JAXB attributes are found.
Likewise, if the attribute
is a list, then each item is investigated.
Nodes are automatically expanded.
@param clazz the class
@param parent the parent tree node to add new objects
@param obj the object to be analyzed
Recursively add children to tree node by going through Capabilities class . If a value is deemed of a Terra Harvest type ( using class package name ) then the attributes of that class are investigated until only non - JAXB attributes are found . Likewise if the attribute is a list then each item is investigated . Nodes are automatically expanded . @param clazz the class @param parent the parent tree node to add new objects @param obj the object to be analyzed
private void addChildren(final Class<?> clazz, final TreeNode parent, final Object obj)
    {        
        if (clazz.getSuperclass() != null)
        {
            addChildren(clazz.getSuperclass(), parent, obj);
        }
        for (Field f : clazz.getDeclaredFields())
        {
            f.setAccessible(true);
            boolean hasAnnos = false;
            for (Annotation anno : f.getAnnotations())
            {
                if (anno.annotationType().getName().startsWith(XmlElement.class.getPackage().getName()))
                {
                    hasAnnos = true;
                    break;
                }
            }
            if (hasAnnos)
            {
                try 
                {
                    if (f.get(obj) != null)
                    {
                        processCapabilityElement(f, obj, parent);
                    }
                } 
                catch (final IllegalAccessException e) 
                {
                    Logging.log(LogService.LOG_ERROR, e, 
                            "Error Parsing Capabilities for Type %s", parent.getType());
                }        
            }            
        }
    }
private void addChildren ( final Class < ? > clazz , final TreeNode parent , final Object obj ) { if ( clazz . getSuperclass ( ) != null ) { addChildren ( clazz . getSuperclass ( ) , parent , obj ) ; } for ( Field f : clazz . getDeclaredFields ( ) ) { f . setAccessible ( true ) ; boolean hasAnnos = false ; for ( Annotation anno : f . getAnnotations ( ) ) { if ( anno . annotationType ( ) . getName ( ) . startsWith ( XmlElement . class . getPackage ( ) . getName ( ) ) ) { hasAnnos = true ; break ; } } if ( hasAnnos ) { try { if ( f . get ( obj ) != null ) { processCapabilityElement ( f , obj , parent ) ; } } catch ( final IllegalAccessException e ) { Logging . log ( LogService . LOG_ERROR , e , "Error Parsing Capabilities for Type %s" , parent . getType ( ) ) ; } } } }
Recursively add children to tree node by going through Capabilities class.
Recursively add children to tree node by going through Capabilities class .
//Get any parent capabilities //Test to see if this field has JAXB Annotations