Package org.apache.juneau.marshall.bson
Annotation Interface BsonConfig
@Target({TYPE,METHOD})
@Retention(RUNTIME)
@Inherited
@ContextApply({SerializerApply.class,ParserApply.class})
public @interface BsonConfig
Annotation for specifying config properties defined in
BsonSerializer and BsonParser.
Used primarily for specifying bean configuration properties on REST classes and methods.
See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionAdd"_type" properties when needed.Maximum allowed wire-declared length (in bytes) for BSON strings, binary payloads, and document/array size prefixes when parsing.intOptional rank for this config.
-
Element Details
-
addBeanTypes
Add"_type" properties when needed.If
"true" , then"_type" properties will be added to beans if their type cannot be inferred through reflection."true" "false" (default)
- Returns:
- The annotation value.
- Default:
- ""
-
writeDatesAsDatetime
Use BSON datetime type forDate/Calendar/Instant.If
"true" , dates are serialized as BSON datetime (type 0x09). If"false" , dates are serialized as ISO-8601 strings."true" (default)"false"
- Returns:
- The annotation value.
- Default:
- ""
-
maxLength
Maximum allowed wire-declared length (in bytes) for BSON strings, binary payloads, and document/array size prefixes when parsing.Guards against malformed or adversarial input where a small payload declares a huge or negative length. Default is
"16777216" (16 MiB). A value of"0" or less disables the cap.- Returns:
- The annotation value.
- Default:
- ""
-
rank
int rankOptional rank for this config.- Returns:
- The annotation value.
- Default:
- 0
-