01: package org.dom4j.io;
02:
03: import org.dom4j.Attribute;
04: import org.dom4j.DocumentFactory;
05: import org.dom4j.Element;
06: import org.dom4j.LElement;
07: import org.dom4j.QName;
08: import org.dom4j.util.UserDataAttribute;
09:
10: public class LDocumentFactory extends DocumentFactory {
11: /** The Singleton instance */
12: protected static transient LDocumentFactory singleton = new LDocumentFactory();
13:
14: /**
15: * <p>
16: * Access to the singleton instance of this factory.
17: * </p>
18: *
19: * @return the default singleon instance
20: */
21: public static DocumentFactory getInstance() {
22: return singleton;
23: }
24:
25: // DocumentFactory methods
26: // -------------------------------------------------------------------------
27: public Element createElement(QName qname) {
28: return new LElement(qname);
29: }
30:
31: public Attribute createAttribute(Element owner, QName qname,
32: String value) {
33: return new UserDataAttribute(qname, value);
34: }
35: }
|