public static enum BsonGenerator.Feature extends java.lang.Enum<BsonGenerator.Feature>
| Enum Constant and Description |
|---|
ENABLE_STREAMING
Enables streaming by setting the document's total
number of bytes in the header to 0.
|
WRITE_BIGDECIMALS_AS_DECIMAL128
Forces
BigDecimals to be written as Decimal128s. |
WRITE_BIGDECIMALS_AS_STRINGS
Forces
BigDecimals to be written as Strings. |
| Modifier and Type | Method and Description |
|---|---|
int |
getMask() |
static BsonGenerator.Feature |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static BsonGenerator.Feature[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BsonGenerator.Feature ENABLE_STREAMING
Enables streaming by setting the document's total number of bytes in the header to 0. This allows the generator to flush the output buffer from time to time. Otherwise the generator would have to buffer the whole file to be able to calculate the total number of bytes.
ATTENTION: By enabling this feature, the BSON document
generated by this class will not be compatible to the
specification! However, if you know what you are doing and
if you know that the document will be read by a parser that
ignores the total number of bytes anyway (like BsonParser
or org.bson.BSONDecoder from the MongoDB Java Driver
do) then this feature will be very useful.
This feature is disabled by default.
public static final BsonGenerator.Feature WRITE_BIGDECIMALS_AS_STRINGS
Forces BigDecimals to be written as Strings.
The BSON format supports IEEE 754 doubles only (64 bits). You
may want to enable this feature if you want to serialize numbers
that require more bits or a higher accuracy.
This feature is disabled by default.
public static final BsonGenerator.Feature WRITE_BIGDECIMALS_AS_DECIMAL128
Forces BigDecimals to be written as Decimal128s.
(since BSON specification 1.1).
This feature is disabled by default.
public static BsonGenerator.Feature[] values()
for (BsonGenerator.Feature c : BsonGenerator.Feature.values()) System.out.println(c);
public static BsonGenerator.Feature valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic int getMask()