DomUtils { public static Transformer getSecureTransformer() { TransformerFactory transformerFactory = getSecureTransformerFactory(); Transformer transformer = null; try { transformer = transformerFactory.newTransformer(); transformer.setOutputProperty(OutputKeys.METHOD, TRANSFORMER_METHOD_VALUE); } catch (TransformerConfigurationException e) { throw new DSSException(e); } transformer.setErrorListener(new DSSXmlErrorListener()); return transformer; } private  DomUtils(); static void enableFeature(String feature); static void disableFeature(String feature); static boolean registerNamespace(final DSSNamespace namespace); static TransformerFactory getSecureTransformerFactory(); static Transformer getSecureTransformer(); static Document buildDOM(); static Document buildDOM(final String xmlString); static Document buildDOM(final byte[] bytes); static Document buildDOM(final DSSDocument dssDocument); static boolean isDOM(final byte[] bytes); static Document buildDOM(final InputStream inputStream); static void setAttributeNS(Element element, DSSNamespace namespace, DSSAttribute attribute, String value); static Element addElement(final Document document, final Element parentDom, final DSSNamespace namespace, final DSSElement element); static XPathExpression createXPathExpression(final String xpathString); static String getValue(final Node xmlNode, final String xPathString); static NodeList getNodeList(final Node xmlNode, final String xPathString); static Node getNode(final Node xmlNode, final String xPathString); static Element getElement(final Node xmlNode, final String xPathString); static boolean isNotEmpty(final Node xmlNode, final String xPathString); static Element addTextElement(final Document document, final Element parentDom, final DSSNamespace namespace, final DSSElement element, final String value); static void setTextNode(final Document document, final Element parentDom, final String text); static XMLGregorianCalendar createXMLGregorianCalendar(final Date date); static Date getDate(final String text); static List<String> getChildrenNames(final Node xmlNode, final String xPathString); static void writeDocumentTo(final Document dom, final OutputStream os); static DSSDocument createDssDocumentFromDomDocument(Document document, String name); static String xmlToString(final Node node); static Map<String, String> getCurrentNamespaces(); static String getXPathByIdAttribute(String uri); static String getId(String uri); static boolean isElementReference(String uri); static boolean isXPointerQuery(String uriValue); static Element createElementNS(Document documentDom, DSSNamespace namespace, DSSElement element); static void addNamespaceAttribute(Element element, DSSNamespace namespace); static final int TRANSFORMER_INDENT_NUMBER; }
@Test public void getSecureTransformer() { assertNotNull(DomUtils.getSecureTransformer()); }