File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 4
4
5
5
import java .text .*;
6
6
import java .util .*;
7
- import java .util .logging .*;
8
7
import java .util .regex .*;
9
8
10
9
import org .bson .*;
11
10
import org .bson .types .*;
11
+
12
12
import com .mongodb .*;
13
13
14
14
public class JSONCallback extends BasicBSONCallback {
15
15
16
+ @ Override
16
17
public BSONObject create (){
17
18
return new BasicDBObject ();
18
19
}
19
20
20
- public BSONObject create ( boolean array , List <String > path ){
21
- if ( array )
22
- return new BasicDBList ();
23
- return new BasicDBObject ();
21
+ @ Override
22
+ protected BSONObject createList () {
23
+ return new BasicDBList ();
24
24
}
25
-
25
+
26
26
public void objectStart (boolean array , String name ){
27
27
_lastArray = array ;
28
28
super .objectStart ( array , name );
Original file line number Diff line number Diff line change 3
3
package org .bson ;
4
4
5
5
import java .util .*;
6
- import java .util .regex .* ;
6
+ import java .util .regex .Pattern ;
7
7
8
8
import org .bson .types .*;
9
9
@@ -17,14 +17,18 @@ public BSONObject create(){
17
17
return new BasicBSONObject ();
18
18
}
19
19
20
+ protected BSONObject createList () {
21
+ return new BasicBSONList ();
22
+ }
23
+
20
24
public BSONCallback createBSONCallback (){
21
25
return new BasicBSONCallback ();
22
26
}
23
27
24
28
public BSONObject create ( boolean array , List <String > path ){
25
29
if ( array )
26
- return new BasicBSONList ();
27
- return new BasicBSONObject ();
30
+ return createList ();
31
+ return create ();
28
32
}
29
33
30
34
public void objectStart (){
You can’t perform that action at this time.
0 commit comments