code: public void loadTileSets (InputStream source, Map<String, TileSet> tilesets)
          throws IOException
      {
          // stick an array list on the top of the stack for collecting
          // parsed tilesets
          List<TileSet> setlist = Lists.newArrayList();
          _digester.push(setlist);
  
          // now fire up the digester to parse the stream
          try {
              _digester.parse(source);
          } catch (SAXException saxe) {
              log.warning("Exception parsing tile set descriptions.", saxe);
          }
  
          // stick the tilesets from the list into the hashtable
          for (int ii = 0; ii < setlist.size(); ii++) {
              TileSet set = setlist.get(ii);
              if (set.getName() == null) {
                  log.warning("Tileset did not receive name during " +
                              "parsing process [set=" + set + "].");
              } else {
                  tilesets.put(set.getName(), set);
              }
          }
  
          // and clear out the list for next time
          setlist.clear();
      }
docs: Loads all of the tilesets specified in the supplied XML tileset
  description file and places them into the supplied map indexed
  by tileset name. This method is not reentrant, so don't go calling
  it from multiple threads.
  
  @param source an input stream from which the tileset definition
  file can be read.
  @param tilesets the map into which the tilesets will be placed,
  indexed by tileset name.