public abstract class AbstractBsonWriter extends java.lang.Object implements BsonWriter, java.io.Closeable
Modifier and Type | Class and Description |
---|---|
class |
AbstractBsonWriter.Context
The context for the writer.
|
static class |
AbstractBsonWriter.State
The state of a writer.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
pipe(BsonReader reader)
Reads a single document from a BsonReader and writes it to this.
|
void |
pipe(BsonReader reader,
java.util.List<BsonElement> extraElements)
Reads a single document from the given BsonReader and writes it to this, appending the given extra elements to the document.
|
void |
writeBinaryData(BsonBinary binary)
Writes a BSON Binary data element to the writer.
|
void |
writeBinaryData(java.lang.String name,
BsonBinary binary)
Writes a BSON Binary data element to the writer.
|
void |
writeBoolean(boolean value)
Writes a BSON Boolean to the writer.
|
void |
writeBoolean(java.lang.String name,
boolean value)
Writes a BSON Boolean element to the writer.
|
void |
writeDateTime(long value)
Writes a BSON DateTime to the writer.
|
void |
writeDateTime(java.lang.String name,
long value)
Writes a BSON DateTime element to the writer.
|
void |
writeDBPointer(BsonDbPointer value)
Writes a BSON DBPointer to the writer.
|
void |
writeDBPointer(java.lang.String name,
BsonDbPointer value)
Writes a BSON DBPointer element to the writer.
|
void |
writeDecimal128(Decimal128 value)
Writes a BSON Decimal128 to the writer.
|
void |
writeDecimal128(java.lang.String name,
Decimal128 value)
Writes a BSON Decimal128 element to the writer.
|
void |
writeDouble(double value)
Writes a BSON Double to the writer.
|
void |
writeDouble(java.lang.String name,
double value)
Writes a BSON Double element to the writer.
|
void |
writeEndArray()
Writes the end of a BSON array to the writer.
|
void |
writeEndDocument()
Writes the end of a BSON document to the writer.
|
void |
writeInt32(int value)
Writes a BSON Int32 to the writer.
|
void |
writeInt32(java.lang.String name,
int value)
Writes a BSON Int32 element to the writer.
|
void |
writeInt64(long value)
Writes a BSON Int64 to the writer.
|
void |
writeInt64(java.lang.String name,
long value)
Writes a BSON Int64 element to the writer.
|
void |
writeJavaScript(java.lang.String code)
Writes a BSON JavaScript to the writer.
|
void |
writeJavaScript(java.lang.String name,
java.lang.String code)
Writes a BSON JavaScript element to the writer.
|
void |
writeJavaScriptWithScope(java.lang.String code)
Writes a BSON JavaScript to the writer (call WriteStartDocument to start writing the scope).
|
void |
writeJavaScriptWithScope(java.lang.String name,
java.lang.String code)
Writes a BSON JavaScript element to the writer (call WriteStartDocument to start writing the scope).
|
void |
writeMaxKey()
Writes a BSON MaxKey to the writer.
|
void |
writeMaxKey(java.lang.String name)
Writes a BSON MaxKey element to the writer.
|
void |
writeMinKey()
Writes a BSON MinKey to the writer.
|
void |
writeMinKey(java.lang.String name)
Writes a BSON MinKey element to the writer.
|
void |
writeName(java.lang.String name)
Writes the name of an element to the writer.
|
void |
writeNull()
Writes a BSON null to the writer.
|
void |
writeNull(java.lang.String name)
Writes a BSON null element to the writer.
|
void |
writeObjectId(ObjectId objectId)
Writes a BSON ObjectId to the writer.
|
void |
writeObjectId(java.lang.String name,
ObjectId objectId)
Writes a BSON ObjectId element to the writer.
|
void |
writeRegularExpression(BsonRegularExpression regularExpression)
Writes a BSON regular expression to the writer.
|
void |
writeRegularExpression(java.lang.String name,
BsonRegularExpression regularExpression)
Writes a BSON regular expression element to the writer.
|
void |
writeStartArray()
Writes the start of a BSON array to the writer.
|
void |
writeStartArray(java.lang.String name)
Writes the start of a BSON array element to the writer.
|
void |
writeStartDocument()
Writes the start of a BSON document to the writer.
|
void |
writeStartDocument(java.lang.String name)
Writes the start of a BSON document element to the writer.
|
void |
writeString(java.lang.String value)
Writes a BSON String to the writer.
|
void |
writeString(java.lang.String name,
java.lang.String value)
Writes a BSON String element to the writer.
|
void |
writeSymbol(java.lang.String value)
Writes a BSON Symbol to the writer.
|
void |
writeSymbol(java.lang.String name,
java.lang.String value)
Writes a BSON Symbol element to the writer.
|
void |
writeTimestamp(BsonTimestamp value)
Writes a BSON Timestamp to the writer.
|
void |
writeTimestamp(java.lang.String name,
BsonTimestamp value)
Writes a BSON Timestamp element to the writer.
|
void |
writeUndefined()
Writes a BSON undefined to the writer.
|
void |
writeUndefined(java.lang.String name)
Writes a BSON undefined element to the writer.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
flush
public void writeStartDocument(java.lang.String name)
BsonWriter
writeStartDocument
in interface BsonWriter
name
- The name of the element.public void writeStartDocument()
BsonWriter
writeStartDocument
in interface BsonWriter
public void writeEndDocument()
BsonWriter
writeEndDocument
in interface BsonWriter
public void writeStartArray(java.lang.String name)
BsonWriter
writeStartArray
in interface BsonWriter
name
- The name of the element.public void writeStartArray()
BsonWriter
writeStartArray
in interface BsonWriter
public void writeEndArray()
BsonWriter
writeEndArray
in interface BsonWriter
public void writeBinaryData(java.lang.String name, BsonBinary binary)
BsonWriter
writeBinaryData
in interface BsonWriter
name
- The name of the element.binary
- The Binary data value.public void writeBinaryData(BsonBinary binary)
BsonWriter
writeBinaryData
in interface BsonWriter
binary
- The Binary data.public void writeBoolean(java.lang.String name, boolean value)
BsonWriter
writeBoolean
in interface BsonWriter
name
- The name of the element.value
- The Boolean value.public void writeBoolean(boolean value)
BsonWriter
writeBoolean
in interface BsonWriter
value
- The Boolean value.public void writeDateTime(java.lang.String name, long value)
BsonWriter
writeDateTime
in interface BsonWriter
name
- The name of the element.value
- The number of milliseconds since the Unix epoch.public void writeDateTime(long value)
BsonWriter
writeDateTime
in interface BsonWriter
value
- The number of milliseconds since the Unix epoch.public void writeDBPointer(java.lang.String name, BsonDbPointer value)
BsonWriter
writeDBPointer
in interface BsonWriter
name
- The name of the element.value
- The DBPointer to writepublic void writeDBPointer(BsonDbPointer value)
BsonWriter
writeDBPointer
in interface BsonWriter
value
- The DBPointer to writepublic void writeDouble(java.lang.String name, double value)
BsonWriter
writeDouble
in interface BsonWriter
name
- The name of the element.value
- The Double value.public void writeDouble(double value)
BsonWriter
writeDouble
in interface BsonWriter
value
- The Double value.public void writeInt32(java.lang.String name, int value)
BsonWriter
writeInt32
in interface BsonWriter
name
- The name of the element.value
- The Int32 value.public void writeInt32(int value)
BsonWriter
writeInt32
in interface BsonWriter
value
- The Int32 value.public void writeInt64(java.lang.String name, long value)
BsonWriter
writeInt64
in interface BsonWriter
name
- The name of the element.value
- The Int64 value.public void writeInt64(long value)
BsonWriter
writeInt64
in interface BsonWriter
value
- The Int64 value.public void writeDecimal128(Decimal128 value)
BsonWriter
writeDecimal128
in interface BsonWriter
value
- The Decimal128 value.public void writeDecimal128(java.lang.String name, Decimal128 value)
BsonWriter
writeDecimal128
in interface BsonWriter
name
- The name of the element.value
- The Decimal128 value.public void writeJavaScript(java.lang.String name, java.lang.String code)
BsonWriter
writeJavaScript
in interface BsonWriter
name
- The name of the element.code
- The JavaScript code.public void writeJavaScript(java.lang.String code)
BsonWriter
writeJavaScript
in interface BsonWriter
code
- The JavaScript code.public void writeJavaScriptWithScope(java.lang.String name, java.lang.String code)
BsonWriter
writeJavaScriptWithScope
in interface BsonWriter
name
- The name of the element.code
- The JavaScript code.public void writeJavaScriptWithScope(java.lang.String code)
BsonWriter
writeJavaScriptWithScope
in interface BsonWriter
code
- The JavaScript code.public void writeMaxKey(java.lang.String name)
BsonWriter
writeMaxKey
in interface BsonWriter
name
- The name of the element.public void writeMaxKey()
BsonWriter
writeMaxKey
in interface BsonWriter
public void writeMinKey(java.lang.String name)
BsonWriter
writeMinKey
in interface BsonWriter
name
- The name of the element.public void writeMinKey()
BsonWriter
writeMinKey
in interface BsonWriter
public void writeName(java.lang.String name)
BsonWriter
writeName
in interface BsonWriter
name
- The name of the element.public void writeNull(java.lang.String name)
BsonWriter
writeNull
in interface BsonWriter
name
- The name of the element.public void writeNull()
BsonWriter
writeNull
in interface BsonWriter
public void writeObjectId(java.lang.String name, ObjectId objectId)
BsonWriter
writeObjectId
in interface BsonWriter
name
- The name of the element.objectId
- The ObjectId value.public void writeObjectId(ObjectId objectId)
BsonWriter
writeObjectId
in interface BsonWriter
objectId
- The ObjectId value.public void writeRegularExpression(java.lang.String name, BsonRegularExpression regularExpression)
BsonWriter
writeRegularExpression
in interface BsonWriter
name
- The name of the element.regularExpression
- The RegularExpression value.public void writeRegularExpression(BsonRegularExpression regularExpression)
BsonWriter
writeRegularExpression
in interface BsonWriter
regularExpression
- the regular expression to write.public void writeString(java.lang.String name, java.lang.String value)
BsonWriter
writeString
in interface BsonWriter
name
- The name of the element.value
- The String value.public void writeString(java.lang.String value)
BsonWriter
writeString
in interface BsonWriter
value
- The String value.public void writeSymbol(java.lang.String name, java.lang.String value)
BsonWriter
writeSymbol
in interface BsonWriter
name
- The name of the element.value
- The symbol.public void writeSymbol(java.lang.String value)
BsonWriter
writeSymbol
in interface BsonWriter
value
- The symbol.public void writeTimestamp(java.lang.String name, BsonTimestamp value)
BsonWriter
writeTimestamp
in interface BsonWriter
name
- The name of the element.value
- The combined timestamp/increment value.public void writeTimestamp(BsonTimestamp value)
BsonWriter
writeTimestamp
in interface BsonWriter
value
- The combined timestamp/increment value.public void writeUndefined(java.lang.String name)
BsonWriter
writeUndefined
in interface BsonWriter
name
- The name of the element.public void writeUndefined()
BsonWriter
writeUndefined
in interface BsonWriter
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public void pipe(BsonReader reader)
BsonWriter
pipe
in interface BsonWriter
reader
- The source.public void pipe(BsonReader reader, java.util.List<BsonElement> extraElements)
reader
- the source of the documentextraElements
- the extra elements to append to the documentCopyright © 2010 - 2020 Adobe. All Rights Reserved