package com.vci.ubcs.starter.web.enumpck; import com.vci.ubcs.starter.annotation.VciEnum; @VciEnum( name = "VciFieldType", text = "属性类型" ) public enum VciFieldTypeEnum { VTString, VTInteger, VTLong, VTDouble, VTBoolean, VTDate, VTDateTime, VTTime, VTFilePath, VTClob; private VciFieldTypeEnum() { } public static String getValueByText(String text) { if (text != null && text.trim().length() != 0) { if ("布尔型".equalsIgnoreCase(text)) { return VTBoolean.name(); } else if ("长文本".equalsIgnoreCase(text)) { return VTClob.name(); } else if ("日期".equalsIgnoreCase(text)) { return VTDate.name(); } else if ("日期时间".equalsIgnoreCase(text)) { return VTDateTime.name(); } else if ("时间".equalsIgnoreCase(text)) { return VTTime.name(); } else if ("长整型".equalsIgnoreCase(text)) { return VTLong.name(); } else if ("金额/双精度".equalsIgnoreCase(text)) { return VTDouble.name(); } else if ("整形".equalsIgnoreCase(text)) { return VTInteger.name(); } else { return "文件".equalsIgnoreCase(text) ? VTFilePath.name() : VTString.name(); } } else { return ""; } } public static String getTextByValue(String value) { VciFieldTypeEnum wenum = forValue(value); if (wenum == null) { return ""; } else { switch (wenum) { case VTBoolean: return "布尔型"; case VTClob: return "长文本"; case VTDate: return "日期"; case VTDateTime: return "日期时间"; case VTTime: return "时间"; case VTLong: return "长整型"; case VTDouble: return "金额/双精度"; case VTInteger: return "整形"; case VTFilePath: return "文件"; default: return "字符串"; } } } public static VciFieldTypeEnum forValue(String value) { VciFieldTypeEnum[] var1 = values(); int var2 = var1.length; for(int var3 = 0; var3 < var2; ++var3) { VciFieldTypeEnum wenum = var1[var3]; if (wenum.name().equalsIgnoreCase(value)) { return wenum; } } return null; } }