1 16 17 package xni; 18 19 import org.apache.xerces.xni.Augmentations; 20 import org.apache.xerces.xni.QName; 21 import org.apache.xerces.xni.NamespaceContext; 22 import org.apache.xerces.xni.XMLAttributes; 23 import org.apache.xerces.xni.XMLDocumentHandler; 24 import org.apache.xerces.xni.XMLLocator; 25 import org.apache.xerces.xni.XMLResourceIdentifier; 26 import org.apache.xerces.xni.XMLString; 27 import org.apache.xerces.xni.XNIException; 28 import org.apache.xerces.xni.parser.XMLDocumentSource; 29 30 44 public class PassThroughFilter 45 implements XMLDocumentHandler { 46 47 51 52 protected XMLDocumentHandler fDocumentHandler; 53 54 55 protected XMLDocumentSource fDocumentSource; 56 57 61 66 public void setDocumentHandler(XMLDocumentHandler handler) { 67 fDocumentHandler = handler; 68 } 70 74 91 public void startDocument(XMLLocator locator, String encoding, 92 NamespaceContext namespaceContext, Augmentations augs) 93 throws XNIException { 94 if (fDocumentHandler != null) { 95 fDocumentHandler.startDocument(locator, encoding, namespaceContext, augs); 96 } 97 } 99 111 public void xmlDecl(String version, String encoding, 112 String standalone, Augmentations augs) throws XNIException { 113 if (fDocumentHandler != null) { 114 fDocumentHandler.xmlDecl(version, encoding, standalone, augs); 115 } 116 } 118 129 public void doctypeDecl(String rootElement, String publicId, 130 String systemId, Augmentations augs) throws XNIException { 131 if (fDocumentHandler != null) { 132 fDocumentHandler.doctypeDecl(rootElement, publicId, systemId, augs); 133 } 134 } 136 143 public void comment(XMLString text, Augmentations augs) throws XNIException { 144 if (fDocumentHandler != null) { 145 fDocumentHandler.comment(text, augs); 146 } 147 } 149 165 public void processingInstruction(String target, XMLString data, Augmentations augs) 166 throws XNIException { 167 if (fDocumentHandler != null) { 168 fDocumentHandler.processingInstruction(target, data, augs); 169 } 170 } 172 180 public void startElement(QName element, XMLAttributes attributes, Augmentations augs) 181 throws XNIException { 182 if (fDocumentHandler != null) { 183 fDocumentHandler.startElement(element, attributes, augs); 184 } 185 } 187 195 public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) 196 throws XNIException { 197 if (fDocumentHandler != null) { 198 fDocumentHandler.emptyElement(element, attributes, augs); 199 } 200 } 202 209 public void endElement(QName element, Augmentations augs) 210 throws XNIException { 211 if (fDocumentHandler != null) { 212 fDocumentHandler.endElement(element, augs); 213 } 214 } 216 237 public void startGeneralEntity(String name, 238 XMLResourceIdentifier identifier, 239 String encoding, Augmentations augs) 240 throws XNIException { 241 if (fDocumentHandler != null) { 242 fDocumentHandler.startGeneralEntity(name, identifier, encoding, augs); 243 } 244 } 246 262 public void textDecl(String version, String encoding, Augmentations augs) 263 throws XNIException { 264 if (fDocumentHandler != null) { 265 fDocumentHandler.textDecl(version, encoding, augs); 266 } 267 } 269 279 public void endGeneralEntity(String name, Augmentations augs) throws XNIException { 280 if (fDocumentHandler != null) { 281 fDocumentHandler.endGeneralEntity(name, augs); 282 } 283 } 285 292 public void characters(XMLString text, Augmentations augs) throws XNIException { 293 if (fDocumentHandler != null) { 294 fDocumentHandler.characters(text, augs); 295 } 296 } 298 310 public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException { 311 if (fDocumentHandler != null) { 312 fDocumentHandler.ignorableWhitespace(text, augs); 313 } 314 } 316 321 public void startCDATA(Augmentations augs) throws XNIException { 322 if (fDocumentHandler != null) { 323 fDocumentHandler.startCDATA(augs); 324 } 325 } 327 332 public void endCDATA(Augmentations augs) throws XNIException { 333 if (fDocumentHandler != null) { 334 fDocumentHandler.endCDATA(augs); 335 } 336 } 338 343 public void endDocument(Augmentations augs) throws XNIException { 344 if (fDocumentHandler != null) { 345 fDocumentHandler.endDocument(augs); 346 } 347 } 349 350 351 public void setDocumentSource(XMLDocumentSource source){ 352 fDocumentSource = source; 353 } 354 355 356 357 public XMLDocumentSource getDocumentSource(){ 358 return fDocumentSource; 359 } 360 361 } | Popular Tags |