1 16 17 package org.apache.xerces.parsers; 18 19 import java.io.IOException ; 20 21 import org.apache.xerces.impl.Constants; 22 import org.apache.xerces.xni.XNIException; 23 import org.apache.xerces.xni.parser.XMLInputSource; 24 import org.apache.xerces.xni.parser.XMLParserConfiguration; 25 26 45 public abstract class XMLParser { 46 47 51 53 54 protected static final String ENTITY_RESOLVER = 55 Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY; 56 57 58 protected static final String ERROR_HANDLER = 59 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY; 60 61 62 private static final String [] RECOGNIZED_PROPERTIES = { 63 ENTITY_RESOLVER, 64 ERROR_HANDLER, 65 }; 66 67 71 72 protected XMLParserConfiguration fConfiguration; 73 74 78 81 protected XMLParser(XMLParserConfiguration config) { 82 83 fConfiguration = config; 85 86 fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); 88 89 } 91 95 103 public void parse(XMLInputSource inputSource) 104 throws XNIException, IOException { 105 106 reset(); 107 fConfiguration.parse(inputSource); 108 109 } 111 115 118 protected void reset() throws XNIException { 119 } 121 } | Popular Tags |