genjava

package
v2.1.1260 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 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"
View Source
var ToPascalCase = casee.ToPascalCase

Functions

func DefaultValue

func DefaultValue(typ *spec.TypeDef, value string) string

func GenerateClient added in v2.1.859

func GenerateClient(specification *spec.Spec, jsonlib string, packageName string, generatePath string) *sources.Sources

func GenerateModels

func GenerateModels(specification *spec.Spec, jsonlib string, packageName string, generatePath string) *sources.Sources

func GenerateService added in v2.0.602

func GenerateService(specification *spec.Spec, jsonlib string, packageName string, swaggerPath string, generatePath string, servicesPath string) *sources.Sources

func JoinDelimParams added in v2.1.880

func JoinDelimParams(params []string) string

func JoinParams

func JoinParams(params []string) string

func NewJavaWriter

func NewJavaWriter() *sources.Writer

func TrimSlash added in v2.1.1060

func TrimSlash(param string) string

Types

type Generator added in v2.1.1246

type Generator struct {
	Jsonlib string
	Types   *Types
	Models  ModelsGenerator
}

func NewGenerator added in v2.1.1246

func NewGenerator(jsonlib string) *Generator

type JacksonGenerator added in v2.1.1246

type JacksonGenerator struct {
	Type *Types
}

func NewJacksonGenerator added in v2.1.1246

func NewJacksonGenerator(types *Types) *JacksonGenerator

func (*JacksonGenerator) EnumModel added in v2.1.1246

func (g *JacksonGenerator) EnumModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile

func (*JacksonGenerator) ObjectModel added in v2.1.1246

func (g *JacksonGenerator) ObjectModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile

func (*JacksonGenerator) OneOfModel added in v2.1.1246

func (g *JacksonGenerator) OneOfModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile

func (*JacksonGenerator) SetupLibrary added in v2.1.1246

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

type ModelsGenerator added in v2.1.1246

type ModelsGenerator interface {
	SetupLibrary(thePackage Module) []sources.CodeFile
	ObjectModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile
	OneOfModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile
	EnumModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile
}

func NewModelsGenerator added in v2.1.1246

func NewModelsGenerator(jsonlib string) ModelsGenerator

type Module added in v2.0.614

type Module struct {
	RootPath    string
	Path        string
	PackageName string
	PackageStar string
}

func Package added in v2.0.618

func Package(rootPath string, packageName string) Module

func (Module) GetPath added in v2.0.620

func (m Module) GetPath(filename string) string

func (Module) Subpackage added in v2.0.620

func (m Module) Subpackage(name string) Module

type MoshiGenerator added in v2.1.1246

type MoshiGenerator struct {
	Type *Types
}

func NewMoshiGenerator added in v2.1.1246

func NewMoshiGenerator(types *Types) *MoshiGenerator

func (*MoshiGenerator) EnumModel added in v2.1.1246

func (g *MoshiGenerator) EnumModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile

func (*MoshiGenerator) ObjectModel added in v2.1.1246

func (g *MoshiGenerator) ObjectModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile

func (*MoshiGenerator) OneOfModel added in v2.1.1246

func (g *MoshiGenerator) OneOfModel(model *spec.NamedModel, thePackage Module) *sources.CodeFile

func (*MoshiGenerator) SetupLibrary added in v2.1.1246

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

type Types added in v2.1.1246

type Types struct {
	Jsonlib string
}

func NewTypes added in v2.1.1246

func NewTypes(jsonlib string) *Types

func (*Types) JavaIsReferenceType added in v2.1.1246

func (t *Types) JavaIsReferenceType(typ *spec.TypeDef) bool

func (*Types) JavaType added in v2.1.1246

func (t *Types) JavaType(typ *spec.TypeDef) string

func (*Types) PlainJavaType added in v2.1.1246

func (t *Types) PlainJavaType(typ string, referenceTypesOnly bool) (string, bool)

PlainJavaType Returns Java type name and boolean indicating if the type is reference or value type

Jump to

Keyboard shortcuts

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