Module java

Source
Expand description

Specialization for Java code generation.

§String Quoting in Java

Since Java uses UTF-16 internally, string quoting for high unicode characters is done through surrogate pairs, as seen with the 😊 below.

use genco::prelude::*;

let toks: java::Tokens = quote!("start π 😊 \n \x7f end");
assert_eq!("\"start \\u03c0 \\ud83d\\ude0a \\n \\u007f end\"", toks.to_string()?);

Structs§

BlockComment
Format a block comment, starting with /**, and ending in */.
Config
Configuration for Java.
Format
Formtat state for Java.
Import
The import of a Java type import java.util.Optional;.
Java
Language specialization for Java.

Enums§

Any
A type-erased language item capable of holding any kind.

Functions§

block_comment
Format a block comment, starting with /**, and ending in */.
import
The import of a Java type import java.util.Optional;.

Type Aliases§

Tokens
Tokens container specialized for Java.