1 7 8 package org.dom4j.io; 9 10 import org.dom4j.DocumentFactory; 11 12 import org.xml.sax.SAXException ; 13 import org.xml.sax.XMLReader ; 14 15 27 class SAXModifyReader extends SAXReader { 28 private XMLWriter xmlWriter; 29 30 private boolean pruneElements; 31 32 public SAXModifyReader() { 33 } 34 35 public SAXModifyReader(boolean validating) { 36 super(validating); 37 } 38 39 public SAXModifyReader(DocumentFactory factory) { 40 super(factory); 41 } 42 43 public SAXModifyReader(DocumentFactory factory, boolean validating) { 44 super(factory, validating); 45 } 46 47 public SAXModifyReader(XMLReader xmlReader) { 48 super(xmlReader); 49 } 50 51 public SAXModifyReader(XMLReader xmlReader, boolean validating) { 52 super(xmlReader, validating); 53 } 54 55 public SAXModifyReader(String xmlReaderClassName) throws SAXException { 56 super(xmlReaderClassName); 57 } 58 59 public SAXModifyReader(String xmlReaderClassName, boolean validating) 60 throws SAXException { 61 super(xmlReaderClassName, validating); 62 } 63 64 public void setXMLWriter(XMLWriter writer) { 65 this.xmlWriter = writer; 66 } 67 68 public boolean isPruneElements() { 69 return pruneElements; 70 } 71 72 public void setPruneElements(boolean pruneElements) { 73 this.pruneElements = pruneElements; 74 } 75 76 protected SAXContentHandler createContentHandler(XMLReader reader) { 77 SAXModifyContentHandler handler = new SAXModifyContentHandler( 78 getDocumentFactory(), getDispatchHandler()); 79 80 handler.setXMLWriter(xmlWriter); 81 82 return handler; 83 } 84 85 protected XMLWriter getXMLWriter() { 86 return this.xmlWriter; 87 } 88 } 89 90 126 | Popular Tags |