public UNode toDoc() {
        // The root node is always a MAP whose name is the application's name. In case it
        // is serialized to XML, we set this node's tag name to "application".
        UNode appNode = UNode.createMapNode(m_appName, "application");
        
        // Add the application's key.
        if (!Utils.isEmpty(m_key)) {
            appNode.addValueNode("key", m_key);
        }
        
        // Add options, if any, in a MAP node.
        if (m_optionMap.size() > 0) {
            UNode optsNode = appNode.addMapNode("options");
            for (String optName : m_optionMap.keySet()) {
                // Set each option's tag name to "option" for XML's sake.
                optsNode.addValueNode(optName, m_optionMap.get(optName), "option");
            }
        }
        
        // Add tables, if any, in a MAP node.
        if (m_tableMap.size() > 0) {
            UNode tablesNode = appNode.addMapNode("tables");
            for (TableDefinition tableDef : m_tableMap.values()) {
                tablesNode.addChildNode(tableDef.toDoc());
            }
        }
        
        return appNode;
    }
public UNode toDoc ( ) { UNode appNode = UNode . createMapNode ( m_appName , "application" ) ; if ( ! Utils . isEmpty ( m_key ) ) { appNode . addValueNode ( "key" , m_key ) ; } if ( m_optionMap . size ( ) > 0 ) { UNode optsNode = appNode . addMapNode ( "options" ) ; for ( String optName : m_optionMap . keySet ( ) ) { optsNode . addValueNode ( optName , m_optionMap . get ( optName ) , "option" ) ; } } if ( m_tableMap . size ( ) > 0 ) { UNode tablesNode = appNode . addMapNode ( "tables" ) ; for ( TableDefinition tableDef : m_tableMap . values ( ) ) { tablesNode . addChildNode ( tableDef . toDoc ( ) ) ; } } return appNode ; }
Get this application's definition including tables, schedules, etc. as a
{@link UNode} tree.

@return  The root of a {@link UNode} tree.