/** * Copyright 2011 Oliver Buchtala * * This file is part of ndogen. * * ndogen is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * ndogen is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with ndogen. If not, see <http://www.gnu.org/licenses/>. */ package org.ndogen.markdown; import java.util.HashMap; import java.util.Map; import java.util.Properties; import org.ndogen.util.FileUtils; public class MarkdownTestUtil { @SuppressWarnings("rawtypes") public static Map<Integer, String> getTokenNames() { Properties props = new Properties(); try { props.load(FileUtils.getResource("org/ndogen/markdown/MarkdownScanner.tokens")); } catch (Exception e) { throw new RuntimeException(e); } HashMap<Integer, String> map = new HashMap<Integer, String>(); for (Object key: props.keySet()) { map.put(Integer.parseInt(props.getProperty((String) key)), (String) key); } return map; } }