/** * @since 1.2.1 * @deprecated As of 1.4 use {@link Dom4JWriter#Dom4JWriter(Branch, NameCoder)} instead */ public Dom4JWriter(final Branch root, final XmlFriendlyReplacer replacer) { this(root, new DocumentFactory(), (NameCoder)replacer); }
/** * @since 1.4 */ public Dom4JWriter(final Branch root, final NameCoder nameCoder) { this(root, new DocumentFactory(), nameCoder); }
/** * @since 1.2.1 */ public Dom4JWriter() { this(new DocumentFactory(), new XmlFriendlyNameCoder()); }
public Dom4JWriter(final Branch root) { this(root, new DocumentFactory(), new XmlFriendlyNameCoder()); }
/** * @since 1.4 */ public Dom4JDriver(NameCoder nameCoder) { this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder); outputFormat.setTrimText(false); }
/** * Convert the BugCollection into a dom4j Document object. * * @return the Document representing the BugCollection as a dom4j tree */ @Override public Document toDocument() { // if (project == null) throw new NullPointerException("No project"); assert project != null; DocumentFactory docFactory = new DocumentFactory(); Document document = docFactory.createDocument(); Dom4JXMLOutput treeBuilder = new Dom4JXMLOutput(document); try { writeXML(treeBuilder); } catch (IOException e) { // Can't happen } return document; }
/** * <p> * <code>createSingleton</code> creates the singleton instance from the * given class name. * </p> * * @param className * is the name of the DocumentFactory class to use * * @return a new singleton instance. */ protected static DocumentFactory createSingleton(String className) { // let's try and class load an implementation? try { // I'll use the current class loader // that loaded me to avoid problems in J2EE and web apps Class<DocumentFactory> theClass = (Class<DocumentFactory>) Class.forName(className, true, DocumentFactory.class.getClassLoader()); return theClass.newInstance(); } catch (Throwable e) { System.out.println("WARNING: Cannot load DocumentFactory: " + className); return new DocumentFactory(); } }
/** * @since 1.4 */ public Dom4JWriter(final Branch root, final NameCoder nameCoder) { this(root, new DocumentFactory(), nameCoder); }
/** * @since 1.2.1 * @deprecated As of 1.4 use {@link Dom4JWriter#Dom4JWriter(Branch, NameCoder)} instead */ public Dom4JWriter(final Branch root, final XmlFriendlyReplacer replacer) { this(root, new DocumentFactory(), (NameCoder)replacer); }
/** * @since 1.2.1 * @deprecated As of 1.4 use {@link Dom4JWriter#Dom4JWriter(Branch, NameCoder)} instead */ @Deprecated public Dom4JWriter(final Branch root, final XmlFriendlyReplacer replacer) { this(root, new DocumentFactory(), (NameCoder)replacer); }
/** * @since 1.2.1 */ public Dom4JWriter() { this(new DocumentFactory(), new XmlFriendlyNameCoder()); }
/** * @since 1.2.1 */ public Dom4JWriter() { this(new DocumentFactory(), new XmlFriendlyReplacer()); }
/** * @since 1.2.1 */ public Dom4JWriter() { this(new DocumentFactory(), new XmlFriendlyReplacer()); }
/** * @since 1.2.1 */ public Dom4JWriter() { this(new DocumentFactory(), new XmlFriendlyNameCoder()); }
/** * @since 1.4 */ public Dom4JDriver(final NameCoder nameCoder) { this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder); outputFormat.setTrimText(false); }
/** * @since 1.4 */ public Dom4JDriver(NameCoder nameCoder) { this(new DocumentFactory(), OutputFormat.createPrettyPrint(), nameCoder); outputFormat.setTrimText(false); }
public Object evaluate(TaskRequest req, TaskResponse res) { Branch rslt = new DocumentFactory().createDocument(); if (name != null) { rslt = rslt.addElement((String) name.evaluate(req, res)); } return rslt; }
public void testQNames() throws Exception { DocumentFactory factory = new DocumentFactory(); SAXReader reader = new SAXReader(); reader.setDocumentFactory(factory); getDocument("/xml/test/soap2.xml", reader); List qnames = factory.getQNames(); assertEquals("Number of QNames not correct", 15, qnames.size()); }
public void testFragment() throws Exception { DocumentFactory factory = new DocumentFactory(); Element root = factory.createElement("root"); Element first = root.addElement("child"); Element second = root.addElement("child"); testXPathNode(root, first); testXPathNode(root, second); }
public void testDocument() throws Exception { DocumentFactory factory = new DocumentFactory(); Element root = factory.createElement("root"); Element first = root.addElement("child"); first.addText("This is some text"); assertTrue("Root node is not text only: " + root, !root.isTextOnly()); assertTrue("First child is text only: " + first, first.isTextOnly()); } }