All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jaeksoft.searchlib.plugin.IndexPluginTemplateList Maven / Gradle / Ivy

Go to download

OpenSearchServer is a powerful, enterprise-class, search engine program. Using the web user interface, the crawlers (web, file, database, ...) and the REST/RESTFul API you will be able to integrate quickly and easily advanced full-text search capabilities in your application. OpenSearchServer runs on Windows and Linux/Unix/BSD.

The newest version!
package com.jaeksoft.searchlib.plugin;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Iterator;

import javax.xml.xpath.XPathExpressionException;

import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import org.xml.sax.SAXException;

import com.jaeksoft.searchlib.util.XPathParser;
import com.jaeksoft.searchlib.util.XmlWriter;

public class IndexPluginTemplateList {

	private ArrayList pluginList;

	private IndexPluginTemplateList() {
		pluginList = new ArrayList();
	}

	private void add(IndexPluginItem item) {
		pluginList.add(item);
	}

	protected Iterator iterator() {
		return pluginList.iterator();
	}

	public static IndexPluginTemplateList fromXmlConfig(XPathParser xpp,
			Node parentNode) throws XPathExpressionException, DOMException,
			IOException {
		IndexPluginTemplateList indexPluginList = new IndexPluginTemplateList();
		if (parentNode == null)
			return indexPluginList;
		NodeList nodes = xpp.getNodeList(parentNode, "indexPlugin");
		for (int i = 0; i < nodes.getLength(); i++)
			indexPluginList.add(new IndexPluginItem(xpp, nodes.item(i)));
		return indexPluginList;
	}

	public void writeXmlConfig(XmlWriter writer) throws SAXException {
		writer.startElement("indexPlugins");
		for (IndexPluginItem item : pluginList)
			item.writeXmlConfig(writer);
		writer.endElement();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy