Skip to content

Commit 4341838

Browse files
committed
Polishing
1 parent 58f58e4 commit 4341838

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

src/docs/asciidoc/core/core-validation.adoc

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,6 @@ The SPI to implement type conversion logic is simple and strongly typed:
725725
public interface Converter<S, T> {
726726
727727
T convert(S source);
728-
729728
}
730729
----
731730

@@ -754,7 +753,6 @@ Consider `StringToInteger` as an example for a typical `Converter` implementatio
754753
public Integer convert(String source) {
755754
return Integer.valueOf(source);
756755
}
757-
758756
}
759757
----
760758

@@ -775,7 +773,6 @@ example, when converting from String to java.lang.Enum objects, implement
775773
public interface ConverterFactory<S, R> {
776774
777775
<T extends R> Converter<S, T> getConverter(Class<T> targetType);
778-
779776
}
780777
----
781778

@@ -833,7 +830,6 @@ by a field annotation, or generic information declared on a field signature.
833830
public Set<ConvertiblePair> getConvertibleTypes();
834831
835832
Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType);
836-
837833
}
838834
----
839835

@@ -872,12 +868,9 @@ such as a `static valueOf` method, is defined on the target class.
872868
public interface ConditionalConverter {
873869
874870
boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType);
875-
876871
}
877872
878-
public interface ConditionalGenericConverter
879-
extends GenericConverter, ConditionalConverter {
880-
873+
public interface ConditionalGenericConverter extends GenericConverter, ConditionalConverter {
881874
}
882875
----
883876

@@ -1079,6 +1072,7 @@ Where Formatter extends from the Printer and Parser building-block interfaces:
10791072
[subs="verbatim,quotes"]
10801073
----
10811074
public interface Printer<T> {
1075+
10821076
String print(T fieldValue, Locale locale);
10831077
}
10841078
----
@@ -1089,6 +1083,7 @@ Where Formatter extends from the Printer and Parser building-block interfaces:
10891083
import java.text.ParseException;
10901084
10911085
public interface Parser<T> {
1086+
10921087
T parse(String clientValue, Locale locale) throws ParseException;
10931088
}
10941089
----
@@ -1142,7 +1137,6 @@ Consider `DateFormatter` as an example `Formatter` implementation:
11421137
dateFormat.setLenient(false);
11431138
return dateFormat;
11441139
}
1145-
11461140
}
11471141
----
11481142

@@ -1169,7 +1163,6 @@ an Annotation to a formatter, implement AnnotationFormatterFactory:
11691163
Printer<?> getPrinter(A annotation, Class<?> fieldType);
11701164
11711165
Parser<?> getParser(A annotation, Class<?> fieldType);
1172-
11731166
}
11741167
----
11751168

@@ -1229,7 +1222,6 @@ To trigger formatting, simply annotate fields with @NumberFormat:
12291222
12301223
@NumberFormat(style=Style.CURRENCY)
12311224
private BigDecimal decimal;
1232-
12331225
}
12341226
----
12351227

@@ -1251,7 +1243,6 @@ The example below uses @DateTimeFormat to format a java.util.Date as a ISO Date
12511243
12521244
@DateTimeFormat(iso=ISO.DATE)
12531245
private Date date;
1254-
12551246
}
12561247
----
12571248

@@ -1283,7 +1274,6 @@ Review the FormatterRegistry SPI below:
12831274
void addFormatterForFieldType(Formatter<?> formatter);
12841275
12851276
void addFormatterForAnnotation(AnnotationFormatterFactory<?, ?> factory);
1286-
12871277
}
12881278
----
12891279

@@ -1311,7 +1301,6 @@ FormatterRegistry:
13111301
public interface FormatterRegistrar {
13121302
13131303
void registerFormatters(FormatterRegistry registry);
1314-
13151304
}
13161305
----
13171306

@@ -1469,7 +1458,6 @@ JSR-303 allows you to define declarative validation constraints against such pro
14691458
14701459
@Min(0)
14711460
private int age;
1472-
14731461
}
14741462
----
14751463

@@ -1542,7 +1530,6 @@ the Spring Validation API:
15421530
15431531
@Autowired
15441532
private Validator validator;
1545-
15461533
}
15471534
----
15481535

0 commit comments

Comments
 (0)