Class KotlinFileGenerator

Abstract file generator which each file generator much implement.

Hierarchy

Implements

Constructors

  • Parameters

    • Optional options: {
          collectionType?: "List" | "Array";
          constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; };
          defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; };
          dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; });
          indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; };
          presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[];
          processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...;
          typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; };
      }
      • Optional collectionType?: "List" | "Array"
      • Optional constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; }
      • Optional defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }
      • Optional dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; })

        This dependency manager type serves two functions.

        1. It can be used to provide a factory for generate functions
        2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

        This depends on context and where it's used.

      • Optional indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; }
      • Optional presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[]
      • Optional processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...
      • Optional typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; }

    Returns KotlinFileGenerator

Properties

languageName: string
options: KotlinOptions
defaultOptions: KotlinOptions = ...

Methods

  • Parameters

    • model: MetaModel
    • options: {
          collectionType?: "List" | "Array";
          constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; };
          defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; };
          dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; });
          indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; };
          presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[];
          processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...;
          typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; };
      }
      • Optional collectionType?: "List" | "Array"
      • Optional constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; }
      • Optional defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }
      • Optional dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; })

        This dependency manager type serves two functions.

        1. It can be used to provide a factory for generate functions
        2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

        This depends on context and where it's used.

      • Optional indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; }
      • Optional presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[]
      • Optional processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...
      • Optional typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; }

    Returns ConstrainedMetaModel

  • Parameters

    • model: ConstrainedObjectModel
    • inputModel: InputMetaModel
    • Optional options: {
          collectionType?: "List" | "Array";
          constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; };
          defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; };
          dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; });
          indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; };
          presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[];
          processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...;
          typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; };
      }
      • Optional collectionType?: "List" | "Array"
      • Optional constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; }
      • Optional defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }
      • Optional dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; })

        This dependency manager type serves two functions.

        1. It can be used to provide a factory for generate functions
        2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

        This depends on context and where it's used.

      • Optional indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; }
      • Optional presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[]
      • Optional processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...
      • Optional typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; }

    Returns Promise<RenderOutput>

  • Parameters

    • model: ConstrainedEnumModel
    • inputModel: InputMetaModel
    • Optional options: {
          collectionType?: "List" | "Array";
          constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; };
          defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; };
          dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; });
          indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; };
          presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[];
          processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...;
          typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; };
      }
      • Optional collectionType?: "List" | "Array"
      • Optional constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; }
      • Optional defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }
      • Optional dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; })

        This dependency manager type serves two functions.

        1. It can be used to provide a factory for generate functions
        2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

        This depends on context and where it's used.

      • Optional indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; }
      • Optional presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[]
      • Optional processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...
      • Optional typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; }

    Returns Promise<RenderOutput>

  • Returns the Kotlin options by merging custom options with default ones.

    Parameters

    • Optional options: {
          collectionType?: "List" | "Array";
          constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; };
          defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; };
          dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; });
          indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; };
          presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[];
          processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...;
          typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; };
      }
      • Optional collectionType?: "List" | "Array"
      • Optional constraints?: { enumKey?: EnumKeyConstraint<KotlinOptions> | undefined; enumValue?: EnumValueConstraint<KotlinOptions> | undefined; modelName?: ModelNameConstraint<...> | undefined; propertyKey?: PropertyKeyConstraint<...> | undefined; constant?: ConstantConstraint<...> | undefined; }
      • Optional defaultPreset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }
      • Optional dependencyManager?: (() => AbstractDependencyManager) | ({ dependencies?: (string | undefined)[] | undefined; addDependency?: ((dependency: string) => void) | undefined; })

        This dependency manager type serves two functions.

        1. It can be used to provide a factory for generate functions
        2. It can be used to provide a single instance of a dependency manager, to add all dependencies together

        This depends on context and where it's used.

      • Optional indentation?: { type?: IndentationTypes | undefined; size?: number | undefined; }
      • Optional presets?: (undefined | ({ class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; }) | ({ preset?: { class?: { ctor?: ((args: PresetArgs<ClassRenderer, any, ConstrainedObjectModel>) => string | Promise<string>) | undefined; ... 4 more ...; additionalContent?: ((args: PresetArgs<...>) => string | Promise<...>) | undefined; } | undefined; enum?: { ...; } | undefined; } | undefined; options?: any; }))[]
      • Optional processorOptions?: { asyncapi?: { source?: string | undefined; applyTraits?: boolean | undefined; parseSchemas?: boolean | undefined; validateOptions?: { allowedSeverity?: { error?: boolean | undefined; warning?: boolean | undefined; info?: boolean | undefined; hint?: boolean | undefined; } | undefined; __unstable?: { ...; } | undefin...
      • Optional typeMapping?: { Object?: TypeMappingFunction<ConstrainedObjectModel, KotlinOptions, KotlinDependencyManager> | undefined; ... 10 more ...; Dictionary?: TypeMappingFunction<...> | undefined; }

    Returns KotlinOptions

Generated using TypeDoc