@Test public void shouldNotSupportDocTypeDefinitions() { XMLInputFactory xmlInputFactory = SafeXml.newXmlInputFactory(); Object supportDtd = xmlInputFactory.getProperty(SUPPORT_DTD); assertFalse(Boolean.parseBoolean(supportDtd.toString())); }
public static XMLInputFactory newXmlInputFactory() { final XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); xmlInputFactory.setProperty(SUPPORT_DTD, false); xmlInputFactory.setProperty(IS_SUPPORTING_EXTERNAL_ENTITIES, false); return xmlInputFactory; }
SafeXml { public static XMLInputFactory newXmlInputFactory() { final XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); xmlInputFactory.setProperty(SUPPORT_DTD, false); xmlInputFactory.setProperty(IS_SUPPORTING_EXTERNAL_ENTITIES, false); return xmlInputFactory; } }
SafeXml { public static XMLInputFactory newXmlInputFactory() { final XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); xmlInputFactory.setProperty(SUPPORT_DTD, false); xmlInputFactory.setProperty(IS_SUPPORTING_EXTERNAL_ENTITIES, false); return xmlInputFactory; } private  SafeXml(); }
SafeXml { public static XMLInputFactory newXmlInputFactory() { final XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); xmlInputFactory.setProperty(SUPPORT_DTD, false); xmlInputFactory.setProperty(IS_SUPPORTING_EXTERNAL_ENTITIES, false); return xmlInputFactory; } private  SafeXml(); static XMLInputFactory newXmlInputFactory(); static DocumentBuilderFactory newdocumentBuilderFactory(); static DocumentBuilderFactory newStrictDocumentBuilderFactory(); static TransformerFactory newTransformerFactory(); static SAXTransformerFactory newSaxTransformerFactory(); static SAXParserFactory newSaxParserFactory(); static SAXParserFactory newStrictSaxParserFactory(); }
SafeXml { public static XMLInputFactory newXmlInputFactory() { final XMLInputFactory xmlInputFactory = XMLInputFactory.newInstance(); xmlInputFactory.setProperty(SUPPORT_DTD, false); xmlInputFactory.setProperty(IS_SUPPORTING_EXTERNAL_ENTITIES, false); return xmlInputFactory; } private  SafeXml(); static XMLInputFactory newXmlInputFactory(); static DocumentBuilderFactory newdocumentBuilderFactory(); static DocumentBuilderFactory newStrictDocumentBuilderFactory(); static TransformerFactory newTransformerFactory(); static SAXTransformerFactory newSaxTransformerFactory(); static SAXParserFactory newSaxParserFactory(); static SAXParserFactory newStrictSaxParserFactory();  }