com.talk2object.plum.interaction.view.annotation.parameter.helper.EnumParameterWrapper Maven / Gradle / Ivy
package com.talk2object.plum.interaction.view.annotation.parameter.helper;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import com.talk2object.plum.interaction.rich.field.DateField;
import com.talk2object.plum.interaction.rich.field.InteractiveField;
import com.talk2object.plum.interaction.view.annotation.parameter.DateParameter;
import com.talk2object.plum.interaction.view.annotation.parameter.EnumParameter;
public class EnumParameterWrapper extends AbstractParameterWrapper {
private EnumParameter getEnumParameter() {
return (EnumParameter) parameter;
}
@Override
public Object getInitValue() {
return getEnumParameter().initValue();
}
@Override
Object[] getOptionValues() {
// not support
return new Object[0];
}
@Override
public Object value2Object(Object value) {
String strValue = (String) value;
Class enumClass = targetClass;
Object enumVal = Enum.valueOf(enumClass, strValue);
return enumVal;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy