models

package
v2.1.1336 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 7 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) *sources.Sources

func NewTypes

func NewTypes(jsonlib string) *types.Types

Types

type Generator

type Generator interface {
	SetupLibrary(thePackage packages.Module) []sources.CodeFile
	VersionModels(version *spec.Version, thePackage packages.Module) []sources.CodeFile
	ReadJson(jsonStr string, javaType string) string
	WriteJson(varData string) string
}

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) ReadJson

func (g *JacksonGenerator) ReadJson(varJson string, typeJava string) string

func (*JacksonGenerator) SetupLibrary

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

func (*JacksonGenerator) VersionModels

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

func (*JacksonGenerator) WriteJson

func (g *JacksonGenerator) WriteJson(varData string) string

type MoshiGenerator

type MoshiGenerator struct {
	Types *types.Types
}

func NewMoshiGenerator

func NewMoshiGenerator(types *types.Types) *MoshiGenerator

func (*MoshiGenerator) ReadJson

func (g *MoshiGenerator) ReadJson(varJson string, typeJava string) string

func (*MoshiGenerator) SetupLibrary

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

func (*MoshiGenerator) VersionModels

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

func (*MoshiGenerator) WriteJson

func (g *MoshiGenerator) WriteJson(varData string) string

Jump to

Keyboard shortcuts

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