Commit 0f59dc7 1 parent 478e1dd commit 0f59dc7 Copy full SHA for 0f59dc7
File tree 1 file changed +13
-8
lines changed
retrofit-converters/simplexml/src/main/java/retrofit/converter
1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 18
18
* @author Fabien Ric ([email protected] )
19
19
*/
20
20
public class SimpleXMLConverter implements Converter {
21
+ private static final boolean DEFAULT_STRICT = true ;
21
22
private static final String CHARSET = "UTF-8" ;
22
23
private static final String MIME_TYPE = "application/xml; charset=" + CHARSET ;
23
24
24
25
private final Serializer serializer ;
25
26
26
- private boolean strict = true ;
27
+ private final boolean strict ;
27
28
28
29
public SimpleXMLConverter () {
29
- this (new Persister ());
30
+ this (DEFAULT_STRICT );
31
+ }
32
+
33
+ public SimpleXMLConverter (boolean strict ) {
34
+ this (new Persister (), strict );
30
35
}
31
36
32
37
public SimpleXMLConverter (Serializer serializer ) {
38
+ this (serializer , DEFAULT_STRICT );
39
+ }
40
+
41
+ public SimpleXMLConverter (Serializer serializer , boolean strict ) {
33
42
this .serializer = serializer ;
43
+ this .strict = strict ;
34
44
}
35
45
36
46
@ Override public Object fromBody (TypedInput body , Type type ) throws ConversionException {
@@ -64,11 +74,6 @@ public SimpleXMLConverter(Serializer serializer) {
64
74
}
65
75
66
76
public boolean isStrict () {
67
- return strict ;
77
+ return strict ;
68
78
}
69
-
70
- public void setStrict (boolean strict ) {
71
- this .strict = strict ;
72
- }
73
-
74
79
}
You can’t perform that action at this time.
0 commit comments