自定义JDOM工厂类:Custom JDOM Factory,jdom工厂类,package java
分享于 点击 44482 次 点评:36
自定义JDOM工厂类:Custom JDOM Factory,jdom工厂类,package java
package javaxml2;import org.jdom.Element;import org.jdom.Namespace;import org.jdom.input.DefaultJDOMFactory;/** * <b><code>CustomJDOMFactory</code></b> is an example of providing * user-defined JDOM subclasses when building a JDOM <code>Do*****ent</code>; * this is instead of the default JDOM classes. This particular * implementation returns a custom <code>Element</code> subclass, * <code>{@link ORAElement}</code>. */class CustomJDOMFactory extends DefaultJDOMFactory { public Element element(String name) { return new ORAElement(name); } public Element element(String name, Namespace ns) { return new ORAElement(name, ns); } public Element element(String name, String uri) { return new ORAElement(name, uri); } public Element element(String name, String prefix, String uri) { return new ORAElement(name, prefix, uri); }}//该片段来自于http://byrx.net
用户点评