-
Type: Improvement
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: API
-
Labels:None
If we look at the usage of the following classes, we will see that they are actually used only by corresponding decoders.
- org.bson.BSONCallback
- org.bson.EmptyBSONCallback
- org.bson.LazyBSONCallback
- org.bson.BasicBSONCallback
- com.mongodb.DBCallback
- com.mongodb.DefaultDBCallback
- com.mongodb.LazyDBCallback
- com.mongodb.LazyWritableDBCallback
- com.mongodb.util.JSONCallback
- com.mongodb.DBCallbackFactory
At the same time com.mongodb.DBCallbackFactory is used only by DefaultDBCallback, where it is a public static field. So I think that it's better to hide all this from public api in future releases, and for now we can deprecate them.
Also we will be able to deprecate the following methods:
- org.bson.BSONDecoder
- int decode( byte[] b , BSONCallback callback );
- int decode( InputStream in , BSONCallback callback ) throws IOException;
- com.mongodb.DBDecoder
- DBCallback getDBCallback(DBCollection collection);
As for com.mongodb.util.JSONCallback, we can just make it package-private and use directly in com.mongodb.util.JSON.JSONParser.