@@ -47,27 +47,25 @@ public class JsonSchema extends BaseJsonValidator {
47
47
JsonSchema (ObjectMapper mapper , String schemaPath , JsonNode schemaNode ,
48
48
JsonSchema parent ) {
49
49
super (schemaPath , schemaNode , parent , null );
50
- this .mapper = mapper ;
51
-
52
- validators = new LinkedHashMap <String , JsonValidator >();
53
-
54
- read (schemaNode );
50
+ this .init (mapper , schemaNode );
55
51
}
56
52
57
53
JsonSchema (ObjectMapper mapper , String schemaPath , JsonNode schemaNode ,
58
54
JsonSchema parent , JsonSchema subSchema ) {
59
55
super (schemaPath , schemaNode , parent , null , subSchema );
60
- this .mapper = mapper ;
61
-
62
- validators = new LinkedHashMap <String , JsonValidator >();
63
-
64
- read (schemaNode );
56
+ this .init (mapper , schemaNode );
65
57
}
66
58
67
59
public JsonSchema (ObjectMapper mapper , JsonNode schemaNode , JsonSchema subSchema ) {
68
60
this (mapper , "#" , schemaNode , null , subSchema );
69
61
}
70
62
63
+ private void init (ObjectMapper mapper , JsonNode schemaNode ) {
64
+ this .mapper = mapper ;
65
+ this .validators = new LinkedHashMap <String , JsonValidator >();
66
+ this .read (schemaNode );
67
+ }
68
+
71
69
/**
72
70
* Find the schema node for $ref attribute.
73
71
*
0 commit comments