class ListBoxFieldProvider extends SelectorFieldProvider<ListBoxBaseDefinition> {

    @Override
    public ListBoxBaseDefinition createFieldByType(TypeInfo typeInfo) {
        if (typeInfo.getType().equals(TypeKind.ENUM)) {
            return new EnumListBoxFieldDefinition();
        }

        String className = typeInfo.getClassName();

        if (Byte.class.getName().equals(className) ||
                byte.class.getName().equals(className) ||
                Short.class.getName().equals(className) ||
                short.class.getName().equals(className) ||
                Integer.class.getName().equals(className) ||
                int.class.getName().equals(className) ||
                Long.class.getName().equals(className) ||
                long.class.getName().equals(className) ||
                BigInteger.class.getName().equals(className)) {
            return new IntegerListBoxFieldDefinition();
        }
        if (Float.class.getName().equals(className) ||
                float.class.getName().equals(className) ||
                Double.class.getName().equals(className) ||
                double.class.getName().equals(className) ||
                BigDecimal.class.getName().equals(className)) {
            return new DecimalListBoxFieldDefinition();
        }
        if (Character.class.getName().equals(className) ||
                char.class.getName().equals(className)) {
            return new CharacterListBoxFieldDefinition();
        }

        for (String type : getSupportedTypes()) {
            if (type.equals(typeInfo.getClassName())) {
                return new StringListBoxFieldDefinition();
            }
        }

        return new EnumListBoxFieldDefinition();
    }

}