pub struct JavaGenOptions {
pub root_package: String,
pub indent_width: usize,
pub use_records: bool,
pub emit_amqp_helpers: bool,
pub emit_corba_traits: bool,
pub emit_typesupport: bool,
pub java8_compat: bool,
}Expand description
Configuration of the Java code generator.
Fields§
§root_package: StringJava root package that all generated classes belong to
(e.g. "org.example.types"). Empty string = default package.
indent_width: usizeIndent width in spaces. Default 4.
use_records: boolIf true, flat aggregate types are emitted as Java record
(Java 14+). Default false — the spec requires the bean pattern.
emit_amqp_helpers: boolSpec §7.2.3 / §8.1.2 / §8.1.3 — opt-in: emits per top-level
struct/union an additional <TypeName>AmqpCodec.java file with
static toAmqpValue / toJsonString helpers. Default false,
because the emitted calls require an org.zerodds.amqp runtime
library.
emit_corba_traits: boolAnnex A.1 (idl4-java-1.0) — opt-in: emits per top-level type an
additional <TypeName>CorbaTraits.java file with per-type
constants (FULL_NAME, IS_VARIABLE_SIZE, IS_LOCAL).
Default false.
emit_typesupport: boolSpec zerodds-xcdr2-java-1.0 §4 — opt-in: emits per top-level
struct an additional <TypeName>TypeSupport.java file with an
org.zerodds.cdr.TopicTypeSupport<T> implementation
(encode/decode/keyHash + INSTANCE). Default true from v1.0
(spec-mandatory).
java8_compat: boolJava-8 compat mode — opt-in. If true, the emitter avoids all
Java-9+ constructs: unions are emitted as an abstract class with
a private constructor (pseudo-sealing) + static final subclasses
instead of as a sealed interface + record (Java 17).
Structs are bean classes anyway (use_records=false) and thus
already Java-8-capable. Default false (standard = Java 17).
Trait Implementations§
Source§impl Clone for JavaGenOptions
impl Clone for JavaGenOptions
Source§fn clone(&self) -> JavaGenOptions
fn clone(&self) -> JavaGenOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more