franta-hg@206
|
1 |
/**
|
franta-hg@206
|
2 |
* SQL-DK
|
franta-hg@206
|
3 |
* Copyright © 2015 František Kučera (frantovo.cz)
|
franta-hg@206
|
4 |
*
|
franta-hg@206
|
5 |
* This program is free software: you can redistribute it and/or modify
|
franta-hg@206
|
6 |
* it under the terms of the GNU General Public License as published by
|
franta-hg@206
|
7 |
* the Free Software Foundation, either version 3 of the License, or
|
franta-hg@206
|
8 |
* (at your option) any later version.
|
franta-hg@206
|
9 |
*
|
franta-hg@206
|
10 |
* This program is distributed in the hope that it will be useful,
|
franta-hg@206
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
franta-hg@206
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
franta-hg@206
|
13 |
* GNU General Public License for more details.
|
franta-hg@206
|
14 |
*
|
franta-hg@206
|
15 |
* You should have received a copy of the GNU General Public License
|
franta-hg@206
|
16 |
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
franta-hg@206
|
17 |
*/
|
franta-hg@206
|
18 |
package info.globalcode.sql.dk.formatting;
|
franta-hg@206
|
19 |
|
franta-hg@212
|
20 |
import java.util.Collections;
|
franta-hg@212
|
21 |
import java.util.HashMap;
|
franta-hg@212
|
22 |
import java.util.Map;
|
franta-hg@212
|
23 |
|
franta-hg@206
|
24 |
/**
|
franta-hg@206
|
25 |
*
|
franta-hg@206
|
26 |
* @author Ing. František Kučera (frantovo.cz)
|
franta-hg@206
|
27 |
*/
|
franta-hg@206
|
28 |
public class CommonProperties {
|
franta-hg@206
|
29 |
|
franta-hg@212
|
30 |
private static final Map<Class, String> TYPE_SIMPLE_NAMES;
|
franta-hg@212
|
31 |
|
franta-hg@212
|
32 |
static {
|
franta-hg@212
|
33 |
Map<Class, String> m = new HashMap<>();
|
franta-hg@212
|
34 |
m.put(Boolean.class, "boolean");
|
franta-hg@212
|
35 |
m.put(String.class, "String");
|
franta-hg@212
|
36 |
m.put(Character.class, "char");
|
franta-hg@212
|
37 |
m.put(Integer.class, "int");
|
franta-hg@212
|
38 |
m.put(Long.class, "long");
|
franta-hg@212
|
39 |
m.put(Double.class, "double");
|
franta-hg@212
|
40 |
TYPE_SIMPLE_NAMES = Collections.unmodifiableMap(m);
|
franta-hg@212
|
41 |
}
|
franta-hg@212
|
42 |
|
franta-hg@212
|
43 |
public static String getSimpleTypeName(Class type) {
|
franta-hg@212
|
44 |
String name = TYPE_SIMPLE_NAMES.get(type);
|
franta-hg@212
|
45 |
return name == null ? type.getName() : name;
|
franta-hg@212
|
46 |
}
|
franta-hg@212
|
47 |
|
franta-hg@206
|
48 |
public static final String COLORFUL = "color";
|
franta-hg@212
|
49 |
public static final String COLORFUL_DESCRIPTION = "whether the output should be printed in color (ANSI Escape Sequences)";
|
franta-hg@206
|
50 |
}
|