[][src]Module genco::java

Specialization for Java code generation.

Examples

String quoting in Java:

#[feature(proc_macro_hygiene)]
use genco::prelude::*;

let toks: java::Tokens = quote!(#("hello \n world".quoted()));
assert_eq!("\"hello \\n world\"", toks.to_string().unwrap());

Structs

BlockComment

Format a block comment, starting with /**, and ending in */.

Config

Configuration for Java formatting.

Java

Language specialization for Java.

Local

A local name with no specific qualification.

Optional

An optional type.

Primitive

A primitive type.

Type

A class.

TypeBox

Boxed type container

Void

The void type.

Enums

Modifier

A Java modifier.

TypeEnum

Enum that can be used for casting between variants of the same type

Constants

BOOLEAN

Boolean primitive type.

BYTE

Byte primitive type.

CHAR

Char primitive type.

DOUBLE

Double primitive type.

FLOAT

Float primitive type.

INTEGER

Integer primitive type.

LONG

Long primitive type.

SHORT

Short primitive type.

VOID

Void type.

Traits

TypeArgs

Helper trait for things that can be turned into generic arguments.

TypeTrait

Trait implemented by all types

Functions

block_comment

Format a doc comment where each line is preceeded by ///.

imported

Setup an imported element.

local

Setup a local element from borrowed components.

optional

Setup an optional type.

Type Definitions

Tokens

Tokens container specialized for Java.