1 57 58 package com.sun.org.apache.xerces.internal.parsers; 59 60 import java.io.IOException ; 61 62 import com.sun.org.apache.xerces.internal.impl.Constants; 63 import com.sun.org.apache.xerces.internal.xni.XNIException; 64 import com.sun.org.apache.xerces.internal.xni.parser.XMLInputSource; 65 import com.sun.org.apache.xerces.internal.xni.parser.XMLParserConfiguration; 66 67 86 public abstract class XMLParser { 87 88 92 94 95 protected static final String ENTITY_RESOLVER = 96 Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY; 97 98 99 protected static final String ERROR_HANDLER = 100 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY; 101 102 103 private static final String [] RECOGNIZED_PROPERTIES = { 104 ENTITY_RESOLVER, 105 ERROR_HANDLER, 106 }; 107 108 112 113 protected XMLParserConfiguration fConfiguration; 114 115 119 122 protected XMLParser(XMLParserConfiguration config) { 123 124 fConfiguration = config; 126 127 fConfiguration.addRecognizedProperties(RECOGNIZED_PROPERTIES); 129 130 } 132 136 144 public void parse(XMLInputSource inputSource) 145 throws XNIException, IOException { 146 147 reset(); 148 fConfiguration.parse(inputSource); 149 150 } 152 156 159 protected void reset() throws XNIException { 160 } 162 } | Popular Tags |