Exemplo n.º 1
0
 /* (non-Javadoc)
  * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String, java.lang.String, java.lang.String)
  */
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   super.endElement(uri, localName, qName);
   for (DefaultHandler delegate : delegates) {
     delegate.endElement(uri, localName, qName);
   }
 }
Exemplo n.º 2
0
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   super.endElement(uri, localName, qName);
   TAGS nowType = type.get(qName);
   if (nowType == null) return;
   switch (nowType) {
     case ITEM:
       size++;
       sums[size] = sum;
       links[size] = link;
       titles[size] = title;
       times[size] = time;
       tagEntry = false;
       break;
     case SUM:
       sum = sb.toString();
       break;
     case TIME:
       time = sb.toString();
       break;
     case LINK:
       link = sb.toString();
       break;
     case TITLE:
       title = sb.toString();
   }
 }
Exemplo n.º 3
0
  @Override
  public void endElement(final String uri, final String localName, final String name)
      throws SAXException {
    if (localName.equals("XLS")) {
      this.inXLS = false;
    } else if (localName.equals("ResponseHeader")) {
      this.inRepsonseHeader = false;
    } else if (localName.equals("Response")) {
      this.inRepsonse = false;
    } else if (localName.equals("DirectoryResponse")) {
      this.inDirectoryResponse = false;
    } else if (localName.equals("POIContext")) {
      this.inPOIContext = false;
    } else if (localName.equals("POI")) {
      this.inPOI = false;
    } else if (localName.equals("Point")) {
      this.inPoint = false;
    } else if (localName.equals("pos")) {
      this.inPos = false;
      this.mCurPOI.setGeoPoint(GeoPoint.fromInvertedDoubleString(this.sb.toString(), ' '));
    } else if (localName.equals("Distance")) {
      this.inDistance = false;
    } else {
      Log.w(DEBUGTAG, "Unexpected end-tag: '" + name + "'");
    }

    // Reset the stringbuffer
    this.sb.setLength(0);

    super.endElement(uri, localName, name);
  }
  @Override
  public void endElement(String uri, String localName, String qName) throws SAXException {
    super.endElement(uri, localName, qName);

    if (localName.equals("item")) {
      stories.add(story);
      story = null;
      largestImgWidth = 0;
    }
    if (story != null) {
      if (localName.equals("title")) {
        story.setTitle(xmlInnerText.toString().trim());
      } else if (localName.equals("description")) {
        story.setDescription(xmlInnerText.toString().trim());
      } else if (localName.equals("link")) {
        story.setLink(xmlInnerText.toString().trim());
      } else if (localName.equals("pubDate")) {
        SimpleDateFormat dtSourceFormat = story.getSourceDateFormater();
        SimpleDateFormat dtTargetFormat = story.getTargetDateFormater();

        try {
          story.setPubDate(dtSourceFormat.parse(xmlInnerText.toString().trim()));
        } catch (ParseException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        }

        Log.d("Exam01", "Parsed date : " + dtTargetFormat.format(story.getPubDate()));
      }
      xmlInnerText.setLength(0);
    }
  }
  /**
   * The end of an element.
   *
   * @param namespaceURI the namespace.
   * @param localName the element name.
   * @param qName the element name.
   * @throws SAXException for errors.
   */
  @Override
  public void endElement(String namespaceURI, String localName, String qName) throws SAXException {

    DefaultHandler current = getCurrentHandler();
    if (current != this) {
      current.endElement(namespaceURI, localName, qName);
    }
  }
Exemplo n.º 6
0
 @Override
 public void endElement(String uri, String localName, String name) throws SAXException {
   super.endElement(uri, localName, name);
   if (localName.equals("Version_fichier") || localName.equals("Version_fichier_categ")) {
     String grisbiFileVersion = builder.toString();
     if (!checkFileVersion(grisbiFileVersion)) {
       throw new FileVersionNotSupportedException(grisbiFileVersion);
     }
   }
 }
Exemplo n.º 7
0
 @Override
 public void endElement(String uri, String localName, String name) throws SAXException {
   super.endElement(uri, localName, name);
   if (isWhiteSpaceNode(localName)) {
     mBuilder.append(" ");
   }
   if (MIN_CHARS_PER_STRING < mBuilder.length()) {
     flushAccumulator();
   }
 }
 /**
  * @see org.xml.sax.ContentHandler#endElement(java.lang.String, java.lang.String,
  *     java.lang.String)
  */
 @Override
 public void endElement(final String namespaceURI, final String localName, final String qName)
     throws SAXException {
   this.checkForCompletion();
   if (localName.equals(MODEL_ANNOTATION_TAG_NAME)) this.foundAnnotationEndElement = true;
   else if (localName.equals(VIRTUAL_DATABASE_TAG_NAME)) {
     this.foundAnnotationEndElement = true;
     this.foundVdbEndElement = true;
   }
   super.endElement(namespaceURI, localName, qName);
 }
Exemplo n.º 9
0
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   super.endElement(uri, localName, qName);
   if (localName.equals(ELEMENT_COUNT)) {
     mSongCount = Integer.valueOf(mStringBuilder.toString());
     Log.i(TAG, "解析出的匹配歌曲数目:" + mSongCount);
   }
   if (localName.equals(ELEMENT_LRCID)) {
     Log.i(TAG, "歌词下载id:" + mStringBuilder.toString());
     mLyricIds.add(Integer.valueOf(mStringBuilder.toString()));
   }
 }
Exemplo n.º 10
0
 /** {@inheritDoc} */
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   super.endElement(uri, localName, qName);
   if ("bags".equals(qName)
       || ("template-queries").equals(qName)
       || "queries".equals(qName)
       || "items".equals(qName)
       || "tags".equals(qName)
       || "preferences".equals(qName)
       || "invitations".equals(qName)) {
     subHandler = null;
   }
   if ("shared-bags".equals(qName)) {
     if (sharedBagsByUser != null) {
       sharedBagsByUser.put(username, sharedBags);
     }
   }
   if (subHandler != null) {
     subHandler.endElement(uri, localName, qName);
   }
 }
Exemplo n.º 11
0
  @Override
  public void endElement(String uri, String localName, String name) throws SAXException {
    super.endElement(uri, localName, name);

    if (_inHead && localName.equalsIgnoreCase("head")) {
      _inHead = false;
    } else if (_inTitle && localName.equalsIgnoreCase("title")) {
      _inTitle = false;
    } else if (_inBody && localName.equalsIgnoreCase("body")) {
      _inBody = false;
    }
  }
Exemplo n.º 12
0
    @Override
    public void endElement(String uri, String localName, String qName) throws SAXException {
      super.endElement(uri, localName, qName);

      LogUtils.i("jieshu;;;;uri=" + uri + "/localName=" + localName + "/qName=" + qName);
      if (localName.equals("string")) {
        book = new Weather();
        book.setName(builder.toString());
        book.setId(index++);
        books.add(book);
        builder.setLength(0);
      }
    }
Exemplo n.º 13
0
  public void endElement(String uri, String localName, String qName) throws SAXException {
    super.endElement(uri, localName, qName);

    if (qName.equals("available")) {
      available = Integer.parseInt(current.toString());
      infoStation.setAvailable(available);
    } else if (qName.equals("free")) {
      free = Integer.parseInt(current.toString());
      infoStation.setFree(free);
    } else if (qName.equals("total")) {
      total = Integer.parseInt(current.toString());
      infoStation.setTotal(total);
    } else if (qName.equals("ticket")) {
      if (Integer.parseInt(current.toString()) == 1) ticket = true;
      else ticket = false;
      infoStation.setTicket(ticket);
    } else if (qName.equals("open")) {
      if (Integer.parseInt(current.toString()) == 1) open = true;
      else open = false;
      infoStation.setOpen(open);

      infoStation.setStationVelibId(station.getId());
    } else if (qName.equals("updated")) {

      int updated = Integer.parseInt(current.toString());
      infoStation.setUpdated(updated);

      infoStation.setStationVelibId(station.getId());
      try {

        infoStationDao = DatabaseHelper.getInstance(context).getDao(InfoStation.class);
        QueryBuilder<InfoStation, ?> queryBuilder = infoStationDao.queryBuilder();
        queryBuilder.where().eq(InfoStation.COLUMN_INFO_ID_STATION, station.getId());
        PreparedQuery<InfoStation> preparedQuery = queryBuilder.prepare();
        List<InfoStation> infoList = infoStationDao.query(preparedQuery);

        if (infoList.size() == 0) infoStationDao.create(infoStation);
        else if (infoStation.getUpdated() != updated) infoStationDao.update(infoStation);
      } catch (SQLException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }

    /*
     * if(qName.equals("ticket")){ ticket = current.toString() != null;
     * }
     */

  }
Exemplo n.º 14
0
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   super.endElement(uri, localName, qName);
   // if (localName.equals("id")) {
   // emoji.setId(Integer.parseInt(builder.toString()));
   // } else
   if (localName.equals("key")) {
     emoji.setCharacter(builder.toString());
   } else if (localName.equals("string")) {
     emoji.setFaceName(builder.toString());
   } else if (localName.equals("emoji")) {
     emojis.add(emoji);
   }
 }
Exemplo n.º 15
0
 @Override
 public void endElement(String uri, String localName, String name) throws SAXException {
   if ("directive".equals(name)) {
     this.directive = null;
   } else if ("parameter".equals(name)) {
     if (description != null) {
       directiveParameter.setDescription(description.toString());
     }
     this.directiveParameter = null;
   } else if ("description".equals(name)) {
     this.directive.setDescription(description.toString());
     this.description = null;
   }
   super.endElement(uri, localName, name);
 }
 @Override
 public void endElement(String pUri, String pLocalName, String qName) throws SAXException {
   super.endElement(pUri, pLocalName, qName);
   if (qName.equals(BALISE_TR)) {
     alertes.add(alertCourante);
     alertCourante = null;
   }
   if (ligneEncours && qName.equals(BALISE_TD)) {
     alertCourante.ligne = StringUtils.doubleTrim(contenu.toString());
     ligneEncours = false;
   }
   if (qName.equals(BALISE_A)) {
     alertCourante.title = contenu.toString();
   }
   contenu.setLength(0);
 }
Exemplo n.º 17
0
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   if (localName.equals("product")) {
     products.add(product);
   } else if (localName.equals("id")) {
     product.setId(Integer.parseInt(buffer.toString().trim()));
     buffer.setLength(0);
   } else if (localName.equals("name")) {
     product.setName(buffer.toString().trim());
     buffer.setLength(0);
   } else if (localName.equals("price")) {
     product.setPrice(Float.parseFloat(buffer.toString().trim()));
     buffer.setLength(0);
   }
   super.endElement(uri, localName, qName);
 }
Exemplo n.º 18
0
  @Override
  public void endElement(String uri, String localName, String name) throws SAXException {

    super.endElement(uri, localName, name);

    String d = Locale.getDefault().getDisplayLanguage();

    if (this.dictionary != null) {
      if (!localName.equals("ROW")) {

        dictionary.put(localName, sbItem.toString());

      } else {

        dXML.add(dictionary);
      }

      sbItem.setLength(0);
    }
    // } else {
    // if (this.dictionary != null) {
    // if (!localName.equals("ROW")) {
    //
    // dictionary.put(localName, sbItem.toString());
    //
    // } else {
    //
    // for (Enumeration e = dictionary.keys(); e.hasMoreElements();) {
    // // System.out.println(e.nextElement());
    //
    // String k = e.nextElement().toString();
    //
    // // dictionary.
    //
    // }
    //
    // dXML.add(dictionary);
    //
    // }
    //
    // sbItem.setLength(0);
    // }
    //
    // }

  }
Exemplo n.º 19
0
  @Override
  public void endElement(String uri, String localName, String qName) throws SAXException {

    // TODO Auto-generated method stub
    if (localName.equals("fid")) {
      loginfo[0] = val;
      // System.out.println("fid: "+loginfo[0]);

    }
    if (localName.equals("uid")) {
      loginfo[1] = val;
      // System.out.println("uid: "+loginfo[1]);

    }

    if (localName.equals("uname")) {
      loginfo[2] = val;
      // System.out.println("name: "+loginfo[2]);
    }
    if (localName.equals("ueid")) {
      loginfo[3] = val;
      // System.out.println("ueid: "+loginfo[3]);

    }
    if (localName.equals("fname")) {
      loginfo[4] = val;
      // System.out.println("fame: "+loginfo[4]);
    }
    if (localName.equals("time")) {
      loginfo[5] = val;
      // System.out.println("fame: "+loginfo[4]);
    }
    if (localName.equals("content")) {
      loginfo[6] = val;
      // System.out.println("fame: "+loginfo[4]);
    }
    if (localName.equals("error")) {
      this.error = val;
    }
    if (localName.equals("fname")) {
      list.add(loginfo);
    }

    val = "";
    super.endElement(uri, localName, qName);
  }
Exemplo n.º 20
0
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   // 调用DefaultHandler类的endElement方法
   super.endElement(uri, localName, qName);
   // 判断是否针对一本书已经遍历结束
   if (qName.equals("book")) {
     bookList.add(book);
     book = null;
     System.out.println("======================结束遍历某一本书的内容=================");
   } else if (qName.equals("name")) {
     book.setName(value);
   } else if (qName.equals("author")) {
     book.setAuthor(value);
   } else if (qName.equals("year")) {
     book.setYear(value);
   } else if (qName.equals("price")) {
     book.setPrice(value);
   } else if (qName.equals("language")) {
     book.setLanguage(value);
   }
 }
Exemplo n.º 21
0
  @Override
  public void endElement(String uri, String localName, String qName) throws SAXException {
    // TODO Auto-generated method stub
    if (qName.equals("id")) {
      this.id = val;
    }
    if (qName.equals("name")) {
      this.name = val;
    }

    if (qName.equals("uname")) {
      this.uname = val;
    }
    if (qName.equals("no")) {
      this.no = val;
    }
    if (qName.equals("error")) {
      this.error = val;
    }
    val = "";
    super.endElement(uri, localName, qName);
  }
Exemplo n.º 22
0
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   super.endElement(uri, localName, qName);
   if (qName != null && qName.length() > 0) localName = qName;
   L.d(tab() + "</" + localName + ">");
   // String currentElement = elements.peek();
   if (insideFeed && "feed".equals(localName)) {
     insideFeed = false;
   } else if ("entry".equals(localName)) {
     if (!insideFeed || !insideEntry) throw new SAXException("unexpected element " + localName);
     if (entryInfo.link != null || entryInfo.getBestAcquisitionLink() != null) {
       entries.add(entryInfo);
     }
     insideEntry = false;
     entryInfo = null;
   } else if ("author".equals(localName)) {
     if (authorInfo != null && authorInfo.name != null) entryInfo.authors.add(authorInfo);
     authorInfo = null;
   }
   currentAttributes = null;
   if (level > 0) level--;
 }
Exemplo n.º 23
0
  @Override
  public void endElement(String uri, String localName, String name) throws SAXException {

    super.endElement(uri, localName, name);

    String d = Locale.getDefault().getDisplayLanguage();

    // if (d.toUpperCase().equals("ESPA�OL")) {

    if (this.dictionary != null) {
      if (!localName.equals("RESULTS")) {

        dictionary.put(localName, sbItem.toString());

      } else {

        dXML.add(dictionary);
      }

      sbItem.setLength(0);
    }
  }
Exemplo n.º 24
0
  @Override
  public void endElement(String uri, String localName, String name) throws SAXException {

    super.endElement(uri, localName, name);

    if (this.noticiaActual != null) {

      if (localName.equals("title")) {
        noticiaActual.setTitulo(sbTexto.toString());
      } else if (localName.equals("link")) {
        noticiaActual.setLink(sbTexto.toString());
      } else if (localName.equals("description")) {
        noticiaActual.setDescripcion(sbTexto.toString());
      } else if (localName.equals("guid")) {
        noticiaActual.setGuid(sbTexto.toString());
      } else if (localName.equals("pubDate")) {
        noticiaActual.setFecha(sbTexto.toString());
      } else if (localName.equals("item")) {
        noticias.add(noticiaActual);
      }

      sbTexto.setLength(0);
    }
  }
Exemplo n.º 25
0
 public void endElement(String pUri, String pLocalName, String pName) throws SAXException {
   super.endElement(pUri, pLocalName, pName);
   mCurrentHandler = mParent;
 }
Exemplo n.º 26
0
  public void endElement(String uri, String localName, String name) throws SAXException {

    tagName = "";
    super.endElement(uri, localName, name);
  }
Exemplo n.º 27
0
  /** {@inheritDoc} */
  @Override
  public void endElement(String uri, String localName, String qName) throws SAXException {
    super.endElement(uri, localName, qName);
    if ("userprofile".equals(qName)) {
      Profile profile;
      profile = profileHandler.getProfile();
      profileManager.createProfileWithoutBags(profile);
      try {
        Map<String, Set<BagValue>> bagValues = profileHandler.getBagsValues();
        for (StorableBag bag : profile.getAllBags().values()) {
          bag.saveWithBagValues(profile.getUserId(), bagValues.get(bag.getName()));
        }
      } catch (ObjectStoreException ose) {
        throw new SAXException(ose);
      }
      // Must come after the bags themselves have been stored.
      try {
        SharedBagManager.getInstance(profileManager);
        profileHandler.getInvitationHandler().storeInvites(profile);
      } catch (SQLException e) {
        LOG.error("Cannot store invitations", e);
        if (abortOnError) {
          throw new SAXException(e);
        }
      }
      Set<Tag> tags = profileHandler.getTags();
      TagManager tagManager = new TagManagerFactory(profile.getProfileManager()).getTagManager();
      for (Tag tag : tags) {
        try {
          tagManager.addTag(tag.getTagName(), tag.getObjectIdentifier(), tag.getType(), profile);
        } catch (TagManager.TagException e) {
          LOG.error("Cannot add tag: " + tag.toString(), e);
          if (abortOnError) {
            throw new SAXException(e);
          }
        } catch (RuntimeException e) {
          LOG.error("Error adding tag: " + tag.toString(), e);
          if (abortOnError) {
            throw new SAXException(e);
          }
        }
      }
      profile.getSearchRepository().receiveEvent(new MassTaggingEvent());
      profileHandler = null;
      long totalTime = System.currentTimeMillis() - startTime;
      LOG.info("Finished profile: " + profile.getUsername() + " took " + totalTime + "ms.");
    }
    if ("userprofiles".equals(qName)) {
      if (!sharedBagsByUsers.isEmpty()) {
        SharedBagManager sharedBagManager = SharedBagManager.getInstance(profileManager);
        String bagName, dateCreated;
        for (String user : sharedBagsByUsers.keySet()) {
          List<Map<String, String>> sharedBags = sharedBagsByUsers.get(user);
          if (!sharedBags.isEmpty()) {
            for (Map<String, String> sharedBag : sharedBags) {
              bagName = sharedBag.get("name");
              dateCreated = sharedBag.get("dateCreated");
              sharedBagManager.shareBagWithUser(bagName, dateCreated, user);
            }
          }
        }
      }
    }
    if (profileHandler != null) {
      profileHandler.endElement(uri, localName, qName);
    }

    if (trackHandler != null) {
      trackHandler.endElement(uri, localName, qName);
    }
  }
Exemplo n.º 28
0
 /*
  * (non-Javadoc)
  *
  * @see org.xml.sax.helpers.DefaultHandler#endElement(java.lang.String,
  * java.lang.String, java.lang.String) 元素结束的通知
  */
 @Override
 public void endElement(String uri, String localName, String qName) throws SAXException {
   // TODO Auto-generated method stub
   super.endElement(uri, localName, qName);
   preTag = null;
 }
  @Override
  public void endElement(String uri, String localName, String qName) throws SAXException {

    super.endElement(uri, localName, qName);
    String curel = localName;
    String str = curchars.toString();
    if (str != null) {
      str = str.trim();
    }

    if (curel.equals("application") && curapp != null) {

      // If we already have this application (must be from scanning a
      // different repo) then just merge in the apks.
      // TODO: Scanning the whole app list like this every time is
      // going to be stupid if the list gets very big!
      boolean merged = false;
      for (DB.App app : apps) {
        if (app.id.equals(curapp.id)) {
          app.apks.addAll(curapp.apks);
          merged = true;
          break;
        }
      }
      if (!merged) apps.add(curapp);

      curapp = null;

    } else if (curel.equals("package") && curapk != null && curapp != null) {
      curapp.apks.add(curapk);
      curapk = null;
    } else if (curapk != null && str != null) {
      if (curel.equals("version")) {
        curapk.version = str;
      } else if (curel.equals("versioncode")) {
        try {
          curapk.vercode = Integer.parseInt(str);
        } catch (NumberFormatException ex) {
          curapk.vercode = 0;
        }
      } else if (curel.equals("size")) {
        try {
          curapk.detail_size = Integer.parseInt(str);
        } catch (NumberFormatException ex) {
          curapk.detail_size = 0;
        }
      } else if (curel.equals("hash")) {
        if (hashType == null || hashType.equals("md5")) {
          if (curapk.detail_hash == null) {
            curapk.detail_hash = str;
            curapk.detail_hashType = "MD5";
          }
        } else if (hashType.equals("sha256")) {
          curapk.detail_hash = str;
          curapk.detail_hashType = "SHA-256";
        }
      } else if (curel.equals("sig")) {
        curapk.sig = str;
      } else if (curel.equals("srcname")) {
        curapk.srcname = str;
      } else if (curel.equals("apkname")) {
        curapk.apkName = str;
      } else if (curel.equals("sdkver")) {
        try {
          curapk.minSdkVersion = Integer.parseInt(str);
        } catch (NumberFormatException ex) {
          curapk.minSdkVersion = 0;
        }
      } else if (curel.equals("added")) {
        try {
          curapk.added = str.length() == 0 ? null : mXMLDateFormat.parse(str);
        } catch (ParseException e) {
          curapk.added = null;
        }
      } else if (curel.equals("permissions")) {
        curapk.detail_permissions = DB.CommaSeparatedList.make(str);
      } else if (curel.equals("features")) {
        curapk.features = DB.CommaSeparatedList.make(str);
      }
    } else if (curapp != null && str != null) {
      if (curel.equals("id")) {
        curapp.id = str;
      } else if (curel.equals("name")) {
        curapp.name = str;
      } else if (curel.equals("icon")) {
        curapp.icon = str;
      } else if (curel.equals("description")) {
        // This is the old-style description. We'll read it
        // if present, to support old repos, but in newer
        // repos it will get overwritten straight away!
        curapp.detail_description = "<p>" + str + "</p>";
      } else if (curel.equals("desc")) {
        // New-style description.
        curapp.detail_description = str;
      } else if (curel.equals("summary")) {
        curapp.summary = str;
      } else if (curel.equals("license")) {
        curapp.license = str;
      } else if (curel.equals("category")) {
        curapp.category = str;
      } else if (curel.equals("source")) {
        curapp.detail_sourceURL = str;
      } else if (curel.equals("donate")) {
        curapp.detail_donateURL = str;
      } else if (curel.equals("web")) {
        curapp.detail_webURL = str;
      } else if (curel.equals("tracker")) {
        curapp.detail_trackerURL = str;
      } else if (curel.equals("added")) {
        try {
          curapp.added = str.length() == 0 ? null : mXMLDateFormat.parse(str);
        } catch (ParseException e) {
          curapp.added = null;
        }
      } else if (curel.equals("lastupdated")) {
        try {
          curapp.lastUpdated = str.length() == 0 ? null : mXMLDateFormat.parse(str);
        } catch (ParseException e) {
          curapp.lastUpdated = null;
        }
      } else if (curel.equals("marketversion")) {
        curapp.curVersion = str;
      } else if (curel.equals("marketvercode")) {
        try {
          curapp.curVercode = Integer.parseInt(str);
        } catch (NumberFormatException ex) {
          curapp.curVercode = 0;
        }
      } else if (curel.equals("antifeatures")) {
        curapp.antiFeatures = DB.CommaSeparatedList.make(str);
      } else if (curel.equals("requirements")) {
        curapp.requirements = DB.CommaSeparatedList.make(str);
      }
    }
  }
Exemplo n.º 30
0
  @Override
  public void endElement(String uri, String localName, String qName) throws SAXException {
    super.endElement(uri, localName, qName);

    if (localName.equals("group")) {
      studyGroupList.add(new StudyGroup(studygroup_id, studyGroupName, problemList, noteList));

    } else if (localName.equals("note")) {
      in_note = false;
      noteList.add(
          new Note(0, note_id, studygroup_id, note_title, note_content, note_user, note_time));

    } else if (localName.equals("problem")) {
      problemList.add(
          new Problem(
              problem_id,
              "",
              problem_name,
              studygroup_id,
              problem_user,
              problem_time,
              annoationList,
              solutionList));
    } else if (localName.equals("annotation")) {
      in_annotation = false;
      annoationList.add(new Annotate(annotate_id, "", annotate_comment, "", annotate_imagepath));
    } else if (in_annotation && localName.equals("id")) {
      cuurentElement = false;
      in_id = false;
      annotate_id = Long.valueOf(currentValue.toString());
    } else if (in_note && localName.equals("id")) {
      cuurentElement = false;
      in_id = false;
      note_id = Long.valueOf(currentValue.toString());
    } else if (localName.equals("title")) {
      cuurentElement = false;
      note_title = currentValue.toString();

    } else if (localName.equals("content")) {
      cuurentElement = false;
      note_content = currentValue.toString();

    } else if (localName.equals("name")) {
      cuurentElement = false;
      problem_name = currentValue.toString();

    } else if (localName.equals("comment")) {
      cuurentElement = false;
      annotate_comment = currentValue.toString();

    } else if (localName.equals("image_path")) {
      cuurentElement = false;
      annotate_imagepath = currentValue.toString();
    } else if (localName.equals("posted_by")) {
      cuurentElement = false;
      note_user = currentValue.toString();
    } else if (localName.equals("solution")) {
      in_solution = false;
      solutionList.add(new Solution(0, solution_id, problem_id, solution_reply, solution_user));
    } else if (localName.equals("reply")) {
      cuurentElement = false;
      solution_reply = currentValue.toString();
    } else if (localName.equals("replied_by")) {
      cuurentElement = false;
      solution_user = currentValue.toString();
    } else if (in_solution && localName.equals("id")) {
      cuurentElement = false;
      in_id = false;
      solution_id = Long.valueOf(currentValue.toString());
    } else if (localName.equals("posted_time")) {
      cuurentElement = false;
      note_time = currentValue.toString();
    }
  }