Package com.esri.ontology.service.catalog

Examples of com.esri.ontology.service.catalog.Categories


          DocumentBuilderFactory.newInstance();
        DocumentBuilder builder = factory.newDocumentBuilder();
        InputSource inputSource = new InputSource(categoriesFilePath);
        Document dom = builder.parse(inputSource);

        Categories categories = new Categories();

        XPath xpath = XPathFactory.newInstance().newXPath();

        NodeList ctgNodes =
          (NodeList) xpath.evaluate("category", dom.getFirstChild(),
          XPathConstants.NODESET);
        for (int i = 0; i < ctgNodes.getLength(); i++) {
          Node ctgNode = ctgNodes.item(i);
          String key = (String) xpath.evaluate("@key", ctgNode,
            XPathConstants.STRING);
          String value = (String) xpath.evaluate("@value", ctgNode,
            XPathConstants.STRING);
          categories.put(key, value);
        }

        context.setCategories(categories);

        log.info("Categories initialized.");
View Full Code Here

TOP

Related Classes of com.esri.ontology.service.catalog.Categories

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.