当前位置: 首页>>代码示例>>Java>>正文


Java DocumentFactory类代码示例

本文整理汇总了Java中org.apache.batik.dom.util.DocumentFactory的典型用法代码示例。如果您正苦于以下问题:Java DocumentFactory类的具体用法?Java DocumentFactory怎么用?Java DocumentFactory使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DocumentFactory类属于org.apache.batik.dom.util包,在下文中一共展示了DocumentFactory类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: load

import org.apache.batik.dom.util.DocumentFactory; //导入依赖的package包/类
/**
 * Reads a property list (key and element pairs) from the input stream.
 * The stream is assumed to be using the ISO 8859-1 character encoding.
 */
public synchronized void load(InputStream is) throws IOException {
    BufferedReader r;
    r = new BufferedReader(new InputStreamReader(is, PREFERENCE_ENCODING));
    DocumentFactory df = new SAXDocumentFactory
        (GenericDOMImplementation.getDOMImplementation(),
         xmlParserClassName);
    Document doc = df.createDocument("http://xml.apache.org/batik/preferences",
                                     "preferences",
                                     null,
                                     r);
    Element elt = doc.getDocumentElement();
    for (Node n = elt.getFirstChild(); n != null; n = n.getNextSibling()) {
        if (n.getNodeType() == Node.ELEMENT_NODE) {
            if (n.getNodeName().equals("property")) {
                String name = ((Element)n).getAttributeNS(null, "name");
                
                StringBuffer cont = new StringBuffer();
                for (Node c = n.getFirstChild();
                     c != null;
                     c = c.getNextSibling()) {
                    if (c.getNodeType() == Node.TEXT_NODE) {
                        cont.append(c.getNodeValue());
                    } else {
                        break;
                    }
                }
                String val = cont.toString();
                put(name, val);
            }
        }
    }
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:37,代码来源:XMLPreferenceManager.java

示例2: createDocumentFactory

import org.apache.batik.dom.util.DocumentFactory; //导入依赖的package包/类
/**
 * Creates a {@link DocumentFactory} that is used to create an SVG DOM
 * tree. The specified DOM Implementation is ignored and the Batik
 * SVG DOM Implementation is automatically used.
 *
 * @param domImpl the DOM Implementation (not used)
 * @param parserClassname the XML parser classname
 * @return the document factory
 */
protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
        String parserClassname) {
    final FOPSAXSVGDocumentFactory factory
            = new FOPSAXSVGDocumentFactory(parserClassname);
    if (this.resolver != null) {
        factory.setAdditionalEntityResolver(this.resolver);
    }
    return factory;
}
 
开发者ID:pellcorp,项目名称:fop,代码行数:19,代码来源:AbstractFOPTranscoder.java

示例3: createDocumentFactory

import org.apache.batik.dom.util.DocumentFactory; //导入依赖的package包/类
/**
 * Creates a <code>DocumentFactory</code> that is used to create an SVG DOM
 * tree. The specified DOM Implementation is ignored and the Batik
 * SVG DOM Implementation is automatically used.
 *
 * @param domImpl the DOM Implementation (not used)
 * @param parserClassname the XML parser classname
 */
protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
                                                String parserClassname) {
    return new SAXSVGDocumentFactory(parserClassname);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:13,代码来源:SVGAbstractTranscoder.java

示例4: createDocumentFactory

import org.apache.batik.dom.util.DocumentFactory; //导入依赖的package包/类
/**
 * Creates the <code>DocumentFactory</code> used to create the DOM
 * tree. Override this method if you have to use another
 * implementation of the <code>DocumentFactory</code> (ie. for SVG,
 * you have to use the <code>SAXSVGDocumentFactory</code>).
 *
 * @param domImpl the DOM Implementation to use
 * @param parserClassname the XML parser classname
 */
protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
                                                String parserClassname) {
    return new SAXDocumentFactory(domImpl, parserClassname);
}
 
开发者ID:git-moss,项目名称:Push2Display,代码行数:14,代码来源:XMLAbstractTranscoder.java


注:本文中的org.apache.batik.dom.util.DocumentFactory类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。