java

package
v0.0.0-...-124a906 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

tgen Java support

Deploy

  • Mac

    $ GOOS=darwin GOARCH=amd64 go build -v

  • Ubuntu

    $ GOOS=linux GOARCH=amd64 go build -v

How to use

$ ./tgen gen -l java -i example/java/Category.thrift -o ./javatest

or

$ go run main.go gen -l java -i example/java/Category.thrift -o ./javatest

Unit test

  1. put thrift files to example/java
  2. put ref files to example/java/ref/[jsonrpc & rest]
  3. $ go test ./langs/java

Documentation

Index

Constants

View Source
const (
	JavaTypeshort  = "short"
	JavaTypeint    = "int"
	JavaTypelong   = "long"
	JavaTypebool   = "boolean"
	JavaTypebyte   = "byte"
	JavaTypedouble = "double"

	JavaTypeString = "String"

	JavaTypeShort  = "Short"
	JavaTypeInt    = "Integer"
	JavaTypeLong   = "Long"
	JavaTypeBool   = "Boolean"
	JavaTypeByte   = "Byte"
	JavaTypeDouble = "Double"
)
View Source
const (
	TPL_STRUCT  = "tgen/java/struct"
	TPL_SERVICE = "tgen/java/service"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseJava

type BaseJava struct {
	Namespace string
	// contains filtered or unexported fields
}

func (*BaseJava) AssembleParams

func (this *BaseJava) AssembleParams(method *parser.Method) string

func (*BaseJava) FilterVariableName

func (this *BaseJava) FilterVariableName(n string) string

func (*BaseJava) GetInnerType

func (this *BaseJava) GetInnerType(t *parser.Type) string

func (*BaseJava) IsKeyword

func (this *BaseJava) IsKeyword(n string) bool

func (*BaseJava) ObjectTypecast

func (this *BaseJava) ObjectTypecast(t *parser.Type) string

func (*BaseJava) PlainTypecast

func (this *BaseJava) PlainTypecast(t *parser.Type) string

type JavaGen

type JavaGen struct {
	langs.BaseGen
}

func (*JavaGen) Generate

func (g *JavaGen) Generate(output string, parsedThrift map[string]*parser.Thrift)

Jump to

Keyboard shortcuts

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