Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package juliandrees;
- import org.xml.sax.Attributes;
- import org.xml.sax.ContentHandler;
- import org.xml.sax.Locator;
- import org.xml.sax.SAXException;
- public class CustomContentHandler implements ContentHandler {
- @Override
- public void characters(char[] ch, int start, int length)
- throws SAXException {
- }
- @Override
- public void endDocument() throws SAXException {
- }
- @Override
- public void endElement(String uri, String localName, String qName)
- throws SAXException {
- }
- @Override
- public void endPrefixMapping(String prefix) throws SAXException {
- }
- @Override
- public void ignorableWhitespace(char[] ch, int start, int length)
- throws SAXException {
- }
- @Override
- public void processingInstruction(String target, String data)
- throws SAXException {
- }
- @Override
- public void setDocumentLocator(Locator locator) {
- }
- @Override
- public void skippedEntity(String name) throws SAXException {
- }
- @Override
- public void startDocument() throws SAXException {
- }
- @Override
- public void startElement(String uri, String localName, String qName,
- Attributes atts) throws SAXException {
- if (localName.equalsIgnoreCase("statistics")) {
- YoutubeStats.subCount = Integer.parseInt(atts.getValue("subscriberCount"));
- YoutubeStats.viewCount = Integer.parseInt(atts.getValue("totalUploadViews"));
- }
- }
- @Override
- public void startPrefixMapping(String prefix, String uri)
- throws SAXException {
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment