package foundation.data.meta.property;
|
|
import foundation.dao.OperatorCode;
|
import foundation.util.Util;
|
|
public enum MetaType {
|
|
List, Form, Export, Import, Unknow, None;
|
|
public static MetaType getInstance(String order, OperatorCode operatorCode) {
|
MetaType result = Unknow;
|
|
if (!Util.isEmpty(order)) {
|
result = parse(order);
|
return result;
|
}
|
|
if (OperatorCode.GetBatch == operatorCode) {
|
result = MetaType.List;
|
}
|
else if (OperatorCode.GetOne == operatorCode) {
|
result = MetaType.Form;
|
}
|
|
return result;
|
}
|
|
public static MetaType parse(String value) {
|
if (value == null) {
|
return Unknow;
|
}
|
|
value = value.toLowerCase();
|
|
if ("list".equals(value)) {
|
return List;
|
}
|
else if ("form".equals(value)) {
|
return Form;
|
}
|
|
return Unknow;
|
}
|
|
}
|