1 57 package com.sun.org.apache.xerces.internal.jaxp.validation; 58 59 import com.sun.org.apache.xerces.internal.impl.validation.ValidationManager; 60 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponent; 61 import com.sun.org.apache.xerces.internal.xni.parser.XMLComponentManager; 62 import com.sun.org.apache.xerces.internal.xni.parser.XMLConfigurationException; 63 import com.sun.org.apache.xerces.internal.xni.parser.XMLDocumentFilter; 64 65 97 public abstract class InsulatedValidatorComponent implements 98 XMLComponent, XMLComponentManager { 101 102 107 private final XMLDocumentFilter fValidator; 108 109 112 private final XMLComponent fValidatorComponent; 113 114 122 private final ValidationManager fValidationManager = new ValidationManager(); 123 124 127 private XMLComponentManager fManager; 128 129 public InsulatedValidatorComponent( XMLDocumentFilter validator ) { 130 fValidator = validator; 131 fValidatorComponent = (XMLComponent)validator; 132 } 133 134 135 141 public final XMLDocumentFilter getValidator() { 142 return fValidator; 143 } 144 145 146 public final void reset(XMLComponentManager componentManager) throws XMLConfigurationException { 152 fManager = componentManager; 153 fValidatorComponent.reset(this); 154 fValidationManager.reset(); 155 } 156 157 158 public final String [] getRecognizedFeatures() { 159 return fValidatorComponent.getRecognizedFeatures(); 160 } 161 162 163 public final void setFeature(String featureId, boolean state) throws XMLConfigurationException { 164 } 166 167 168 public final String [] getRecognizedProperties() { 169 return fValidatorComponent.getRecognizedProperties(); 170 } 171 172 173 public final void setProperty(String propertyId, Object value) throws XMLConfigurationException { 174 } 176 177 178 public final Boolean getFeatureDefault(String featureId) { 179 return fValidatorComponent.getFeatureDefault(featureId); 180 } 181 182 183 public final Object getPropertyDefault(String propertyId) { 184 return fValidatorComponent.getPropertyDefault(propertyId); 185 } 186 187 188 196 public boolean getFeature(String featureId) throws XMLConfigurationException { 197 return fManager.getFeature(featureId); 198 } 199 200 201 204 public Object getProperty(String propertyId) throws XMLConfigurationException { 205 if( propertyId.equals(XercesConstants.VALIDATION_MANAGER) ) 206 return fValidationManager; 207 return fManager.getProperty(propertyId); 208 } 209 } 210 | Popular Tags |