1 28 29 package net.n3.nanoxml; 30 31 import java.util.Properties ; 32 33 39 public class ValidatorPlugin implements IXMLValidator 40 { 41 42 45 private IXMLValidator delegate; 46 47 50 public ValidatorPlugin() 51 { 52 this.delegate = null; 53 } 54 55 58 protected void finalize() throws Throwable 59 { 60 this.delegate = null; 61 super.finalize(); 62 } 63 64 67 public IXMLValidator getDelegate() 68 { 69 return this.delegate; 70 } 71 72 77 public void setDelegate(IXMLValidator delegate) 78 { 79 this.delegate = delegate; 80 } 81 82 87 public void setParameterEntityResolver(IXMLEntityResolver resolver) 88 { 89 this.delegate.setParameterEntityResolver(resolver); 90 } 91 92 97 public IXMLEntityResolver getParameterEntityResolver() 98 { 99 return this.delegate.getParameterEntityResolver(); 100 } 101 102 112 public void parseDTD(String publicID, IXMLReader reader, IXMLEntityResolver entityResolver, 113 boolean external) throws Exception 114 { 115 this.delegate.parseDTD(publicID, reader, entityResolver, external); 116 } 117 118 129 public void elementStarted(String name, String nsPrefix, String nsSystemId, String systemId, 130 int lineNr) throws Exception 131 { 132 this.delegate.elementStarted(name, nsPrefix, nsSystemId, systemId, lineNr); 133 } 134 135 146 public void elementEnded(String name, String nsPrefix, String nsSystemId, String systemId, 147 int lineNr) throws Exception 148 { 149 this.delegate.elementEnded(name, nsPrefix, nsSystemId, systemId, lineNr); 150 } 151 152 164 public void elementAttributesProcessed(String name, String nsPrefix, String nsSystemId, 165 Properties extraAttributes, String systemId, int lineNr) throws Exception 166 { 167 this.delegate.elementAttributesProcessed(name, nsPrefix, nsSystemId, extraAttributes, 168 systemId, lineNr); 169 } 170 171 185 public void attributeAdded(String key, String nsPrefix, String nsSystemId, String value, 186 String systemId, int lineNr) throws Exception 187 { 188 this.delegate.attributeAdded(key, nsPrefix, nsSystemId, value, systemId, lineNr); 189 } 190 191 199 public void PCDataAdded(String systemId, int lineNr) throws Exception 200 { 201 this.delegate.PCDataAdded(systemId, lineNr); 202 } 203 204 214 public void missingElement(String systemID, int lineNr, String parentElementName, 215 String missingElementName) throws XMLValidationException 216 { 217 XMLUtil.errorMissingElement(systemID, lineNr, parentElementName, missingElementName); 218 } 219 220 230 public void unexpectedElement(String systemID, int lineNr, String parentElementName, 231 String unexpectedElementName) throws XMLValidationException 232 { 233 XMLUtil.errorUnexpectedElement(systemID, lineNr, parentElementName, unexpectedElementName); 234 } 235 236 246 public void missingAttribute(String systemID, int lineNr, String elementName, 247 String attributeName) throws XMLValidationException 248 { 249 XMLUtil.errorMissingAttribute(systemID, lineNr, elementName, attributeName); 250 } 251 252 262 public void unexpectedAttribute(String systemID, int lineNr, String elementName, 263 String attributeName) throws XMLValidationException 264 { 265 XMLUtil.errorUnexpectedAttribute(systemID, lineNr, elementName, attributeName); 266 } 267 268 279 public void invalidAttributeValue(String systemID, int lineNr, String elementName, 280 String attributeName, String attributeValue) throws XMLValidationException 281 { 282 XMLUtil.errorInvalidAttributeValue(systemID, lineNr, elementName, attributeName, 283 attributeValue); 284 } 285 286 295 public void missingPCData(String systemID, int lineNr, String parentElementName) 296 throws XMLValidationException 297 { 298 XMLUtil.errorMissingPCData(systemID, lineNr, parentElementName); 299 } 300 301 310 public void unexpectedPCData(String systemID, int lineNr, String parentElementName) 311 throws XMLValidationException 312 { 313 XMLUtil.errorUnexpectedPCData(systemID, lineNr, parentElementName); 314 } 315 316 328 public void validationError(String systemID, int lineNr, String message, String elementName, 329 String attributeName, String attributeValue) throws XMLValidationException 330 { 331 XMLUtil.validationError(systemID, lineNr, message, elementName, attributeName, 332 attributeValue); 333 } 334 335 } 336 | Popular Tags |