@@ -725,7 +725,6 @@ The SPI to implement type conversion logic is simple and strongly typed:
725
725
public interface Converter<S, T> {
726
726
727
727
T convert(S source);
728
-
729
728
}
730
729
----
731
730
@@ -754,7 +753,6 @@ Consider `StringToInteger` as an example for a typical `Converter` implementatio
754
753
public Integer convert(String source) {
755
754
return Integer.valueOf(source);
756
755
}
757
-
758
756
}
759
757
----
760
758
@@ -775,7 +773,6 @@ example, when converting from String to java.lang.Enum objects, implement
775
773
public interface ConverterFactory<S, R> {
776
774
777
775
<T extends R> Converter<S, T> getConverter(Class<T> targetType);
778
-
779
776
}
780
777
----
781
778
@@ -833,7 +830,6 @@ by a field annotation, or generic information declared on a field signature.
833
830
public Set<ConvertiblePair> getConvertibleTypes();
834
831
835
832
Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType);
836
-
837
833
}
838
834
----
839
835
@@ -872,12 +868,9 @@ such as a `static valueOf` method, is defined on the target class.
872
868
public interface ConditionalConverter {
873
869
874
870
boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType);
875
-
876
871
}
877
872
878
- public interface ConditionalGenericConverter
879
- extends GenericConverter, ConditionalConverter {
880
-
873
+ public interface ConditionalGenericConverter extends GenericConverter, ConditionalConverter {
881
874
}
882
875
----
883
876
@@ -1079,6 +1072,7 @@ Where Formatter extends from the Printer and Parser building-block interfaces:
1079
1072
[subs="verbatim,quotes"]
1080
1073
----
1081
1074
public interface Printer<T> {
1075
+
1082
1076
String print(T fieldValue, Locale locale);
1083
1077
}
1084
1078
----
@@ -1089,6 +1083,7 @@ Where Formatter extends from the Printer and Parser building-block interfaces:
1089
1083
import java.text.ParseException;
1090
1084
1091
1085
public interface Parser<T> {
1086
+
1092
1087
T parse(String clientValue, Locale locale) throws ParseException;
1093
1088
}
1094
1089
----
@@ -1142,7 +1137,6 @@ Consider `DateFormatter` as an example `Formatter` implementation:
1142
1137
dateFormat.setLenient(false);
1143
1138
return dateFormat;
1144
1139
}
1145
-
1146
1140
}
1147
1141
----
1148
1142
@@ -1169,7 +1163,6 @@ an Annotation to a formatter, implement AnnotationFormatterFactory:
1169
1163
Printer<?> getPrinter(A annotation, Class<?> fieldType);
1170
1164
1171
1165
Parser<?> getParser(A annotation, Class<?> fieldType);
1172
-
1173
1166
}
1174
1167
----
1175
1168
@@ -1229,7 +1222,6 @@ To trigger formatting, simply annotate fields with @NumberFormat:
1229
1222
1230
1223
@NumberFormat(style=Style.CURRENCY)
1231
1224
private BigDecimal decimal;
1232
-
1233
1225
}
1234
1226
----
1235
1227
@@ -1251,7 +1243,6 @@ The example below uses @DateTimeFormat to format a java.util.Date as a ISO Date
1251
1243
1252
1244
@DateTimeFormat(iso=ISO.DATE)
1253
1245
private Date date;
1254
-
1255
1246
}
1256
1247
----
1257
1248
@@ -1283,7 +1274,6 @@ Review the FormatterRegistry SPI below:
1283
1274
void addFormatterForFieldType(Formatter<?> formatter);
1284
1275
1285
1276
void addFormatterForAnnotation(AnnotationFormatterFactory<?, ?> factory);
1286
-
1287
1277
}
1288
1278
----
1289
1279
@@ -1311,7 +1301,6 @@ FormatterRegistry:
1311
1301
public interface FormatterRegistrar {
1312
1302
1313
1303
void registerFormatters(FormatterRegistry registry);
1314
-
1315
1304
}
1316
1305
----
1317
1306
@@ -1469,7 +1458,6 @@ JSR-303 allows you to define declarative validation constraints against such pro
1469
1458
1470
1459
@Min(0)
1471
1460
private int age;
1472
-
1473
1461
}
1474
1462
----
1475
1463
@@ -1542,7 +1530,6 @@ the Spring Validation API:
1542
1530
1543
1531
@Autowired
1544
1532
private Validator validator;
1545
-
1546
1533
}
1547
1534
----
1548
1535
0 commit comments