1
22
23 package com.liferay.portlet.expando.model;
24
25
30 public class ExpandoColumnConstants {
31
32 public static final int BOOLEAN = 1;
33
34 public static final String BOOLEAN_LABEL = "boolean";
35
36 public static final int BOOLEAN_ARRAY = 2;
37
38 public static final String BOOLEAN_ARRAY_LABEL = "boolean[]";
39
40 public static final int DATE = 3;
41
42 public static final String DATE_LABEL = "java.util.Date";
43
44 public static final int DATE_ARRAY = 4;
45
46 public static final String DATE_ARRAY_LABEL = "java.util.Date[]";
47
48 public static final int DOUBLE = 5;
49
50 public static final String DOUBLE_LABEL = "double";
51
52 public static final int DOUBLE_ARRAY = 6;
53
54 public static final String DOUBLE_ARRAY_LABEL = "double[]";
55
56 public static final int FLOAT = 7;
57
58 public static final String FLOAT_LABEL = "float";
59
60 public static final int FLOAT_ARRAY = 8;
61
62 public static final String FLOAT_ARRAY_LABEL = "float[]";
63
64 public static final int INTEGER = 9;
65
66 public static final String INTEGER_LABEL = "int";
67
68 public static final int INTEGER_ARRAY = 10;
69
70 public static final String INTEGER_ARRAY_LABEL = "int[]";
71
72 public static final int LONG = 11;
73
74 public static final String LONG_LABEL = "long";
75
76 public static final int LONG_ARRAY = 12;
77
78 public static final String LONG_ARRAY_LABEL = "long[]";
79
80 public static final int SHORT = 13;
81
82 public static final String SHORT_LABEL = "short";
83
84 public static final int SHORT_ARRAY = 14;
85
86 public static final String SHORT_ARRAY_LABEL = "short[]";
87
88 public static final int STRING = 15;
89
90 public static final String STRING_LABEL = "java.lang.String";
91
92 public static final int STRING_ARRAY = 16;
93
94 public static final String STRING_ARRAY_LABEL = "java.lang.String[]";
95
96 public static final String UNKNOWN_LABEL = "Unknown";
97
98 public static final int[] TYPES = new int[] {
99 BOOLEAN, BOOLEAN_ARRAY, DATE, DATE_ARRAY, DOUBLE, DOUBLE_ARRAY, FLOAT,
100 FLOAT_ARRAY, INTEGER, INTEGER_ARRAY, LONG, LONG_ARRAY, SHORT,
101 SHORT_ARRAY, STRING, STRING_ARRAY
102 };
103
104 public static final String getTypeLabel(int type) {
105 if (type == BOOLEAN) {
106 return BOOLEAN_LABEL;
107 }
108 else if (type == BOOLEAN_ARRAY) {
109 return BOOLEAN_ARRAY_LABEL;
110 }
111 else if (type == DATE) {
112 return DATE_LABEL;
113 }
114 else if (type == DATE_ARRAY) {
115 return DATE_ARRAY_LABEL;
116 }
117 else if (type == DOUBLE) {
118 return DOUBLE_LABEL;
119 }
120 else if (type == DOUBLE_ARRAY) {
121 return DOUBLE_ARRAY_LABEL;
122 }
123 else if (type == FLOAT) {
124 return FLOAT_LABEL;
125 }
126 else if (type == FLOAT_ARRAY) {
127 return FLOAT_ARRAY_LABEL;
128 }
129 else if (type == INTEGER) {
130 return INTEGER_LABEL;
131 }
132 else if (type == INTEGER_ARRAY) {
133 return INTEGER_ARRAY_LABEL;
134 }
135 else if (type == LONG) {
136 return LONG_LABEL;
137 }
138 else if (type == LONG_ARRAY) {
139 return LONG_ARRAY_LABEL;
140 }
141 else if (type == SHORT) {
142 return SHORT_LABEL;
143 }
144 else if (type == SHORT_ARRAY) {
145 return SHORT_ARRAY_LABEL;
146 }
147 else if (type == STRING) {
148 return STRING_LABEL;
149 }
150 else if (type == STRING_ARRAY) {
151 return STRING_ARRAY_LABEL;
152 }
153
154 return UNKNOWN_LABEL;
155 }
156
157 }