trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuContentHandlerImpl.java [505:554]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public TreeModel getTreeModel(String uri)
  {
     List<MenuNode> list = _menuList;
     
    // If we have a cached model, return it.
    if (list != null)
      return new ChildPropertyTreeModel(list,"children");

    synchronized(this)
    {
      list = _menuList;
      if (list == null)// double check inside lock
      {
        // Build a Tree model.  Parsing puts the tree model
        // in the map, see method endDocument().
        _currentTreeModelMapKey = uri;
        try
        {
          // Get a parser.  NOTE: we are using the jdk's 1.5 SAXParserFactory
          // and SAXParser here.
          SAXParser parser = _SAX_PARSER_FACTORY.newSAXParser();

          // Call the local menu model's getStream() method. This is a model
          // method so that it can be overridden by any model extending
          // XmlMenuModel.
          InputStream inStream = getModel().getStream(uri);

          // Parse the metadata
          parser.parse(inStream, this);

          inStream.close();
        } catch (SAXException saxex)
        {
          _LOG.severe("SAX Parse Exception parsing " + uri + ": " +
              saxex.getMessage(), saxex);
        } catch (IOException ioe)
        {
          _LOG.severe("Unable to open an InputStream to " + uri, ioe);
        } catch (IllegalArgumentException iae)
        {
          _LOG.severe("InputStream to " + iae + " is null", iae);
        } catch (ParserConfigurationException pce)
        {
          _LOG.severe("Unable to create SAX parser for " + uri, pce);
        }
        list = _menuList;
      }
    }
    return new ChildPropertyTreeModel(list,"children");
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



trinidad-impl/src/main/java/org/apache/myfaces/trinidadinternal/menu/MenuContentHandlerUsingApiImpl.java [508:557]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  public TreeModel getTreeModel(String uri)
  {
     List<MenuNode> list = _menuList;
     
    // If we have a cached model, return it.
    if (list != null)
      return new ChildPropertyTreeModel(list,"children");

    synchronized(this)
    {
      list = _menuList;
      if (list == null)// double check inside lock
      {
        // Build a Tree model.  Parsing puts the tree model
        // in the map, see method endDocument().
        _currentTreeModelMapKey = uri;
        try
        {
          // Get a parser.  NOTE: we are using the jdk's 1.5 SAXParserFactory
          // and SAXParser here.
          SAXParser parser = _SAX_PARSER_FACTORY.newSAXParser();

          // Call the local menu model's getStream() method. This is a model
          // method so that it can be overridden by any model extending
          // XmlMenuModel.
          InputStream inStream = getModel().getStream(uri);

          // Parse the metadata
          parser.parse(inStream, this);

          inStream.close();
        } catch (SAXException saxex)
        {
          _LOG.severe("SAX Parse Exception parsing " + uri + ": " +
              saxex.getMessage(), saxex);
        } catch (IOException ioe)
        {
          _LOG.severe("Unable to open an InputStream to " + uri, ioe);
        } catch (IllegalArgumentException iae)
        {
          _LOG.severe("InputStream to " + iae + " is null", iae);
        } catch (ParserConfigurationException pce)
        {
          _LOG.severe("Unable to create SAX parser for " + uri, pce);
        }
        list = _menuList;
      }
    }
    return new ChildPropertyTreeModel(list,"children");
  }
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



