if (version.compareTo(FixVersions.BEGINSTRING_FIX40) > 0) {
if (version.compareTo(FixVersions.BEGINSTRING_FIX41) > 0) {
    private void checkValidFormat(StringField field) {        try {            FieldType fieldType = getFieldType(field.getTag());            if (fieldType == FieldType.String) {                // String            } else if (fieldType == FieldType.Char) {                if (version.compareTo(FixVersions.BEGINSTRING_FIX40) > 0) {                    FieldValueConverter.CharConverter.convert(field.getValue());                } else {                    // String, for older FIX versions                }            } else if (fieldType == FieldType.Price) {                FieldValueConverter.DoubleConverter.convert(field.getValue());            } else if (fieldType == FieldType.Int) {                FieldValueConverter.IntConverter.convert(field.getValue());            } else if (fieldType == FieldType.Amt) {                FieldValueConverter.DoubleConverter.convert(field.getValue());            } else if (fieldType == FieldType.Qty) {                FieldValueConverter.DoubleConverter.convert(field.getValue());            } else if (fieldType == FieldType.Qty) {                // String            } else if (fieldType == FieldType.MultipleValueString) {                // String            } else if (fieldType == FieldType.Exchange) {                // String            } else if (fieldType == FieldType.Boolean) {                FieldValueConverter.BooleanConverter.convert(field.getValue());            } else if (fieldType == FieldType.LocalMktDate) {                // String            } else if (fieldType == FieldType.Data) {                // String            } else if (fieldType == FieldType.Float) {                FieldValueConverter.DoubleConverter.convert(field.getValue());            } else if (fieldType == FieldType.PriceOffset) {                FieldValueConverter.DoubleConverter.convert(field.getValue());            } else if (fieldType == FieldType.MonthYear) {                // String            } else if (fieldType == FieldType.DayOfMonth) {                // String            } else if (fieldType == FieldType.UtcDate) {                FieldValueConverter.UtcDateOnlyConverter.convert(field.getValue());            } else if (fieldType == FieldType.UtcTimeOnly) {                FieldValueConverter.UtcTimeOnlyConverter.convert(field.getValue());            } else if (fieldType == FieldType.UtcTimeStamp || fieldType == FieldType.Time) {                FieldValueConverter.UtcTimestampConverter.convert(field.getValue());            } else if (fieldType == FieldType.NumInGroup) {                FieldValueConverter.IntConverter.convert(field.getValue());            } else if (fieldType == FieldType.Percentage) {                FieldValueConverter.DoubleConverter.convert(field.getValue());            } else if (fieldType == FieldType.SeqNum) {                FieldValueConverter.IntConverter.convert(field.getValue());            } else if (fieldType == FieldType.Length) {                FieldValueConverter.IntConverter.convert(field.getValue());            } else if (fieldType == FieldType.Country) {                // String            }        } catch (FieldConvertError e) {            throw new FieldException(SessionRejectReason.INCORRECT_DATA_FORMAT_FOR_VALUE, e                    .getMessage(), field.getTag());        }    }