1 package nl.hippo.cms.workflow; 2 3 import org.xml.sax.Attributes ; 4 import org.xml.sax.ContentHandler ; 5 import org.xml.sax.Locator ; 6 import org.xml.sax.SAXException ; 7 import org.xml.sax.helpers.DefaultHandler ; 8 9 public class DelegatingContentHandler extends DefaultHandler 10 { 11 private ContentHandler m_contentHandler; 12 13 private boolean m_skipDocumentEvents; 14 15 public DelegatingContentHandler(ContentHandler contentHandler) 16 { 17 super(); 18 19 m_contentHandler = contentHandler; 20 } 21 22 public DelegatingContentHandler(ContentHandler contentHandler, boolean skipDocumentEvents) 23 { 24 super(); 25 26 m_contentHandler = contentHandler; 27 m_skipDocumentEvents = skipDocumentEvents; 28 } 29 30 public void endDocument() throws SAXException 31 { 32 if (!m_skipDocumentEvents) 33 { 34 m_contentHandler.endDocument(); 35 } 36 } 37 38 public void startDocument() throws SAXException 39 { 40 if (!m_skipDocumentEvents) 41 { 42 m_contentHandler.startDocument(); 43 } 44 } 45 46 public void characters(char[] ch, int start, int length) throws SAXException 47 { 48 m_contentHandler.characters(ch, start, length); 49 } 50 51 public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException 52 { 53 m_contentHandler.ignorableWhitespace(ch, start, length); 54 } 55 56 public void endPrefixMapping(String prefix) throws SAXException 57 { 58 m_contentHandler.endPrefixMapping(prefix); 59 } 60 61 public void skippedEntity(String name) throws SAXException 62 { 63 m_contentHandler.skippedEntity(name); 64 } 65 66 public void setDocumentLocator(Locator locator) 67 { 68 m_contentHandler.setDocumentLocator(locator); 69 } 70 71 public void processingInstruction(String target, String data) throws SAXException 72 { 73 m_contentHandler.processingInstruction(target, data); 74 } 75 76 public void startPrefixMapping(String prefix, String uri) throws SAXException 77 { 78 m_contentHandler.startPrefixMapping(prefix, uri); 79 } 80 81 public void endElement(String namespaceURI, String localName, String qName) throws SAXException 82 { 83 m_contentHandler.endElement(namespaceURI, localName, qName); 84 } 85 86 public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException 87 { 88 m_contentHandler.startElement(namespaceURI, localName, qName, atts); 89 } 90 91 } 92 | Popular Tags |