1 57 package com.sun.org.apache.xerces.internal.jaxp.validation.xs; 58 59 import com.sun.org.apache.xerces.internal.impl.Constants; 60 import com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator; 61 import com.sun.org.apache.xerces.internal.jaxp.validation.InsulatedValidatorComponent; 62 import com.sun.org.apache.xerces.internal.jaxp.validation.XercesConstants; 63 import com.sun.org.apache.xerces.internal.xni.grammars.XMLGrammarPool; 64 65 71 class InsulatedSchemaValidator extends InsulatedValidatorComponent { 72 73 78 private final XMLGrammarPool pool; 79 80 83 private final boolean ignoreLocationHints; 84 85 InsulatedSchemaValidator( XMLGrammarPool _pool, boolean _ignoreLocationHints ) { 86 super( new XMLSchemaValidator() ); 87 this.pool = _pool; 88 this.ignoreLocationHints = _ignoreLocationHints; 89 } 90 91 public Object getProperty(String propName) { 92 if( propName.equals(XercesConstants.XMLGRAMMAR_POOL) ) 93 return pool; 94 return super.getProperty(propName); 95 } 96 97 public boolean getFeature(String propName) { 98 if( propName.equals(XercesConstants.IGNORE_SCHEMA_LOCATION_HINTS) ) 99 return ignoreLocationHints; 100 if( propName.equals(Constants.XERCES_FEATURE_PREFIX + Constants.CHANGE_IGNORABLE_CHARACTERS_INTO_IGNORABLE_WHITESPACES) ) 101 return true; 102 if( propName.equals(Constants.XERCES_FEATURE_PREFIX + Constants.SCHEMA_ELEMENT_DEFAULT) ) 103 return true; 104 return super.getFeature(propName); 105 } 106 } 107 | Popular Tags |