jaxp/src/java.xml/share/classes/com/sun/org/apache/xerces/internal/impl/xs/XMLSchemaLoader.java
equal
deleted
inserted
replaced
74 import java.util.Locale; |
74 import java.util.Locale; |
75 import java.util.Map; |
75 import java.util.Map; |
76 import java.util.StringTokenizer; |
76 import java.util.StringTokenizer; |
77 import java.util.WeakHashMap; |
77 import java.util.WeakHashMap; |
78 import javax.xml.XMLConstants; |
78 import javax.xml.XMLConstants; |
|
79 import jdk.xml.internal.JdkXmlUtils; |
79 import org.w3c.dom.DOMConfiguration; |
80 import org.w3c.dom.DOMConfiguration; |
80 import org.w3c.dom.DOMError; |
81 import org.w3c.dom.DOMError; |
81 import org.w3c.dom.DOMErrorHandler; |
82 import org.w3c.dom.DOMErrorHandler; |
82 import org.w3c.dom.DOMException; |
83 import org.w3c.dom.DOMException; |
83 import org.w3c.dom.DOMStringList; |
84 import org.w3c.dom.DOMStringList; |
171 GENERATE_SYNTHETIC_ANNOTATIONS, |
172 GENERATE_SYNTHETIC_ANNOTATIONS, |
172 VALIDATE_ANNOTATIONS, |
173 VALIDATE_ANNOTATIONS, |
173 HONOUR_ALL_SCHEMALOCATIONS, |
174 HONOUR_ALL_SCHEMALOCATIONS, |
174 NAMESPACE_GROWTH, |
175 NAMESPACE_GROWTH, |
175 TOLERATE_DUPLICATES, |
176 TOLERATE_DUPLICATES, |
176 USE_SERVICE_MECHANISM |
177 USE_SERVICE_MECHANISM, |
|
178 XMLConstants.USE_CATALOG |
177 }; |
179 }; |
178 |
180 |
179 // property identifiers |
181 // property identifiers |
180 |
182 |
181 /** Property identifier: symbol table. */ |
183 /** Property identifier: symbol table. */ |
185 /** Property identifier: error reporter. */ |
187 /** Property identifier: error reporter. */ |
186 public static final String ERROR_REPORTER = |
188 public static final String ERROR_REPORTER = |
187 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY; |
189 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_REPORTER_PROPERTY; |
188 |
190 |
189 /** Property identifier: error handler. */ |
191 /** Property identifier: error handler. */ |
190 protected static final String ERROR_HANDLER = |
192 public static final String ERROR_HANDLER = |
191 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY; |
193 Constants.XERCES_PROPERTY_PREFIX + Constants.ERROR_HANDLER_PROPERTY; |
192 |
194 |
193 /** Property identifier: entity resolver. */ |
195 /** Property identifier: entity resolver. */ |
194 public static final String ENTITY_RESOLVER = |
196 public static final String ENTITY_RESOLVER = |
195 Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY; |
197 Constants.XERCES_PROPERTY_PREFIX + Constants.ENTITY_RESOLVER_PROPERTY; |
242 SCHEMA_NONS_LOCATION, |
244 SCHEMA_NONS_LOCATION, |
243 JAXP_SCHEMA_SOURCE, |
245 JAXP_SCHEMA_SOURCE, |
244 SECURITY_MANAGER, |
246 SECURITY_MANAGER, |
245 LOCALE, |
247 LOCALE, |
246 SCHEMA_DV_FACTORY, |
248 SCHEMA_DV_FACTORY, |
247 XML_SECURITY_PROPERTY_MANAGER |
249 XML_SECURITY_PROPERTY_MANAGER, |
|
250 JdkXmlUtils.CATALOG_DEFER, |
|
251 JdkXmlUtils.CATALOG_FILES, |
|
252 JdkXmlUtils.CATALOG_PREFER, |
|
253 JdkXmlUtils.CATALOG_RESOLVE |
248 }; |
254 }; |
249 |
255 |
250 // Data |
256 // Data |
251 |
257 |
252 // features and properties |
258 // features and properties |
811 |
817 |
812 // JAXP spec. allow []s of type String, File, InputStream, |
818 // JAXP spec. allow []s of type String, File, InputStream, |
813 // InputSource also, apart from [] of type Object. |
819 // InputSource also, apart from [] of type Object. |
814 Object[] objArr = (Object[]) fJAXPSource; |
820 Object[] objArr = (Object[]) fJAXPSource; |
815 // make local array for storing target namespaces of schemasources specified in object arrays. |
821 // make local array for storing target namespaces of schemasources specified in object arrays. |
816 ArrayList jaxpSchemaSourceNamespaces = new ArrayList(); |
822 ArrayList<String> jaxpSchemaSourceNamespaces = new ArrayList<>(); |
817 for (int i = 0; i < objArr.length; i++) { |
823 for (int i = 0; i < objArr.length; i++) { |
818 if (objArr[i] instanceof InputStream || |
824 if (objArr[i] instanceof InputStream || |
819 objArr[i] instanceof InputSource) { |
825 objArr[i] instanceof InputSource) { |
820 SchemaGrammar g = (SchemaGrammar)fJAXPCache.get(objArr[i]); |
826 SchemaGrammar g = (SchemaGrammar)fJAXPCache.get(objArr[i]); |
821 if (g != null) { |
827 if (g != null) { |
1278 /* (non-Javadoc) |
1284 /* (non-Javadoc) |
1279 * @see DOMConfiguration#getParameterNames() |
1285 * @see DOMConfiguration#getParameterNames() |
1280 */ |
1286 */ |
1281 public DOMStringList getParameterNames() { |
1287 public DOMStringList getParameterNames() { |
1282 if (fRecognizedParameters == null){ |
1288 if (fRecognizedParameters == null){ |
1283 ArrayList v = new ArrayList(); |
1289 ArrayList<String> v = new ArrayList<>(); |
1284 v.add(Constants.DOM_VALIDATE); |
1290 v.add(Constants.DOM_VALIDATE); |
1285 v.add(Constants.DOM_ERROR_HANDLER); |
1291 v.add(Constants.DOM_ERROR_HANDLER); |
1286 v.add(Constants.DOM_RESOURCE_RESOLVER); |
1292 v.add(Constants.DOM_RESOURCE_RESOLVER); |
1287 v.add(SYMBOL_TABLE); |
1293 v.add(SYMBOL_TABLE); |
1288 v.add(ERROR_REPORTER); |
1294 v.add(ERROR_REPORTER); |
1379 |
1385 |
1380 } |
1386 } |
1381 |
1387 |
1382 } |
1388 } |
1383 |
1389 |
1384 XMLInputSource dom2xmlInputSource(LSInput is) { |
1390 XMLInputSource dom2xmlInputSource(LSInput is) { |
1385 // need to wrap the LSInput with an XMLInputSource |
1391 // need to wrap the LSInput with an XMLInputSource |
1386 XMLInputSource xis = null; |
1392 XMLInputSource xis = null; |
1387 |
1393 |
1388 /** |
1394 /** |
1389 * An LSParser looks at inputs specified in LSInput in |
1395 * An LSParser looks at inputs specified in LSInput in |