AbstractJAXBProvider extends AbstractMessageReaderWriterProvider<T> { protected static SAXSource getSAXSource(SAXParserFactory spf, InputStream entityStream) throws JAXBException { try { return new SAXSource( spf.newSAXParser().getXMLReader(), new InputSource(entityStream)); } catch (Exception ex) { throw new JAXBException("Error creating SAXSource", ex); } } AbstractJAXBProvider(Providers ps);  AbstractJAXBProvider(Providers ps, MediaType mt); @Context void setConfiguration(FeaturesAndProperties fp);  }
@Test public void abstractJaxbProviderDoesNotReadExternalDtds() throws Exception { SAXParserFactory spf = SAXParserContextProviderTest.createSAXParserFactory(); String url = "file: String s = "<!DOCTYPE x SYSTEM '" + url + "'><x/>"; SAXSource saxSource = AbstractJAXBProvider.getSAXSource(spf, new ByteArrayInputStream(s.getBytes("us-ascii"))); TransformerFactory.newInstance().newTransformer().transform(saxSource, new StreamResult(new ByteArrayOutputStream())); }