1 package net.sf.saxon.event; 2 3 import net.sf.saxon.Configuration; 4 import net.sf.saxon.om.NamePool; 5 import net.sf.saxon.trans.XPathException; 6 7 11 12 public abstract class ProxyReceiver extends SequenceReceiver { 13 protected Receiver nextReceiver; 14 protected String systemId; 15 16 public void setSystemId(String systemId) { 17 if (systemId != this.systemId) { 18 this.systemId = systemId; 19 if (nextReceiver != null) { 20 nextReceiver.setSystemId(systemId); 21 } 22 } 23 } 24 25 public String getSystemId() { 26 return systemId; 27 } 28 29 32 33 public void setUnderlyingReceiver(Receiver receiver) { 34 if (receiver != nextReceiver) { 35 nextReceiver = receiver; 36 if (pipelineConfiguration != null) { 37 nextReceiver.setPipelineConfiguration(pipelineConfiguration); 38 } 39 } 40 } 41 42 45 46 public Receiver getUnderlyingReceiver() { 47 return nextReceiver; 48 } 49 50 51 public void setPipelineConfiguration(PipelineConfiguration config) { 52 if (this.pipelineConfiguration != config) { 53 this.pipelineConfiguration = config; 54 if (nextReceiver != null) { 55 nextReceiver.setPipelineConfiguration(config); 56 } 57 } 58 } 59 60 public Configuration getConfiguration() { 61 return pipelineConfiguration.getConfiguration(); 62 } 63 64 67 68 public NamePool getNamePool() { 69 return getConfiguration().getNamePool(); 70 } 71 72 75 76 public void open() throws XPathException { 77 if (nextReceiver == null) { 78 throw new IllegalStateException ("ProxyReceiver.open(): no underlying emitter provided"); 79 } 80 nextReceiver.open(); 81 } 82 83 86 87 public void close() throws XPathException { 88 nextReceiver.close(); 89 } 90 91 94 95 public void startDocument(int properties) throws XPathException { 96 nextReceiver.startDocument(properties); 97 } 98 99 102 103 public void endDocument() throws XPathException { 104 nextReceiver.endDocument(); 105 } 106 107 114 115 public void startElement(int nameCode, int typeCode, int locationId, int properties) throws XPathException { 116 nextReceiver.startElement(nameCode, typeCode, locationId, properties); 117 } 118 119 132 133 public void namespace(int namespaceCode, int properties) throws XPathException { 134 nextReceiver.namespace(namespaceCode, properties); 135 } 136 137 149 150 public void attribute(int nameCode, int typeCode, CharSequence value, int locationId, int properties) 151 throws XPathException { 152 nextReceiver.attribute(nameCode, typeCode, value, locationId, properties); 153 } 154 155 161 162 163 public void startContent() throws XPathException { 164 nextReceiver.startContent(); 165 } 166 167 170 171 public void endElement() throws XPathException { 172 nextReceiver.endElement(); 173 } 174 175 178 179 public void characters(CharSequence chars, int locationId, int properties) throws XPathException { 180 nextReceiver.characters(chars, locationId, properties); 181 } 182 183 184 187 188 public void processingInstruction(String target, CharSequence data, int locationId, int properties) throws XPathException { 189 nextReceiver.processingInstruction(target, data, locationId, properties); 190 } 191 192 195 196 public void comment(CharSequence chars, int locationId, int properties) throws XPathException { 197 nextReceiver.comment(chars, locationId, properties); 198 } 199 200 201 204 205 public void setUnparsedEntity(String name, String uri, String publicId) throws XPathException { 206 nextReceiver.setUnparsedEntity(name, uri, publicId); 207 } 208 209 212 213 public LocationProvider getDocumentLocator() { 214 return pipelineConfiguration.getLocationProvider(); 215 } 216 } 217 218 | Popular Tags |