franta-hg@206: /**
franta-hg@206: * SQL-DK
franta-hg@206: * Copyright © 2015 František Kučera (frantovo.cz)
franta-hg@206: *
franta-hg@206: * This program is free software: you can redistribute it and/or modify
franta-hg@206: * it under the terms of the GNU General Public License as published by
franta-hg@250: * the Free Software Foundation, version 3 of the License.
franta-hg@206: *
franta-hg@206: * This program is distributed in the hope that it will be useful,
franta-hg@206: * but WITHOUT ANY WARRANTY; without even the implied warranty of
franta-hg@206: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
franta-hg@206: * GNU General Public License for more details.
franta-hg@206: *
franta-hg@206: * You should have received a copy of the GNU General Public License
franta-hg@206: * along with this program. If not, see .
franta-hg@206: */
franta-hg@206: package info.globalcode.sql.dk.formatting;
franta-hg@206:
franta-hg@212: import java.util.Collections;
franta-hg@212: import java.util.HashMap;
franta-hg@212: import java.util.Map;
franta-hg@212:
franta-hg@206: /**
franta-hg@206: *
franta-hg@206: * @author Ing. František Kučera (frantovo.cz)
franta-hg@206: */
franta-hg@206: public class CommonProperties {
franta-hg@206:
franta-hg@212: private static final Map TYPE_SIMPLE_NAMES;
franta-hg@212:
franta-hg@212: static {
franta-hg@212: Map m = new HashMap<>();
franta-hg@212: m.put(Boolean.class, "boolean");
franta-hg@212: m.put(String.class, "String");
franta-hg@212: m.put(Character.class, "char");
franta-hg@212: m.put(Integer.class, "int");
franta-hg@212: m.put(Long.class, "long");
franta-hg@212: m.put(Double.class, "double");
franta-hg@212: TYPE_SIMPLE_NAMES = Collections.unmodifiableMap(m);
franta-hg@212: }
franta-hg@212:
franta-hg@212: public static String getSimpleTypeName(Class type) {
franta-hg@212: String name = TYPE_SIMPLE_NAMES.get(type);
franta-hg@212: return name == null ? type.getName() : name;
franta-hg@212: }
franta-hg@212:
franta-hg@206: public static final String COLORFUL = "color";
franta-hg@212: public static final String COLORFUL_DESCRIPTION = "whether the output should be printed in color (ANSI Escape Sequences)";
franta-hg@206: }