defensive-coding-guide/modules/ROOT/pages/_partials/snippets/Tasks-Serialization-XML-OpenJDK-NoEntityResolver.adoc
2018-09-20 11:51:33 +02:00

11 lines
363 B
Text

class NoEntityResolver implements EntityResolver {
@Override
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException, IOException {
// Throwing an exception stops validation.
throw new IOException(String.format(
"attempt to resolve \"%s\" \"%s\"", publicId, systemId));
}
}