Package org.bson.codecs
Class IterableCodec
- java.lang.Object
-
- org.bson.codecs.IterableCodec
-
-
Constructor Summary
Constructors Constructor Description IterableCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap)
Construct a new instance with the givenCodecRegistry
andBsonTypeClassMap
.IterableCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap, Transformer valueTransformer)
Construct a new instance with the givenCodecRegistry
andBsonTypeClassMap
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Iterable
decode(BsonReader reader, DecoderContext decoderContext)
Decodes a BSON value from the given reader into an instance of the type parameterT
.void
encode(BsonWriter writer, Iterable value, EncoderContext encoderContext)
Encode an instance of the type parameterT
into a BSON value.Class<Iterable>
getEncoderClass()
Returns the Class instance that this encodes.
-
-
-
Constructor Detail
-
IterableCodec
public IterableCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap)
Construct a new instance with the givenCodecRegistry
andBsonTypeClassMap
.- Parameters:
registry
- the non-null codec registrybsonTypeClassMap
- the non-null BsonTypeClassMap
-
IterableCodec
public IterableCodec(CodecRegistry registry, BsonTypeClassMap bsonTypeClassMap, Transformer valueTransformer)
Construct a new instance with the givenCodecRegistry
andBsonTypeClassMap
.- Parameters:
registry
- the non-null codec registrybsonTypeClassMap
- the non-null BsonTypeClassMapvalueTransformer
- the value Transformer
-
-
Method Detail
-
decode
public Iterable decode(BsonReader reader, DecoderContext decoderContext)
Description copied from interface:Decoder
Decodes a BSON value from the given reader into an instance of the type parameterT
.
-
encode
public void encode(BsonWriter writer, Iterable value, EncoderContext encoderContext)
Description copied from interface:Encoder
Encode an instance of the type parameterT
into a BSON value.
-
getEncoderClass
public Class<Iterable> getEncoderClass()
Description copied from interface:Encoder
Returns the Class instance that this encodes. This is necessary because Java does not reify generic types.- Specified by:
getEncoderClass
in interfaceEncoder<Iterable>
- Returns:
- the Class instance that this encodes.
-
-