1 5 6 package org.exoplatform.services.jcr.api.serialization; 7 8 import org.xml.sax.ContentHandler ; 9 import org.xml.sax.SAXException ; 10 import org.xml.sax.Locator ; 11 import org.xml.sax.Attributes ; 12 13 18 public class MockContentHandler implements ContentHandler { 19 public boolean reached; 20 public int nodes; 21 public int properties; 22 public int docElement; 23 24 public void endDocument() throws SAXException { 25 } 26 27 public void startDocument() throws SAXException { 28 reached = true; 29 } 30 31 public void characters(char ch[], int start, int length) throws SAXException { 32 } 33 34 public void ignorableWhitespace(char ch[], int start, int length) throws SAXException { 35 } 36 37 public void endPrefixMapping(String prefix) throws SAXException { 38 } 39 40 public void skippedEntity(String name) throws SAXException { 41 } 42 43 public void setDocumentLocator(Locator locator) { 44 } 45 46 public void processingInstruction(String target, String data) throws SAXException { 47 } 48 49 public void startPrefixMapping(String prefix, String uri) throws SAXException { 50 } 51 52 public void endElement(String namespaceURI, String localName, String qName) throws SAXException { 53 } 54 55 public void startElement(String namespaceURI, String localName, 56 String qName, Attributes atts) throws SAXException { 57 if ("sv:node".equals(qName)) 58 nodes++; 59 else if ("sv:property".equals(qName)) 60 properties++; 61 else 62 docElement++; 63 64 65 } 66 } 67 68 | Popular Tags |