models

package
v2.1.1872 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Jackson = "jackson"
View Source
var Moshi = "moshi"

Functions

func Generate

func Generate(specification *spec.Spec, jsonlib string, packageName string, generatePath string) *generator.Sources

func NewTypes

func NewTypes(jsonlib string) *types.Types

Types

type Generator

type Generator interface {
	SetupLibrary(thePackage packages.Module) []generator.CodeFile
	SetupImport(jsonPackage packages.Module) string
	VersionModels(version *spec.Version, thePackage packages.Module, jsonPackage packages.Module) []generator.CodeFile
	ReadJson(jsonStr string, typ *spec.TypeDef) (string, string)
	WriteJson(varData string, typ *spec.TypeDef) (string, string)
	WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string
	CreateJsonMapperField(w *generator.Writer, annotation string)
	InitJsonMapper(w *generator.Writer)
	ModelsDefinitionsImports() []string
	ModelsUsageImports() []string

	GenerateJsonParseException(thePackage, modelsPackage packages.Module) *generator.CodeFile
}

func NewGenerator

func NewGenerator(jsonlib string) Generator

type JacksonGenerator

type JacksonGenerator struct {
	Types *types.Types
}

func NewJacksonGenerator

func NewJacksonGenerator(types *types.Types) *JacksonGenerator

func (*JacksonGenerator) CreateJsonMapperField

func (g *JacksonGenerator) CreateJsonMapperField(w *generator.Writer, annotation string)

func (*JacksonGenerator) GenerateJsonParseException added in v2.1.1756

func (g *JacksonGenerator) GenerateJsonParseException(thePackage, modelsPackage packages.Module) *generator.CodeFile

func (*JacksonGenerator) InitJsonMapper

func (g *JacksonGenerator) InitJsonMapper(w *generator.Writer)

func (*JacksonGenerator) ModelsDefinitionsImports added in v2.1.1756

func (g *JacksonGenerator) ModelsDefinitionsImports() []string

func (*JacksonGenerator) ModelsUsageImports added in v2.1.1756

func (g *JacksonGenerator) ModelsUsageImports() []string

func (*JacksonGenerator) ReadJson

func (g *JacksonGenerator) ReadJson(varJson string, typ *spec.TypeDef) (string, string)

func (*JacksonGenerator) SetupImport

func (g *JacksonGenerator) SetupImport(jsonPackage packages.Module) string

func (*JacksonGenerator) SetupLibrary

func (g *JacksonGenerator) SetupLibrary(thePackage packages.Module) []generator.CodeFile

func (*JacksonGenerator) VersionModels

func (g *JacksonGenerator) VersionModels(version *spec.Version, thePackage packages.Module, jsonPackage packages.Module) []generator.CodeFile

func (*JacksonGenerator) WriteJson

func (g *JacksonGenerator) WriteJson(varData string, typ *spec.TypeDef) (string, string)

func (*JacksonGenerator) WriteJsonNoCheckedException added in v2.1.1754

func (g *JacksonGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string

type MoshiGenerator

type MoshiGenerator struct {
	Types *types.Types
	// contains filtered or unexported fields
}

func NewMoshiGenerator

func NewMoshiGenerator(types *types.Types) *MoshiGenerator

func (*MoshiGenerator) CreateJsonMapperField

func (g *MoshiGenerator) CreateJsonMapperField(w *generator.Writer, annotation string)

func (*MoshiGenerator) GenerateJsonParseException added in v2.1.1756

func (g *MoshiGenerator) GenerateJsonParseException(thePackage, modelsPackage packages.Module) *generator.CodeFile

func (*MoshiGenerator) InitJsonMapper

func (g *MoshiGenerator) InitJsonMapper(w *generator.Writer)

func (*MoshiGenerator) ModelsDefinitionsImports added in v2.1.1756

func (g *MoshiGenerator) ModelsDefinitionsImports() []string

func (*MoshiGenerator) ModelsUsageImports added in v2.1.1756

func (g *MoshiGenerator) ModelsUsageImports() []string

func (*MoshiGenerator) ReadJson

func (g *MoshiGenerator) ReadJson(varJson string, typ *spec.TypeDef) (string, string)

func (*MoshiGenerator) SetupImport

func (g *MoshiGenerator) SetupImport(jsonPackage packages.Module) string

func (*MoshiGenerator) SetupLibrary

func (g *MoshiGenerator) SetupLibrary(thePackage packages.Module) []generator.CodeFile

func (*MoshiGenerator) VersionModels

func (g *MoshiGenerator) VersionModels(version *spec.Version, thePackage packages.Module, jsonPackage packages.Module) []generator.CodeFile

func (*MoshiGenerator) WriteJson

func (g *MoshiGenerator) WriteJson(varData string, typ *spec.TypeDef) (string, string)

func (*MoshiGenerator) WriteJsonNoCheckedException added in v2.1.1754

func (g *MoshiGenerator) WriteJsonNoCheckedException(varData string, typ *spec.TypeDef) string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL