Search in sources :

Example 1 with Store

use of org.reflections.Store in project reflections by ronmamo.

the class XmlSerializer method createDocument.

private Document createDocument(final Reflections reflections) {
    Store map = reflections.getStore();
    Document document = DocumentFactory.getInstance().createDocument();
    Element root = document.addElement("Reflections");
    for (String indexName : map.keySet()) {
        Element indexElement = root.addElement(indexName);
        for (String key : map.get(indexName).keySet()) {
            Element entryElement = indexElement.addElement("entry");
            entryElement.addElement("key").setText(key);
            Element valuesElement = entryElement.addElement("values");
            for (String value : map.get(indexName).get(key)) {
                valuesElement.addElement("value").setText(value);
            }
        }
    }
    return document;
}
Also used : Element(org.dom4j.Element) Store(org.reflections.Store) Document(org.dom4j.Document)

Example 2 with Store

use of org.reflections.Store in project disconf by knightliao.

the class ScanPrinterUtils method printStoreMap.

/**
     * 打印出StoreMap的数据
     */
public static void printStoreMap(Reflections reflections) {
    LOGGER.info("Now we will print store map......");
    Store store = reflections.getStore();
    Map<String, Multimap<String, String>> /* indexName */
    storeMap = store.getStoreMap();
    for (String indexName : storeMap.keySet()) {
        LOGGER.info("====================================");
        LOGGER.info("indexName:" + indexName);
        Multimap<String, String> multimap = storeMap.get(indexName);
        for (String firstName : multimap.keySet()) {
            Collection<String> lastNames = multimap.get(firstName);
            LOGGER.info("\t\t" + firstName + ": " + lastNames);
        }
    }
}
Also used : Multimap(com.google.common.collect.Multimap) Store(org.reflections.Store)

Aggregations

Store (org.reflections.Store)2 Multimap (com.google.common.collect.Multimap)1 Document (org.dom4j.Document)1 Element (org.dom4j.Element)1