Example usage for org.dom4j DocumentFactory DocumentFactory

List of usage examples for org.dom4j DocumentFactory DocumentFactory

Introduction

In this page you can find the example usage for org.dom4j DocumentFactory DocumentFactory.

Prototype

public DocumentFactory() 

Source Link

Usage

From source file:com.blocks.framework.utils.date.XMLDom4jUtils.java

License:Open Source License

/**
 * /*from  w w w  .  j a  v  a 2s .  c  o  m*/
 *
 * @return Document 
 * @throws XMLDocException
 */
public static Document createDocument() {
    DocumentFactory factory = new DocumentFactory();
    Document document = factory.createDocument();
    return document;
}

From source file:com.fonoster.astive.examples.ws.YahooParser.java

License:Apache License

private SAXReader createXmlReader() {
    Map<String, String> uris = new HashMap<String, String>();
    uris.put("yweather", "http://xml.weather.yahoo.com/ns/rss/1.0");

    DocumentFactory factory = new DocumentFactory();
    factory.setXPathNamespaceURIs(uris);

    SAXReader xmlReader = new SAXReader();
    xmlReader.setDocumentFactory(factory);

    return xmlReader;
}

From source file:com.globalsight.terminology.importer.GTXmlReaderThread.java

License:Apache License

public GTXmlReaderThread(ReaderResultQueue p_queue, ImportOptions p_options, Termbase p_termbase) {
    m_results = p_queue;//from w  ww .j a  v a  2  s  .  c o  m
    m_options = p_options;
    m_termbase = p_termbase;
    m_factory = new DocumentFactory();
}

From source file:com.globalsight.terminology.importer.MtfReaderThread.java

License:Apache License

public MtfReaderThread(ReaderResultQueue p_queue, ImportOptions p_options, Termbase p_termbase) {
    m_results = p_queue;//ww w .  ja  v  a 2  s  .  c om
    m_options = p_options;
    m_termbase = p_termbase;
    m_factory = new DocumentFactory();
}

From source file:com.globalsight.terminology.importer.TbxReaderThread.java

License:Apache License

public TbxReaderThread(ReaderResultQueue p_queue, ImportOptions p_options, Termbase p_termbase) {
    m_results = p_queue;//from ww w. ja v  a 2s  .c o  m
    m_options = p_options;
    m_termbase = p_termbase;
    m_factory = new DocumentFactory();
}

From source file:com.googlecode.fascinator.common.PythonUtils.java

License:Open Source License

public PythonUtils(JsonSimpleConfig config) throws PluginException {
    this.config = config;
    // Security//from w w  w  . j ava2  s.  c o m
    String accessControlType = "accessmanager";
    access = PluginManager.getAccessManager(accessControlType);
    access.init(config.toString());

    // XML parsing
    namespaces = new HashMap<String, String>();
    DocumentFactory docFactory = new DocumentFactory();
    docFactory.setXPathNamespaceURIs(namespaces);
    saxReader = new SAXReader(docFactory);

    // Message Queues
    String brokerUrl = config.getString(ActiveMQConnectionFactory.DEFAULT_BROKER_BIND_URL, "messaging", "url");
    connectionFactory = new ActiveMQConnectionFactory(brokerUrl);
    try {
        connection = connectionFactory.createConnection();
        connection.start();
        session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

        // create single producer for multiple destinations
        producer = session.createProducer(null);
        producer.setDeliveryMode(DeliveryMode.PERSISTENT);

        // cache destinations
        destinations = new HashMap<String, Destination>();
    } catch (JMSException ex) {
        throw new PluginException(ex);
    }
    String access_plugin = config.getString(DEFAULT_ACCESS_PLUGIN, "accesscontrol", "type");
    if (access_plugin.indexOf(",") >= 0) {
        String[] plugin_list = access_plugin.split(",");
        current_access_plugin = plugin_list[0];
    } else {
        current_access_plugin = access_plugin;
    }
}

From source file:com.googlecode.fascinator.redbox.sru.SRUClient.java

License:Open Source License

/**
 * <p>/* w ww.  ja  v a  2 s. c  om*/
 * Simple init for the SAX Reader.
 * </p>
 * 
 */
private void saxInit() {
    namespaces = new HashMap<>();
    DocumentFactory docFactory = new DocumentFactory();
    docFactory.setXPathNamespaceURIs(namespaces);
    saxReader = new SAXReader(docFactory);
}

From source file:com.magnet.mmx.tsung.GenTestScript.java

License:Apache License

static String generateDevRegMessageStanza() {
    DevReg reg = new DevReg();
    reg.setDevId("%%ts_user_server:get_unique_id%%"); // let tsung generate a unique id
    //reg.setDevId(devid);
    reg.setOsType(OSType.ANDROID.name());
    reg.setDisplayName("Loadtester");
    reg.setOsVersion("4.4");
    reg.setApiKey(genSettings.apiKey);//w w w.ja  va  2  s  .c  o m
    //send an IQ request with device registration
    DocumentFactory factory = new DocumentFactory();
    final Element element = factory.createElement(Constants.MMX_DEV_REG, Constants.MMX_NS_DEV);
    element.addAttribute(Constants.MMX_ATTR_COMMAND, Constants.DeviceCommand.REGISTER.name());
    element.setText(reg.toJson());
    IQ devRegIq = new IQ() {
        @Override
        public CharSequence getChildElementXML() {
            return element.asXML();
        }
    };
    devRegIq.setType(IQ.Type.SET);
    devRegIq.setFrom("%%_username%%");
    return devRegIq.toXML().toString();
}

From source file:com.mycompany.simple.weather.YahooParser.java

License:Apache License

private SAXReader createXmlReader() {
    Map<String, String> uris = new HashMap<String, String>();
    uris.put("y", "http://xml.weather.yahoo.com/ns/rss/1.0");

    DocumentFactory factory = new DocumentFactory();
    factory.setXPathNamespaceURIs(uris);

    SAXReader xmlReader = new SAXReader();
    xmlReader.setDocumentFactory(factory);
    return xmlReader;
}

From source file:com.sun.tools.xjc.runtime.Dom4jUnmarshallingEventHandler.java

License:Open Source License

public Dom4jUnmarshallingEventHandler(UnmarshallingContext _ctxt) throws SAXException {
    super(_ctxt, new SAXContentHandler(new DocumentFactory()));
}