se.unlogic.standardutils.populators
Class EnumPopulator<EnumType extends java.lang.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 java.lang.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 java.lang.Class<EnumType extends java.lang.Enum<EnumType>> classType
fieldName
protected java.lang.String fieldName
EnumPopulator
public EnumPopulator(java.lang.Class<EnumType> classType)
EnumPopulator
public EnumPopulator(java.lang.Class<EnumType> classType,
java.lang.String fieldName)
populate
public EnumType populate(java.sql.ResultSet rs)
throws java.sql.SQLException
- Specified by:
populate
in interface BeanResultSetPopulator<EnumType extends java.lang.Enum<EnumType>>
- Throws:
java.sql.SQLException
getValue
public EnumType getValue(java.lang.String value)
- Specified by:
getValue
in interface BeanStringPopulator<EnumType extends java.lang.Enum<EnumType>>
validateDefaultFormat
public boolean validateDefaultFormat(java.lang.String value)
- Specified by:
validateDefaultFormat
in class BaseStringPopulator<EnumType extends java.lang.Enum<EnumType>>
getType
public java.lang.Class<? extends EnumType> getType()
- Specified by:
getType
in interface BeanStringPopulator<EnumType extends java.lang.Enum<EnumType>>
- Specified by:
getType
in interface QueryParameterPopulator<EnumType extends java.lang.Enum<EnumType>>
populate
public void populate(PreparedStatementQuery query,
int paramIndex,
java.lang.Object bean)
throws java.sql.SQLException
- Specified by:
populate
in interface QueryParameterPopulator<EnumType extends java.lang.Enum<EnumType>>
- Throws:
java.sql.SQLException
getGenericInstance
public static <Type extends java.lang.Enum<Type>> EnumPopulator<Type> getGenericInstance(java.lang.Class<Type> type)
getInstanceFromField
public static EnumPopulator<?> getInstanceFromField(java.lang.reflect.Field field)
getInstanceFromListField
public static EnumPopulator<?> getInstanceFromListField(java.lang.reflect.Field field)
getInstanceFromMethod
public static EnumPopulator<?> getInstanceFromMethod(java.lang.reflect.Method method)
getInstanceFromListMethod
public static BeanStringPopulator<?> getInstanceFromListMethod(java.lang.reflect.Method method)
Copyright © 2011. All Rights Reserved.