Documentation ¶
Overview ¶
Package java implements Java code generation from compiled VDL packages.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetPkgPathXlator ¶
SetPkgPathXlator sets the function used to translate a VDL package path into a Java package path.
Types ¶
type JavaFileInfo ¶
JavaFileInfo stores the name and contents of the generated Java file.
func Generate ¶
func Generate(pkg *compile.Package, env *compile.Env) (ret []JavaFileInfo)
Generate generates Java files for all VDL files in the provided package, returning the list of generated Java files as a slice. Since Java requires that each public class/interface gets defined in a separate file, this method will return one generated file per struct. (Interfaces actually generate two files because we create separate interfaces for clients and servers.) In addition, since Java doesn't support global variables (i.e., variables defined outside of a class), all constants are moved into a special "Consts" class and stored in a separate file. All client bindings are stored in a separate Client.java file. Finally, package documentation (if any) is stored in a "package-info.java" file.
TODO(spetrovic): Run Java formatters on the generated files.
Source Files ¶
- const.go
- file_array.go
- file_client_factory.go
- file_client_impl.go
- file_client_interface.go
- file_constants.go
- file_enum.go
- file_error.go
- file_list.go
- file_map.go
- file_package_info.go
- file_primitive.go
- file_server_interface.go
- file_server_wrapper.go
- file_set.go
- file_struct.go
- file_union.go
- generate.go
- util.go
- util_args.go
- util_doc.go
- util_file.go
- util_interface.go
- util_method.go
- util_path.go
- util_template.go
- util_type.go
- util_val.go