defensive-coding-guide/modules/ROOT/examples/Tasks-Serialization-XML-OpenJDK-NoEntityResolver.adoc
2022-01-13 20:42:40 +01: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));
}
}