コード例 #1
0
ファイル: ParseHandler.java プロジェクト: adri87/NoticiasTVi
public class ParseHandler extends DefaultHandler {

  private static int count = 0;
  private static final Logger LOGGER = Logger.getLogger("methods.Handler");

  @Override
  public void startDocument() throws SAXException {
    count = 0;
  }

  public void startElement(String uri, String localName, String qName, Attributes attributes) {
    if (qName.equals("entry")) {
      count++;
    }
  }

  public void endDocument() throws SAXException {
    LOGGER.info("Count Twitter: " + count);
  }

  public static int getCount() {
    return count;
  }
}
コード例 #2
0
ファイル: ParseHandler.java プロジェクト: adri87/NoticiasTVi
 public void endDocument() throws SAXException {
   LOGGER.info("Count Twitter: " + count);
 }