defensive-coding-guide/modules/ROOT/examples/Tasks-Serialization-XML-OpenJDK-NoEntityResolver.adoc

12 lines
363 B
Text
Raw Permalink Normal View History

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));
}
}