/** * @return the <code>DocumentFactory</code> used to create document objects */ public DocumentFactory getDocumentFactory() { if (factory == null) { factory = DocumentFactory.getInstance(); } return factory; }
protected Document documentRoot() throws Exception { CruiseConfig cruiseConfig = goConfigDao.loadForEditing(); ByteArrayOutputStream out = new ByteArrayOutputStream(); new MagicalGoConfigXmlWriter(configCache, registry).write(cruiseConfig, out, true); Document document = reader.read(new StringReader(out.toString())); Map<String, String> map = new HashMap<>(); map.put("go", MagicalGoConfigXmlWriter.XML_NS); //TODO: verify this doesn't cache the factory DocumentFactory factory = DocumentFactory.getInstance(); factory.setXPathNamespaceURIs(map); return document; }
Element root = DocumentFactory.getInstance().createElement(wrapper); for (Object o : list) { if (o instanceof String) {
/** * Returns an Element with the privacy list XML representation. * * @return an Element with the privacy list XML representation. */ public Element asElement() { //Element listElement = DocumentFactory.getInstance().createDocument().addElement("list"); Element listElement = DocumentFactory.getInstance().createDocument() .addElement("list", "jabber:iq:privacy"); listElement.addAttribute("name", getName()); // Add the list items to the result for (PrivacyItem item : items) { listElement.add(item.asElement()); } return listElement; }
if ( defaultPrivacyList == null ) final Element listElement = DocumentFactory.getInstance().createDocument().addElement( "list", "jabber:iq:privacy" ); listElement.addAttribute( "name", "blocklist" );
private Document createDocument(final Reflections reflections) { Store map = reflections.getStore(); Document document = DocumentFactory.getInstance().createDocument(); Element root = document.addElement("Reflections"); for (String indexName : map.keySet()) { Element indexElement = root.addElement(indexName); for (String key : map.get(indexName).keySet()) { Element entryElement = indexElement.addElement("entry"); entryElement.addElement("key").setText(key); Element valuesElement = entryElement.addElement("values"); for (String value : map.get(indexName).get(key)) { valuesElement.addElement("value").setText(value); } } } return document; } }
private Document createDocument(final Reflections reflections) { Store map = reflections.getStore(); Document document = DocumentFactory.getInstance().createDocument(); Element root = document.addElement("Reflections"); for (String indexName : map.keySet()) { Element indexElement = root.addElement(indexName); for (String key : map.get(indexName).keySet()) { Element entryElement = indexElement.addElement("entry"); entryElement.addElement("key").setText(key); Element valuesElement = entryElement.addElement("values"); for (String value : map.get(indexName).get(key)) { valuesElement.addElement("value").setText(value); } } } return document; } }
Document doc = DocumentFactory.getInstance().createDocument(); generatedModel = coreModel.createCopy(); doc.add(generatedModel);
/** * Constructs a default <code>STAXEventReader</code> instance with a * default {@link DocumentFactory}. */ public STAXEventReader() { this.factory = DocumentFactory.getInstance(); }
/** * DOCUMENT ME! * * @return the <code>DocumentFactory</code> used to create document * objects */ public DocumentFactory getDocumentFactory() { if (factory == null) { factory = DocumentFactory.getInstance(); } return factory; }
/** * DOCUMENT ME! * * @return the <code>DocumentFactory</code> used to create document * objects */ public DocumentFactory getDocumentFactory() { if (factory == null) { factory = DocumentFactory.getInstance(); } return factory; }
/** * DOCUMENT ME! * * @return the <code>DocumentFactory</code> used to create document * objects */ public DocumentFactory getDocumentFactory() { if (factory == null) { factory = DocumentFactory.getInstance(); } return factory; }
protected void setProxy(DocumentFactory proxy) { if (proxy == null) { // use default factory proxy = DocumentFactory.getInstance(); } this.proxy = proxy; } }
public ProxyDocumentFactory() { // use default factory this.proxy = DocumentFactory.getInstance(); }
public SAXContentHandler() { this(DocumentFactory.getInstance()); }
private static DocumentFactory getDocumentFactory() { return DocumentFactory.getInstance(); }
public DOMReader() { this.factory = DocumentFactory.getInstance(); this.namespaceStack = new NamespaceStack(factory); }
public static CDATA createCDATA(String text) { return DocumentFactory.getInstance().createCDATA(text); }
public static Namespace createNamespace(String prefix, String uri) { return DocumentFactory.getInstance().createNamespace(prefix, uri); }
public static Comment createComment(String text) { return DocumentFactory.getInstance().createComment(text); }