public void loadCatalogTrees(Element catalogTrees){
  List<Element> catList=catalogTrees.getChildren("catalogTree");
  if (log.isDebugEnabled()) {
    log.debug("loadCatalogTrees: found " + catList.size() + " CatalogTree objects");
  }
  CatalogTreeManager mgr=InstanceManager.getDefault(jmri.CatalogTreeManager.class);
  for (int i=0; i < catList.size(); i++) {
    Element elem=catList.get(i);
    Attribute attr=elem.getAttribute("systemName");
    if (attr == null) {
      log.warn("unexpected null systemName. elem= " + elem + ", attrs= "+ elem.getAttributes());
      continue;
    }
    String sysName=attr.getValue();
    String userName=null;
    attr=elem.getAttribute("userName");
    if (attr == null) {
      log.warn("unexpected null userName. attrs= " + elem.getAttributes());
      continue;
    }
 else {
      userName=attr.getValue();
    }
    DefaultTreeModel ct=(DefaultTreeModel)mgr.getBySystemName(sysName);
    if (ct != null) {
      continue;
    }
    ct=(DefaultTreeModel)mgr.newCatalogTree(sysName,userName);
    if (log.isDebugEnabled()) {
      log.debug("CatalogTree: sysName= " + sysName + ", userName= "+ userName);
    }
    CatalogTreeNode root=(CatalogTreeNode)ct.getRoot();
    elem=elem.getChild("node");
    loadNode(elem,root,ct);
  }
}

public void loadCatalogTrees ( Element catalogTrees ) { List < Element > catList = catalogTrees . getChildren ( "catalogTree" ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "loadCatalogTrees: found " + catList . size ( ) + " CatalogTree objects" ) ; } CatalogTreeManager mgr = InstanceManager . getDefault ( jmri . CatalogTreeManager . class ) ; for ( int i = 0 ; i < catList . size ( ) ; i ++ ) { Element elem = catList . get ( i ) ; Attribute attr = elem . getAttribute ( "systemName" ) ; if ( attr == null ) { log . warn ( "unexpected null systemName. elem= " + elem + ", attrs= " + elem . getAttributes ( ) ) ; continue ; } String sysName = attr . getValue ( ) ; String userName = null ; attr = elem . getAttribute ( "userName" ) ; if ( attr == null ) { log . warn ( "unexpected null userName. attrs= " + elem . getAttributes ( ) ) ; continue ; } else { userName = attr . getValue ( ) ; } DefaultTreeModel ct = ( DefaultTreeModel ) mgr . getBySystemName ( sysName ) ; if ( ct != null ) { continue ; } ct = ( DefaultTreeModel ) mgr . newCatalogTree ( sysName , userName ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "CatalogTree: sysName= " + sysName + ", userName= " + userName ) ; } CatalogTreeNode root = ( CatalogTreeNode ) ct . getRoot ( ) ; elem = elem . getChild ( "node" ) ; loadNode ( elem , root , ct ) ; } }
utility method to load the individual catalogtree objects .
