Example usage for org.apache.commons.collections.map MultiValueMap containsKey

List of usage examples for org.apache.commons.collections.map MultiValueMap containsKey

Introduction

In this page you can find the example usage for org.apache.commons.collections.map MultiValueMap containsKey.

Prototype

public boolean containsKey(Object key) 

Source Link

Usage

From source file:net.firejack.platform.core.store.registry.resource.CollectionStore.java

private void checkCycle(MultiValueMap map, Long currentId, Long srcId) {
    if (map.containsKey(currentId)) {
        List collections = (List) map.getCollection(currentId);
        if (collections.contains(srcId)) {
            throw new BusinessFunctionException("Exist cycle collections");
        } else {/*from www.j  a va  2s  . co  m*/
            for (Object collection : collections) {
                checkCycle(map, (Long) collection, srcId);
            }
        }
    }
}

From source file:org.sweble.wikitext.engine.utils.LanguageConfigGenerator.java

public static void addNamespaces(WikiConfigImpl wikiConfig, String apiUrlNamespaces,
        MultiValueMap nameSpaceAliases) throws IOException, ParserConfigurationException, SAXException {
    Document document = getXMLFromUlr(apiUrlNamespaces);
    NodeList apiNamespaces = document.getElementsByTagName("ns");

    for (int i = 0; i < apiNamespaces.getLength(); i++) {
        Node apiNamespace = apiNamespaces.item(i);
        String name = apiNamespace.getTextContent();
        NamedNodeMap attributes = apiNamespace.getAttributes();
        Integer id = new Integer(attributes.getNamedItem("id").getNodeValue());
        String canonical = "";
        if (attributes.getNamedItem("canonical") != null) {
            canonical = attributes.getNamedItem("canonical").getNodeValue();
        }/*  w  w w.ja v a 2 s . c  o m*/

        boolean fileNs = false;
        if (canonical.equals("File")) {
            fileNs = true;
        }

        Node subpages = attributes.getNamedItem("subpages");
        boolean canHaveSubpages = false;
        if (subpages != null) {
            canHaveSubpages = true;
        }

        Collection<String> aliases = new ArrayList<String>();
        if (nameSpaceAliases.containsKey(id)) {
            @SuppressWarnings("unchecked")
            Collection<String> tmp = nameSpaceAliases.getCollection(id);
            aliases = tmp;
        }

        NamespaceImpl namespace = new NamespaceImpl(id.intValue(), name, canonical, canHaveSubpages, fileNs,
                aliases);
        wikiConfig.addNamespace(namespace);

        if (canonical.equals("Template")) {
            wikiConfig.setTemplateNamespace(namespace);
        } else if (id.intValue() == 0) {
            wikiConfig.setDefaultNamespace(namespace);
        }

    }
}