changeset 39907 | db51759e3695 |
parent 33349 | 975138b77cff |
child 42247 | 52fafb950d5a |
39906:230d872f56ea | 39907:db51759e3695 |
---|---|
1 /* |
1 /* |
2 * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. |
3 */ |
3 */ |
4 /* |
4 /* |
5 * Licensed to the Apache Software Foundation (ASF) under one or more |
5 * Licensed to the Apache Software Foundation (ASF) under one or more |
6 * contributor license agreements. See the NOTICE file distributed with |
6 * contributor license agreements. See the NOTICE file distributed with |
7 * this work for additional information regarding copyright ownership. |
7 * this work for additional information regarding copyright ownership. |
84 import java.util.Iterator; |
84 import java.util.Iterator; |
85 import java.util.Map; |
85 import java.util.Map; |
86 import java.util.Stack; |
86 import java.util.Stack; |
87 import java.util.Vector; |
87 import java.util.Vector; |
88 import javax.xml.XMLConstants; |
88 import javax.xml.XMLConstants; |
89 import jdk.xml.internal.JdkXmlUtils; |
|
90 import jdk.xml.internal.SecuritySupport; |
|
89 |
91 |
90 /** |
92 /** |
91 * The XML Schema validator. The validator implements a document |
93 * The XML Schema validator. The validator implements a document |
92 * filter: receiving document events from the scanner; validating |
94 * filter: receiving document events from the scanner; validating |
93 * the content and structure; augmenting the InfoSet, if applicable; |
95 * the content and structure; augmenting the InfoSet, if applicable; |
262 private static final String XML_SECURITY_PROPERTY_MANAGER = |
264 private static final String XML_SECURITY_PROPERTY_MANAGER = |
263 Constants.XML_SECURITY_PROPERTY_MANAGER; |
265 Constants.XML_SECURITY_PROPERTY_MANAGER; |
264 |
266 |
265 protected static final String USE_SERVICE_MECHANISM = Constants.ORACLE_FEATURE_SERVICE_MECHANISM; |
267 protected static final String USE_SERVICE_MECHANISM = Constants.ORACLE_FEATURE_SERVICE_MECHANISM; |
266 |
268 |
269 protected static final String USE_CATALOG = XMLConstants.USE_CATALOG; |
|
270 |
|
267 // recognized features and properties |
271 // recognized features and properties |
268 |
272 |
269 /** Recognized features. */ |
273 /** Recognized features. */ |
270 private static final String[] RECOGNIZED_FEATURES = |
274 private static final String[] RECOGNIZED_FEATURES = |
271 { |
275 { |
284 ID_IDREF_CHECKING, |
288 ID_IDREF_CHECKING, |
285 IDENTITY_CONSTRAINT_CHECKING, |
289 IDENTITY_CONSTRAINT_CHECKING, |
286 UNPARSED_ENTITY_CHECKING, |
290 UNPARSED_ENTITY_CHECKING, |
287 NAMESPACE_GROWTH, |
291 NAMESPACE_GROWTH, |
288 TOLERATE_DUPLICATES, |
292 TOLERATE_DUPLICATES, |
289 USE_SERVICE_MECHANISM |
293 USE_SERVICE_MECHANISM, |
294 USE_CATALOG |
|
290 }; |
295 }; |
291 |
296 |
292 /** Feature defaults. */ |
297 /** Feature defaults. */ |
293 private static final Boolean[] FEATURE_DEFAULTS = { null, |
298 private static final Boolean[] FEATURE_DEFAULTS = { null, |
294 // NOTE: The following defaults are nulled out on purpose. |
299 // NOTE: The following defaults are nulled out on purpose. |
315 null, |
320 null, |
316 null, |
321 null, |
317 null, |
322 null, |
318 null, |
323 null, |
319 null, |
324 null, |
320 Boolean.TRUE |
325 Boolean.TRUE, |
326 JdkXmlUtils.USE_CATALOG_DEFAULT |
|
321 }; |
327 }; |
322 |
328 |
323 /** Recognized properties. */ |
329 /** Recognized properties. */ |
324 private static final String[] RECOGNIZED_PROPERTIES = |
330 private static final String[] RECOGNIZED_PROPERTIES = |
325 { |
331 { |
332 JAXP_SCHEMA_SOURCE, |
338 JAXP_SCHEMA_SOURCE, |
333 JAXP_SCHEMA_LANGUAGE, |
339 JAXP_SCHEMA_LANGUAGE, |
334 ROOT_TYPE_DEF, |
340 ROOT_TYPE_DEF, |
335 ROOT_ELEMENT_DECL, |
341 ROOT_ELEMENT_DECL, |
336 SCHEMA_DV_FACTORY, |
342 SCHEMA_DV_FACTORY, |
337 XML_SECURITY_PROPERTY_MANAGER |
343 XML_SECURITY_PROPERTY_MANAGER, |
344 JdkXmlUtils.CATALOG_DEFER, |
|
345 JdkXmlUtils.CATALOG_FILES, |
|
346 JdkXmlUtils.CATALOG_PREFER, |
|
347 JdkXmlUtils.CATALOG_RESOLVE |
|
338 }; |
348 }; |
339 |
349 |
340 /** Property defaults. */ |
350 /** Property defaults. */ |
341 private static final Object[] PROPERTY_DEFAULTS = |
351 private static final Object[] PROPERTY_DEFAULTS = |
342 { null, null, null, null, null, null, null, null, null, null, null, null}; |
352 { null, null, null, null, null, null, null, null, null, null, null, null, |
353 null, null, null, null}; |
|
343 |
354 |
344 // this is the number of valuestores of each kind |
355 // this is the number of valuestores of each kind |
345 // we expect an element to have. It's almost |
356 // we expect an element to have. It's almost |
346 // never > 1; so leave it at that. |
357 // never > 1; so leave it at that. |
347 protected static final int ID_CONSTRAINT_NUM = 1; |
358 protected static final int ID_CONSTRAINT_NUM = 1; |