se.unlogic.standardutils.populators
Class EnumPopulator<EnumType extends Enum<EnumType>>
java.lang.Object
se.unlogic.standardutils.populators.BaseStringPopulator<EnumType>
se.unlogic.standardutils.populators.EnumPopulator<EnumType>
- All Implemented Interfaces:
- BeanResultSetPopulator<EnumType>, BeanStringPopulator<EnumType>, QueryParameterPopulator<EnumType>, StringFormatValidator
public class EnumPopulator<EnumType extends Enum<EnumType>>
- extends BaseStringPopulator<EnumType>
- implements BeanResultSetPopulator<EnumType>, BeanStringPopulator<EnumType>, QueryParameterPopulator<EnumType>
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
classType
protected Class<EnumType extends Enum<EnumType>> classType
fieldName
protected String fieldName
EnumPopulator
public EnumPopulator(Class<EnumType> classType)
EnumPopulator
public EnumPopulator(Class<EnumType> classType,
String fieldName)
populate
public EnumType populate(ResultSet rs)
throws SQLException
- Specified by:
populate
in interface BeanResultSetPopulator<EnumType extends Enum<EnumType>>
- Throws:
SQLException
getValue
public EnumType getValue(String value)
- Specified by:
getValue
in interface BeanStringPopulator<EnumType extends Enum<EnumType>>
validateDefaultFormat
public boolean validateDefaultFormat(String value)
- Specified by:
validateDefaultFormat
in class BaseStringPopulator<EnumType extends Enum<EnumType>>
getType
public Class<? extends EnumType> getType()
- Specified by:
getType
in interface BeanStringPopulator<EnumType extends Enum<EnumType>>
- Specified by:
getType
in interface QueryParameterPopulator<EnumType extends Enum<EnumType>>
populate
public void populate(PreparedStatementQuery query,
int paramIndex,
Object bean)
throws SQLException
- Specified by:
populate
in interface QueryParameterPopulator<EnumType extends Enum<EnumType>>
- Throws:
SQLException
getGenericInstance
public static <Type extends Enum<Type>> EnumPopulator<Type> getGenericInstance(Class<Type> type)
getInstanceFromField
public static EnumPopulator<?> getInstanceFromField(Field field)
getInstanceFromListField
public static EnumPopulator<?> getInstanceFromListField(Field field)
getInstanceFromMethod
public static EnumPopulator<?> getInstanceFromMethod(Method method)
getInstanceFromListMethod
public static BeanStringPopulator<?> getInstanceFromListMethod(Method method)
Copyright © 2011. All Rights Reserved.