Skip to main content

java

Function java 

Source
pub fn java(name: &str) -> Cow<'_, str>
Expand description

The Java spelling of an IDL identifier, as JacORB generates it.

A Java keyword comes back with a single _ in front of it. Measured 2026-08-11 from JacORB 3.9’s output for tests/interop-corpus/identifier-target-keywords: the IDL module package becomes the Java package _package and the enumeration class the class _class, while the enumerators template, virtual and friend keep their spelling, because Java has no such keywords. One underscore, and one is the whole prefix — the same output carries _package and not _java_package, which is why this is a third function and not c with another string in front.

The list is Java SE’s fifty reserved words plus the three literals true, false and null, which §3.9 of the Java Language Specification keeps out of the keyword list but which are just as unusable as an identifier. The contextual words — var, record, sealed, yield — are legal identifiers and are deliberately absent.