Options
All
  • Public
  • Public/Protected
  • All
Menu

The BsonGenerator class, extending the Generator class and generating the code that creates from a data structure its bson object.

Hierarchy

Index

Constructors

constructor

Properties

Protected code

code: string = ""

The generated code.

Protected comment

comment: string = "{{GENERATE_BSON}}"

The template comment that this generator handles.

Protected config

config: ConfigModel

The config model: the generated code could depend on it.

Private depth

depth: number = 0

The current depth of the structure model.

Private forDepth

forDepth: number = 0

The current nested for depth.

Private indentation

indentation: number = 0

The current indentation as number of tabs.

Private keys

keys: Key[] = []

A stack of inspected keys.

Protected structure

structure: StructureModel

The structure model: the generated code could depend on it.

Accessors

Private currentKey

  • get currentKey(): string

generated

  • get generated(): Code

Private indentationTabs

  • get indentationTabs(): string

Private maxDepth

  • get maxDepth(): number

Private parsedDepth

  • get parsedDepth(): string

Private parsedForDepth

  • get parsedForDepth(): string

Private parsedKeys

  • get parsedKeys(): string

Methods

Private firstParse

Protected generate

  • generate(): void

Private getDepth

Private parse

Private parseArray

Private parseKey

  • parseKey(key: Key): string

Private parseObject

Private parsePrimitive

Protected print

  • print(str: string): void

Generated using TypeDoc